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