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();
101 _data.get_orient().extract_to_matrix(_mat);
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);
111 output.set_data(_transform_output, EventParameter(_transform));
An abstract base class for a family of client device interfaces–including trackers,...
PointerTo< ClientDevice > get_device(TypeHandle device_type, const std::string &device_name)
Returns a ClientDevice pointer that corresponds to the named device of the indicated device type.
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.
The fundamental type of node for the data graph.
void output(std::ostream &out) const
Outputs the Namable.
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.