Trackball
from panda3d.core import Trackball
- class Trackball
Bases:
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
-
enum ControlMode
-
enumerator CM_default = 0
-
enumerator CM_truck = 1
Normally mouse 1
-
enumerator CM_pan = 2
Normally mouse 2
-
enumerator CM_dolly = 3
Normally mouse 3
-
enumerator CM_roll = 4
Normally mouse 2 + 3
-
enumerator CM_default = 0
- __init__(name: str)
- static get_class_type() TypeHandle
- get_control_mode() ControlMode
Returns the control mode. See
set_control_mode()
.
- get_coordinate_system() CoordinateSystem
Returns the coordinate system of the Trackball. See
set_coordinate_system()
.
- get_forward_scale() float
Returns the scale factor applied to forward and backward motion. See
set_forward_scale()
.
- get_invert() bool
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_rel_to() NodePath
Returns the
NodePath
that all trackball manipulations are relative to, or the empty path.
- get_trans_mat() LMatrix4
Returns the actual transform that will be applied to the scene graph. This is the same as
get_mat()
, unless invert is in effect.
- reset()
Reinitializes all transforms to identity.
- reset_origin_here()
Reposition the center of rotation to coincide with the current translation offset. Future rotations will be about the current origin.
- set_control_mode(control_mode: ControlMode)
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(cs: CoordinateSystem)
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(fwdscale: float)
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_invert(flag: bool)
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(mat: LMatrix4)
Stores the indicated transform in the trackball. This is a transform in global space, regardless of the rel_to node.
-
enum ControlMode