diff --git a/direct/src/deadrec/smoothMover.I b/direct/src/deadrec/smoothMover.I index 1185c0dbff..15bebfb076 100644 --- a/direct/src/deadrec/smoothMover.I +++ b/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 // Access: Published diff --git a/direct/src/deadrec/smoothMover.h b/direct/src/deadrec/smoothMover.h index b81bc8adfc..e5d54aa662 100644 --- a/direct/src/deadrec/smoothMover.h +++ b/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_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 float get_smooth_forward_velocity() const;