Trackball

from panda3d.core import Trackball
class Trackball

Bases: MouseInterfaceNode

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.

Inheritance diagram

Inheritance diagram of Trackball

CMDefault = 0
CMDolly = 3
CMPan = 2
CMRoll = 4
CMTruck = 1
CM_default = 0
CM_dolly = 3
CM_pan = 2
CM_roll = 4
CM_truck = 1
__init__(*args, **kwargs)
getClassType()

C++ Interface: get_class_type()

getControlMode()

C++ Interface: get_control_mode(Trackball self)

/**
  • Returns the control mode. See set_control_mode().

*/

getCoordinateSystem()

C++ Interface: get_coordinate_system(Trackball self)

/**
  • Returns the coordinate system of the Trackball. See

  • set_coordinate_system().

*/

getForwardScale()

C++ Interface: get_forward_scale(Trackball self)

/**
  • Returns the scale factor applied to forward and backward motion. See

  • set_forward_scale().

*/

getH()

C++ Interface: get_h(Trackball self)

getHpr()

C++ Interface: get_hpr(Trackball self)

/**
  • Return the trackball’s orientation.

*/

getInvert()

C++ Interface: get_invert(Trackball self)

/**
  • 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.

*/

getMat()

C++ Interface: get_mat(Trackball self)

/**
  • Returns the matrix represented by the trackball rotation.

*/

getOrigin()

C++ Interface: get_origin(Trackball self)

/**
  • Returns the current center of rotation.

*/

getP()

C++ Interface: get_p(Trackball self)

getPos()

C++ Interface: get_pos(Trackball self)

/**
  • Return the offset from the center of rotation.

*/

getR()

C++ Interface: get_r(Trackball self)

getRelTo()

C++ Interface: get_rel_to(Trackball self)

/**
  • Returns the NodePath that all trackball manipulations are relative to, or

  • the empty path.

*/

getTransMat()

C++ Interface: get_trans_mat(Trackball self)

/**
  • Returns the actual transform that will be applied to the scene graph. This

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

*/

getX()

C++ Interface: get_x(Trackball self)

getY()

C++ Interface: get_y(Trackball self)

getZ()

C++ Interface: get_z(Trackball self)

get_class_type()

C++ Interface: get_class_type()

get_control_mode()

C++ Interface: get_control_mode(Trackball self)

/**
  • Returns the control mode. See set_control_mode().

*/

get_coordinate_system()

C++ Interface: get_coordinate_system(Trackball self)

/**
  • Returns the coordinate system of the Trackball. See

  • set_coordinate_system().

*/

get_forward_scale()

C++ Interface: get_forward_scale(Trackball self)

/**
  • Returns the scale factor applied to forward and backward motion. See

  • set_forward_scale().

*/

get_h()

C++ Interface: get_h(Trackball self)

get_hpr()

C++ Interface: get_hpr(Trackball self)

/**
  • Return the trackball’s orientation.

*/

get_invert()

C++ Interface: get_invert(Trackball self)

/**
  • 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.

*/

get_mat()

C++ Interface: get_mat(Trackball self)

/**
  • Returns the matrix represented by the trackball rotation.

*/

get_origin()

C++ Interface: get_origin(Trackball self)

/**
  • Returns the current center of rotation.

*/

get_p()

C++ Interface: get_p(Trackball self)

get_pos()

C++ Interface: get_pos(Trackball self)

/**
  • Return the offset from the center of rotation.

*/

get_r()

C++ Interface: get_r(Trackball self)

get_rel_to()

C++ Interface: get_rel_to(Trackball self)

/**
  • Returns the NodePath that all trackball manipulations are relative to, or

  • the empty path.

*/

get_trans_mat()

C++ Interface: get_trans_mat(Trackball self)

/**
  • Returns the actual transform that will be applied to the scene graph. This

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

*/

get_x()

C++ Interface: get_x(Trackball self)

get_y()

C++ Interface: get_y(Trackball self)

get_z()

C++ Interface: get_z(Trackball self)

