Panda3D
trackerNode.I
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file trackerNode.I
10  * @author drose
11  * @date 2002-03-12
12  */
13 
14 /**
15  * Returns true if the TrackerNode is valid and connected to a server, false
16  * otherwise.
17  */
18 INLINE bool TrackerNode::
19 is_valid() const {
20  return (!_tracker.is_null()/* && _tracker->is_connected()*/);
21 }
22 
23 /**
24  * Returns the current position of the tracker, if it is available.
25  */
26 INLINE const LPoint3 &TrackerNode::
27 get_pos() const {
28  return _data.get_pos();
29 }
30 
31 /**
32  * Returns the current orientation of the tracker, if it is available.
33  */
34 INLINE const LOrientation &TrackerNode::
35 get_orient() const {
36  return _data.get_orient();
37 }
38 
39 /**
40  * Returns the time of the tracker's last update.
41  */
42 INLINE double TrackerNode::
43 get_time() const {
44  return _data.get_time();
45 }
46 
47 /**
48  * True if this data comes with timestamps.
49  */
50 INLINE bool TrackerNode::
51 has_time() const {
52  return _data.has_time();
53 }
54 
55 /**
56  * Returns the current position and orientation of the tracker, as a combined
57  * matrix.
58  */
59 INLINE const LMatrix4 &TrackerNode::
60 get_transform() const {
61  return _mat;
62 }
63 
64 
65 /**
66  * Specifies the coordinate system that the tracker associated with this node
67  * will operate in. Normally, this is set from the ClientBase that's used to
68  * create the TrackerNode, so it should not need to be set on an individual
69  * tracker basis.
70  */
71 INLINE void TrackerNode::
72 set_tracker_coordinate_system(CoordinateSystem cs) {
73  _tracker_cs = cs;
74  if (_tracker_cs == CS_default) {
75  _tracker_cs = get_default_coordinate_system();
76  }
77 }
78 
79 /**
80  * Returns the coordinate system that the tracker associated with this node
81  * will operate in.
82  */
83 INLINE CoordinateSystem TrackerNode::
85  return _tracker_cs;
86 }
87 
88 /**
89  * Specifies the coordinate system that the TrackerNode will convert its
90  * transform into for passing down the data graph. Normally, this is
91  * CS_default.
92  */
93 INLINE void TrackerNode::
94 set_graph_coordinate_system(CoordinateSystem cs) {
95  _graph_cs = cs;
96  if (_graph_cs == CS_default) {
97  _graph_cs = get_default_coordinate_system();
98  }
99 }
100 
101 /**
102  * Returns the coordinate system that the TrackerNode will convert its
103  * transform into for passing down the data graph. Normally, this is
104  * CS_default.
105  */
106 INLINE CoordinateSystem TrackerNode::
108  return _graph_cs;
109 }
get_time
Returns the time at which the position information (pos and orient) are effective.
Definition: trackerData.h:48
CoordinateSystem get_graph_coordinate_system() const
Returns the coordinate system that the TrackerNode will convert its transform into for passing down t...
Definition: trackerNode.I:107
void set_tracker_coordinate_system(CoordinateSystem cs)
Specifies the coordinate system that the tracker associated with this node will operate in.
Definition: trackerNode.I:72
bool is_valid() const
Returns true if the TrackerNode is valid and connected to a server, false otherwise.
Definition: trackerNode.I:19
get_pos
Returns the current position of the tracker.
Definition: trackerData.h:49
get_orient
Returns the current orientation of the tracker.
Definition: trackerData.h:50
bool has_time() const
Returns true if the position information time is available.
Definition: trackerData.I:56
CoordinateSystem get_tracker_coordinate_system() const
Returns the coordinate system that the tracker associated with this node will operate in.
Definition: trackerNode.I:84
const LMatrix4 & get_transform() const
Returns the current position and orientation of the tracker, as a combined matrix.
Definition: trackerNode.I:60
const LPoint3 & get_pos() const
Returns the current position of the tracker, if it is available.
Definition: trackerNode.I:27
double get_time() const
Returns the time of the tracker's last update.
Definition: trackerNode.I:43
bool has_time() const
True if this data comes with timestamps.
Definition: trackerNode.I:51
void set_graph_coordinate_system(CoordinateSystem cs)
Specifies the coordinate system that the TrackerNode will convert its transform into for passing down...
Definition: trackerNode.I:94
const LOrientation & get_orient() const
Returns the current orientation of the tracker, if it is available.
Definition: trackerNode.I:35