Panda3D

- Main Page
- Packages
- Classes

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Types | Public Member Functions | Static Public Member Functions

# Trackball Class Reference

Trackball acts like Performer in trackball mode. More...

Inheritance diagram for Trackball:

List of all members.

## Public Types
enum | ControlMode { CMDefault = 0, CMTruck = 1, CMPan = 2, CMDolly = 3, CMRoll = 4 }
## Public Member Functions
| Trackball (string name)
ControlMode | getControlMode ()
| Returns the control mode.
CoordinateSystem | getCoordinateSystem ()
| Returns the coordinate system of the Trackball.
float | getForwardScale ()
| Returns the scale factor applied to forward and backward motion.
float | getH ()
VBase3 | getHpr ()
| Return the trackball's orientation.
bool | getInvert ()
| Returns the invert flag.
Mat4 const | getMat ()
| Returns the matrix represented by the trackball rotation.
Point3 | getOrigin ()
| Returns the current center of rotation.
float | getP ()
Point3 const | getPos ()
| Return the offset from the center of rotation.
float | getR ()
NodePath const | getRelTo ()
| Returns the NodePath that all trackball manipulations are relative to, or the empty path.
Mat4 const | getTransMat ()
| Returns the actual transform that will be applied to the scene graph.
float | getX ()
float | getY ()
float | getZ ()
| moveOrigin (float x, float y, float z)
| Moves the center of rotation by the given amount.
| reset ()
| Reinitializes all transforms to identity.
| resetOriginHere ()
| Reposition the center of rotation to coincide with the current translation offset.
| setControlMode (ControlMode control_mode)
| Sets the control mode.
| setCoordinateSystem (CoordinateSystem cs)
| Sets the coordinate system of the Trackball.
| setForwardScale (float fwdscale)
| Changes the scale factor applied to forward and backward motion.
| setH (float h)
| setHpr (VBase3 const hpr)
| Directly set the mover's orientation.
| setHpr (float h, float p, float r)
| setInvert (bool flag)
| Sets the invert flag.
| setMat (Mat4 const mat)
| Stores the indicated transform in the trackball.
| setOrigin (VBase3 const origin)
| Directly sets the center of rotation.
| setP (float p)
| setPos (float x, float y, float z)
| setPos (VBase3 const vec)
| Directly set the offset from the rotational origin.
| setR (float r)
| setRelTo (NodePath const rel_to)
| Sets the NodePath that all trackball manipulations are to be assumed to be relative to.
| setX (float x)
| setY (float y)
| setZ (float z)
## Static Public Member Functions
static TypeHandle | getClassType ()

## Detailed Description

Trackball acts like Performer in trackball mode.

It can either spin around a piece of geometry directly, or it can spin around a camera with the inverse transform to make it appear that the whole world is spinning.

The Trackball object actually just places a transform in the data graph; parent a Transform2SG node under it to actually transform objects (or cameras) in the world.

## Member Enumeration Documentation

enum ControlMode

Enumerator:

  CMDefault |
  CMTruck |
  CMPan |
  CMDolly |
  CMRoll |

## Constructor & Destructor Documentation

Trackball | ( | string | name | ) |

## Member Function Documentation

static TypeHandle getClassType | ( |  | ) | `[static]`

Reimplemented from MouseInterfaceNode.

ControlMode getControlMode | ( |  | ) |

Returns the control mode.

See set_control_mode().

CoordinateSystem getCoordinateSystem | ( |  | ) |

Returns the coordinate system of the Trackball.

See set_coordinate_system().

float getForwardScale | ( |  | ) |

Returns the scale factor applied to forward and backward motion.

See set_forward_scale().

float getH | ( |  | ) |

VBase3 getHpr | ( |  | ) |

Return the trackball's orientation.

bool getInvert | ( |  | ) |

Returns the invert flag.

When this is set, the inverse matrix is generated, suitable for joining to a camera, instead of parenting the scene under it.

Mat4 const getMat | ( |  | ) |

Returns the matrix represented by the trackball rotation.

Point3 getOrigin | ( |  | ) |

Returns the current center of rotation.

float getP | ( |  | ) |

Point3 const getPos | ( |  | ) |

Return the offset from the center of rotation.

float getR | ( |  | ) |

NodePath const getRelTo | ( |  | ) |

Returns the NodePath that all trackball manipulations are relative to, or the empty path.

Mat4 const getTransMat | ( |  | ) |

Returns the actual transform that will be applied to the scene graph.

This is the same as get_mat(), unless invert is in effect.

float getX | ( |  | ) |

float getY | ( |  | ) |

float getZ | ( |  | ) |

moveOrigin | ( | float | x,
|  | float | y,
|  | float | z
| ) |  |

Moves the center of rotation by the given amount.

reset | ( |  | ) |

Reinitializes all transforms to identity.

resetOriginHere | ( |  | ) |

Reposition the center of rotation to coincide with the current translation offset.

Future rotations will be about the current origin.

setControlMode | ( | ControlMode | control_mode | ) |

Sets the control mode.

Normally this is CM_default, which means each mouse button serves its normal function. When it is CM_truck, CM_pan, CM_dolly, or CM_roll, all of the mouse buttons serve the indicated function instead of their normal function. This can be used in conjunction with some external way of changing modes.

setCoordinateSystem | ( | CoordinateSystem | cs | ) |

Sets the coordinate system of the Trackball.

Normally, this is the default coordinate system. This changes the axes the Trackball manipulates so that the user interface remains consistent across different coordinate systems.

setForwardScale | ( | float | fwdscale | ) |

Changes the scale factor applied to forward and backward motion.

The larger this number, the faster the model will move in response to dollying in and out.

setH | ( | float | h | ) |

setHpr | ( | VBase3 const | hpr | ) |

Directly set the mover's orientation.

setHpr | ( | float | h,
|  | float | p,
|  | float | r
| ) |  |

setInvert | ( | bool | flag | ) |

Sets the invert flag.

When this is set, the inverse matrix is generated, suitable for joining to a camera, instead of parenting the scene under it.

setMat | ( | Mat4 const | mat | ) |

Stores the indicated transform in the trackball.

This is a transform in global space, regardless of the rel_to node.

setOrigin | ( | VBase3 const | origin | ) |

Directly sets the center of rotation.

setP | ( | float | p | ) |

setPos | ( | float | x,
|  | float | y,
|  | float | z
| ) |  |

setPos | ( | VBase3 const | vec | ) |

Directly set the offset from the rotational origin.

setR | ( | float | r | ) |

setRelTo | ( | NodePath const | rel_to | ) |

Sets the NodePath that all trackball manipulations are to be assumed to be relative to.

For instance, set your camera node here to make the trackball motion camera relative. The default is the empty path, which means trackball motion is in global space.

setX | ( | float | x | ) |

setY | ( | float | y | ) |

setZ | ( | float | z | ) |

All Classes Namespaces Functions Variables Enumerations Enumerator Properties