moveOrigin()

C++ Interface: move_origin(const Trackball self, float x, float y, float z)

/**
  • Moves the center of rotation by the given amount.

*/

move_origin()

C++ Interface: move_origin(const Trackball self, float x, float y, float z)

/**
  • Moves the center of rotation by the given amount.

*/

reset()

C++ Interface: reset(const Trackball self)

/**
  • Reinitializes all transforms to identity.

*/

resetOriginHere()

C++ Interface: reset_origin_here(const Trackball self)

/**
  • Reposition the center of rotation to coincide with the current translation

  • offset. Future rotations will be about the current origin.

*/

reset_origin_here()

C++ Interface: reset_origin_here(const Trackball self)

/**
  • Reposition the center of rotation to coincide with the current translation

  • offset. Future rotations will be about the current origin.

*/

setControlMode()

C++ Interface: set_control_mode(const Trackball self, int 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()

C++ Interface: set_coordinate_system(const Trackball self, int 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()

C++ Interface: set_forward_scale(const Trackball self, 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()

C++ Interface: set_h(const Trackball self, float h)

setHpr()

C++ Interface: set_hpr(const Trackball self, const LVecBase3f hpr) set_hpr(const Trackball self, float h, float p, float r)

/**
  • Directly set the mover’s orientation.

*/

setInvert()

C++ Interface: set_invert(const Trackball self, 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()

C++ Interface: set_mat(const Trackball self, const LMatrix4f mat)

/**
  • Stores the indicated transform in the trackball. This is a transform in

  • global space, regardless of the rel_to node.

*/

setOrigin()

C++ Interface: set_origin(const Trackball self, const LVecBase3f origin)

/**
  • Directly sets the center of rotation.

*/

setP()

C++ Interface: set_p(const Trackball self, float p)

setPos()

C++ Interface: set_pos(const Trackball self, const LVecBase3f vec) set_pos(const Trackball self, float x, float y, float z)

/**
  • Directly set the offset from the rotational origin.

*/

setR()

C++ Interface: set_r(const Trackball self, float r)

setRelTo()

C++ Interface: set_rel_to(const Trackball self, const NodePath 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()

C++ Interface: set_x(const Trackball self, float x)

setY()

C++ Interface: set_y(const Trackball self, float y)

setZ()

C++ Interface: set_z(const Trackball self, float z)

set_control_mode()

C++ Interface: set_control_mode(const Trackball self, int 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.

*/

set_coordinate_system()

C++ Interface: set_coordinate_system(const Trackball self, int 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.

*/

set_forward_scale()

C++ Interface: set_forward_scale(const Trackball self, 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.

*/

set_h()

C++ Interface: set_h(const Trackball self, float h)

set_hpr()

C++ Interface: set_hpr(const Trackball self, const LVecBase3f hpr) set_hpr(const Trackball self, float h, float p, float r)

/**
  • Directly set the mover’s orientation.

*/

set_invert()

C++ Interface: set_invert(const Trackball self, 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.

*/

set_mat()

C++ Interface: set_mat(const Trackball self, const LMatrix4f mat)

/**
  • Stores the indicated transform in the trackball. This is a transform in

  • global space, regardless of the rel_to node.

*/

set_origin()

C++ Interface: set_origin(const Trackball self, const LVecBase3f origin)

/**
  • Directly sets the center of rotation.

*/

set_p()

C++ Interface: set_p(const Trackball self, float p)

set_pos()

C++ Interface: set_pos(const Trackball self, const LVecBase3f vec) set_pos(const Trackball self, float x, float y, float z)

/**
  • Directly set the offset from the rotational origin.

*/

set_r()

C++ Interface: set_r(const Trackball self, float r)

set_rel_to()

C++ Interface: set_rel_to(const Trackball self, const NodePath 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.

*/

set_x()

C++ Interface: set_x(const Trackball self, float x)

set_y()

C++ Interface: set_y(const Trackball self, float y)

set_z()

C++ Interface: set_z(const Trackball self, float z)