Browse Source

multiple players can rotate the water pitcher

Redmond Urbino 18 years ago
parent
commit
732215ed61
2 changed files with 16 additions and 0 deletions
  1. 15 0
      direct/src/deadrec/smoothMover.I
  2. 1 0
      direct/src/deadrec/smoothMover.h

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

@@ -472,6 +472,21 @@ compute_and_apply_smooth_pos_hpr(NodePath &pos_node, NodePath &hpr_node) {
   }
   }
 }
 }
 
 
+////////////////////////////////////////////////////////////////////
+//     Function: SmoothMover::compute_and_apply_smooth_pos_hpr
+//       Access: Published
+//  Description: A further optimization to reduce Python calls.  This
+//               computes the smooth position and applies it to the
+//               indicated node or nodes in one call.  The pos_node
+//               and hpr_node might be the same NodePath.
+////////////////////////////////////////////////////////////////////
+INLINE void SmoothMover::
+compute_and_apply_smooth_hpr(NodePath &hpr_node) {
+  if (compute_smooth_position()) {
+    apply_smooth_hpr(hpr_node);
+  }
+}
+
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //     Function: SmoothMover::compute_and_apply_smooth_mat
 //     Function: SmoothMover::compute_and_apply_smooth_mat
 //       Access: Published
 //       Access: Published

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

@@ -107,6 +107,7 @@ PUBLISHED:
 
 
   INLINE void compute_and_apply_smooth_pos(NodePath &node);
   INLINE void compute_and_apply_smooth_pos(NodePath &node);
   INLINE void compute_and_apply_smooth_pos_hpr(NodePath &pos_node, NodePath &hpr_node);
   INLINE void compute_and_apply_smooth_pos_hpr(NodePath &pos_node, NodePath &hpr_node);
+  INLINE void compute_and_apply_smooth_hpr(NodePath &hpr_node);
   INLINE void compute_and_apply_smooth_mat(NodePath &node);
   INLINE void compute_and_apply_smooth_mat(NodePath &node);
 
 
   INLINE float get_smooth_forward_velocity() const;
   INLINE float get_smooth_forward_velocity() const;