Browse Source

add get_time() from Steven Osman

David Rose 22 years ago
parent
commit
28a96485ab
2 changed files with 22 additions and 0 deletions
  1. 20 0
      panda/src/device/trackerNode.I
  2. 2 0
      panda/src/device/trackerNode.h

+ 20 - 0
panda/src/device/trackerNode.I

@@ -50,6 +50,26 @@ get_orient() const {
   return _data.get_orient();
 }
 
+////////////////////////////////////////////////////////////////////
+//     Function: TrackerNode::get_time
+//       Access: Public
+//  Description: Returns the time of the tracker's last update.
+////////////////////////////////////////////////////////////////////
+INLINE double TrackerNode::
+get_time() const {
+  return _data.get_time();
+}
+
+////////////////////////////////////////////////////////////////////
+//     Function: TrackerNode::has_time
+//       Access: Public
+//  Description: True if this data comes with timestamps.
+////////////////////////////////////////////////////////////////////
+INLINE bool TrackerNode::
+has_time() const {
+  return _data.has_time();
+}
+
 ////////////////////////////////////////////////////////////////////
 //     Function: TrackerNode::get_transform
 //       Access: Public

+ 2 - 0
panda/src/device/trackerNode.h

@@ -47,6 +47,8 @@ PUBLISHED:
   INLINE const LPoint3f &get_pos() const;
   INLINE const LOrientationf &get_orient() const;
   INLINE const LMatrix4f &get_transform() const;
+  INLINE double get_time() const;
+  INLINE bool has_time() const;
 
   INLINE void set_tracker_coordinate_system(CoordinateSystem cs);
   INLINE CoordinateSystem get_tracker_coordinate_system() const;