26TrackerNode(
ClientBase *client,
const std::string &device_name) :
29 _transform_output = define_output(
"transform", TransformState::get_class_type());
31 _transform = TransformState::make_identity();
33 nassertv(client !=
nullptr);
35 set_graph_coordinate_system(CS_default);
38 client->get_device(ClientTrackerDevice::get_class_type(), device_name);
40 if (device ==
nullptr) {
42 <<
"Unable to open tracker device " << device_name <<
"\n";
46 if (!device->is_of_type(ClientTrackerDevice::get_class_type())) {
48 <<
"Inappropriate device type " << device->get_type()
49 <<
" created; expected a ClientTrackerDevice.\n";
64 _transform_output = define_output(
"transform", TransformState::get_class_type());
66 _transform = TransformState::make_identity();
68 nassertv(device !=
nullptr);
72 set_tracker_coordinate_system(CS_default);
73 set_graph_coordinate_system(CS_default);
99 _data = _tracker->get_tracker();
102 if (_tracker_cs != _graph_cs) {
104 _mat = _mat * LMatrix4::convert_mat(_tracker_cs, _graph_cs);
106 _mat.set_row(3, _data.
get_pos());
110 _transform = TransformState::make_mat(_mat);
An abstract base class for a family of client device interfaces–including trackers,...
CoordinateSystem get_coordinate_system() const
Returns the coordinate system that all devices associated with this client will operate in.
Any of a number of different devices that might be attached to a ClientBase, including trackers,...
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 set_data(int index, const EventParameter &data)
Sets the data for the indicated parameter.
The fundamental type of node for the data graph.
An optional parameter associated with an event.
get_pos
Returns the current position of the tracker.
get_orient
Returns the current orientation of the tracker.
bool is_valid() const
Returns true if the TrackerNode is valid and connected to a server, false otherwise.
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.