35class EXPCL_PANDA_TFORM Trackball :
public MouseInterfaceNode {
37 explicit Trackball(
const std::string &name);
48 PN_stdfloat get_x()
const;
49 PN_stdfloat get_y()
const;
50 PN_stdfloat get_z()
const;
51 void set_pos(
const LVecBase3 &vec);
52 void set_pos(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z);
53 void set_x(PN_stdfloat x);
54 void set_y(PN_stdfloat y);
55 void set_z(PN_stdfloat z);
60 PN_stdfloat get_h()
const;
61 PN_stdfloat get_p()
const;
62 PN_stdfloat get_r()
const;
63 void set_hpr(
const LVecBase3 &hpr);
64 void set_hpr(PN_stdfloat h, PN_stdfloat p, PN_stdfloat r);
65 void set_h(PN_stdfloat h);
66 void set_p(PN_stdfloat p);
67 void set_r(PN_stdfloat r);
72 void move_origin(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z);
99 void set_mat(
const LMatrix4 &mat);
100 const LMatrix4 &
get_mat()
const;
105 void apply(
double x,
double y,
int button);
111 PN_stdfloat _lastx, _lasty;
113 PN_stdfloat _rotscale;
114 PN_stdfloat _fwdscale;
117 LPoint3 _translation;
118 LMatrix4 _mat, _orig;
121 CoordinateSystem _cs;
122 ControlMode _control_mode;
135 int _transform_output;
143 static void init_type() {
144 MouseInterfaceNode::init_type();
146 MouseInterfaceNode::get_class_type());
149 return get_class_type();
151 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
This object supervises the traversal of the data graph and the moving of data from one DataNode to it...
Encapsulates the data generated from (or sent into) any particular DataNode.
void reset()
Reinitializes all transforms to identity.
const LMatrix4 & get_mat() const
Returns the matrix represented by the trackball rotation.
const LMatrix4 & get_trans_mat() const
Returns the actual transform that will be applied to the scene graph.
void set_control_mode(ControlMode control_mode)
Sets the control mode.
void set_hpr(const LVecBase3 &hpr)
Directly set the mover's orientation.
LVecBase3 get_hpr() const
Return the trackball's orientation.
const LPoint3 & get_pos() const
Return the offset from the center of rotation.
bool get_invert() const
Returns the invert flag.
void set_origin(const LVecBase3 &origin)
Directly sets the center of rotation.
PN_stdfloat get_forward_scale() const
Returns the scale factor applied to forward and backward motion.
CoordinateSystem get_coordinate_system() const
Returns the coordinate system of the Trackball.
void move_origin(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z)
Moves the center of rotation by the given amount.
void reset_origin_here()
Reposition the center of rotation to coincide with the current translation offset.
void set_coordinate_system(CoordinateSystem cs)
Sets the coordinate system of the Trackball.
void set_invert(bool flag)
Sets the invert flag.
LPoint3 get_origin() const
Returns the current center of rotation.
void set_rel_to(const NodePath &rel_to)
Sets the NodePath that all trackball manipulations are to be assumed to be relative to.
void set_mat(const LMatrix4 &mat)
Stores the indicated transform in the trackball.
void set_pos(const LVecBase3 &vec)
Directly set the offset from the rotational origin.
const NodePath & get_rel_to() const
Returns the NodePath that all trackball manipulations are relative to, or the empty path.
ControlMode get_control_mode() const
Returns the control mode.
void set_forward_scale(PN_stdfloat fwdscale)
Changes the scale factor applied to forward and backward motion.
TypeHandle is the identifier used to differentiate C++ class types.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...