浏览代码

add get_sample_pos, get_sample_hpr

David Rose 19 年之前
父节点
当前提交
9ac35805f9
共有 2 个文件被更改,包括 31 次插入0 次删除
  1. 28 0
      direct/src/deadrec/smoothMover.I
  2. 3 0
      direct/src/deadrec/smoothMover.h

+ 28 - 0
direct/src/deadrec/smoothMover.I

@@ -236,6 +236,34 @@ set_r(float r) {
   return result;
   return result;
 }
 }
 
 
+////////////////////////////////////////////////////////////////////
+//     Function: SmoothMover::get_sample_pos
+//       Access: Published
+//  Description: Returns the current position of the working sample
+//               point.  This position is updated periodically by
+//               set_x(), set_y(), etc., and its current value is
+//               copied to the sample point table when
+//               mark_position() is called.
+////////////////////////////////////////////////////////////////////
+INLINE const LPoint3f &SmoothMover::
+get_sample_pos() const {
+  return _sample._pos;
+}
+
+////////////////////////////////////////////////////////////////////
+//     Function: SmoothMover::get_sample_hpr
+//       Access: Published
+//  Description: Returns the current orientation of the working sample
+//               point.  This orientation is updated periodically by
+//               set_h(), set_p(), etc., and its current value is
+//               copied to the sample point table when
+//               mark_position() is called.
+////////////////////////////////////////////////////////////////////
+INLINE const LVecBase3f &SmoothMover::
+get_sample_hpr() const {
+  return _sample._hpr;
+}
+
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //     Function: SmoothMover::set_phony_timestamp
 //     Function: SmoothMover::set_phony_timestamp
 //       Access: Published
 //       Access: Published

+ 3 - 0
direct/src/deadrec/smoothMover.h

@@ -79,6 +79,9 @@ PUBLISHED:
   INLINE bool set_p(float p);
   INLINE bool set_p(float p);
   INLINE bool set_r(float r);
   INLINE bool set_r(float r);
 
 
+  INLINE const LPoint3f &get_sample_pos() const;
+  INLINE const LVecBase3f &get_sample_hpr() const;
+
   bool set_mat(const LMatrix4f &mat);
   bool set_mat(const LMatrix4f &mat);
 
 
   INLINE void set_phony_timestamp();
   INLINE void set_phony_timestamp();