Panda3D
|
This is the primary interface to a Tracker object associated with a ClientBase. More...
#include "trackerNode.h"
Public Member Functions | |
TrackerNode (ClientBase *client, const string &device_name) | |
virtual TypeHandle | force_init_type () |
CoordinateSystem | get_graph_coordinate_system () const |
Returns the coordinate system that the TrackerNode will convert its transform into for passing down the data graph. | |
const LOrientation & | get_orient () const |
Returns the current orientation of the tracker, if it is available. | |
const LPoint3 & | get_pos () const |
Returns the current position of the tracker, if it is available. | |
double | get_time () const |
Returns the time of the tracker's last update. | |
CoordinateSystem | get_tracker_coordinate_system () const |
Returns the coordinate system that the tracker associated with this node will operate in. | |
const LMatrix4 & | get_transform () const |
Returns the current position and orientation of the tracker, as a combined matrix. | |
virtual TypeHandle | get_type () const |
bool | has_time () const |
True if this data comes with timestamps. | |
bool | is_valid () const |
Returns true if the TrackerNode is valid and connected to a server, false otherwise. | |
void | set_graph_coordinate_system (CoordinateSystem cs) |
Specifies the coordinate system that the TrackerNode will convert its transform into for passing down the data graph. | |
void | set_tracker_coordinate_system (CoordinateSystem cs) |
Specifies the coordinate system that the tracker associated with this node will operate in. | |
Static Public Member Functions | |
static TypeHandle | get_class_type () |
static void | init_type () |
Protected Member Functions | |
virtual void | do_transmit_data (DataGraphTraverser *trav, const DataNodeTransmit &input, DataNodeTransmit &output) |
The virtual implementation of transmit_data(). |
This is the primary interface to a Tracker object associated with a ClientBase.
It reads the position and orientation information from the tracker and makes it available as a transformation on the data graph.
Definition at line 36 of file trackerNode.h.
void TrackerNode::do_transmit_data | ( | DataGraphTraverser * | trav, |
const DataNodeTransmit & | input, | ||
DataNodeTransmit & | output | ||
) | [protected, virtual] |
The virtual implementation of transmit_data().
This function receives an array of input parameters and should generate an array of output parameters. The input parameters may be accessed with the index numbers returned by the define_input() calls that were made earlier (presumably in the constructor); likewise, the output parameters should be set with the index numbers returned by the define_output() calls.
Reimplemented from DataNode.
Definition at line 83 of file trackerNode.cxx.
References LMatrix4f::convert_mat(), LQuaternionf::extract_to_matrix(), TrackerData::get_orient(), TrackerData::get_pos(), is_valid(), DataNodeTransmit::set_data(), and LMatrix4f::set_row().
CoordinateSystem TrackerNode::get_graph_coordinate_system | ( | ) | const [inline] |
Returns the coordinate system that the TrackerNode will convert its transform into for passing down the data graph.
Normally, this is CS_default.
Definition at line 132 of file trackerNode.I.
const LOrientation & TrackerNode::get_orient | ( | ) | const [inline] |
Returns the current orientation of the tracker, if it is available.
Definition at line 45 of file trackerNode.I.
References TrackerData::get_orient().
const LPoint3 & TrackerNode::get_pos | ( | ) | const [inline] |
Returns the current position of the tracker, if it is available.
Definition at line 34 of file trackerNode.I.
References TrackerData::get_pos().
double TrackerNode::get_time | ( | ) | const [inline] |
Returns the time of the tracker's last update.
Definition at line 55 of file trackerNode.I.
References TrackerData::get_time().
CoordinateSystem TrackerNode::get_tracker_coordinate_system | ( | ) | const [inline] |
Returns the coordinate system that the tracker associated with this node will operate in.
Definition at line 105 of file trackerNode.I.
const LMatrix4 & TrackerNode::get_transform | ( | ) | const [inline] |
Returns the current position and orientation of the tracker, as a combined matrix.
Definition at line 76 of file trackerNode.I.
bool TrackerNode::has_time | ( | ) | const [inline] |
True if this data comes with timestamps.
Definition at line 65 of file trackerNode.I.
References TrackerData::has_time().
bool TrackerNode::is_valid | ( | ) | const [inline] |
Returns true if the TrackerNode is valid and connected to a server, false otherwise.
Definition at line 22 of file trackerNode.I.
Referenced by do_transmit_data().
void TrackerNode::set_graph_coordinate_system | ( | CoordinateSystem | cs | ) | [inline] |
Specifies the coordinate system that the TrackerNode will convert its transform into for passing down the data graph.
Normally, this is CS_default.
Definition at line 117 of file trackerNode.I.
void TrackerNode::set_tracker_coordinate_system | ( | CoordinateSystem | cs | ) | [inline] |
Specifies the coordinate system that the tracker associated with this node will operate in.
Normally, this is set from the ClientBase that's used to create the TrackerNode, so it should not need to be set on an individual tracker basis.
Definition at line 91 of file trackerNode.I.