From 9e60c303b738161340feaf780eb64e7c3346ad6f Mon Sep 17 00:00:00 2001 From: David Rose Date: Thu, 13 Jan 2005 00:24:19 +0000 Subject: [PATCH] add setSmZ() --- direct/src/distributed/DistributedSmoothNode.py | 3 +++ direct/src/distributed/DistributedSmoothNodeAI.py | 3 +++ direct/src/distributed/cDistributedSmoothNodeBase.I | 13 +++++++++++++ .../src/distributed/cDistributedSmoothNodeBase.cxx | 5 +++++ direct/src/distributed/cDistributedSmoothNodeBase.h | 1 + 5 files changed, 25 insertions(+) diff --git a/direct/src/distributed/DistributedSmoothNode.py b/direct/src/distributed/DistributedSmoothNode.py index 656bb7a917..0fe4e200c3 100644 --- a/direct/src/distributed/DistributedSmoothNode.py +++ b/direct/src/distributed/DistributedSmoothNode.py @@ -177,6 +177,9 @@ class DistributedSmoothNode(DistributedNode.DistributedNode, def setSmH(self, h, timestamp): self.setComponentH(h) self.setComponentTLive(timestamp) + def setSmZ(self, z, timestamp): + self.setComponentZ(z) + self.setComponentTLive(timestamp) def setSmXY(self, x, y, timestamp): self.setComponentX(x) self.setComponentY(y) diff --git a/direct/src/distributed/DistributedSmoothNodeAI.py b/direct/src/distributed/DistributedSmoothNodeAI.py index 3ecddf421c..fed6ed59c8 100755 --- a/direct/src/distributed/DistributedSmoothNodeAI.py +++ b/direct/src/distributed/DistributedSmoothNodeAI.py @@ -24,6 +24,9 @@ class DistributedSmoothNodeAI(DistributedNodeAI.DistributedNodeAI, # These have their FFI functions exposed for efficiency def setSmH(self, h, t): self._NodePath__overloaded_setH_ptrNodePath_float(h) + + def setSmZ(self, z, t): + self._NodePath__overloaded_setZ_ptrNodePath_float(z) def setSmXY(self, x, y, t): self._NodePath__overloaded_setX_ptrNodePath_float(x) diff --git a/direct/src/distributed/cDistributedSmoothNodeBase.I b/direct/src/distributed/cDistributedSmoothNodeBase.I index b0862b932c..bdbcc04c1c 100644 --- a/direct/src/distributed/cDistributedSmoothNodeBase.I +++ b/direct/src/distributed/cDistributedSmoothNodeBase.I @@ -80,6 +80,19 @@ d_setSmH(float h) { finish_send_update(packer); } +//////////////////////////////////////////////////////////////////// +// Function: CDistributedSmoothNodeBase::d_setSmZ +// Access: Private +// Description: +//////////////////////////////////////////////////////////////////// +INLINE void CDistributedSmoothNodeBase:: +d_setSmZ(float z) { + DCPacker packer; + begin_send_update(packer, "setSmZ"); + packer.pack_double(z); + finish_send_update(packer); +} + //////////////////////////////////////////////////////////////////// // Function: CDistributedSmoothNodeBase::d_setSmXY // Access: Private diff --git a/direct/src/distributed/cDistributedSmoothNodeBase.cxx b/direct/src/distributed/cDistributedSmoothNodeBase.cxx index 7e4f375417..6f75352d02 100644 --- a/direct/src/distributed/cDistributedSmoothNodeBase.cxx +++ b/direct/src/distributed/cDistributedSmoothNodeBase.cxx @@ -137,6 +137,11 @@ broadcast_pos_hpr_full() { _store_stop = false; d_setSmH(_store_hpr[0]); + } else if (only_changed(flags, F_new_z)) { + // Only change in Z. + _store_stop = false; + d_setSmZ(_store_xyz[2]); + } else if (only_changed(flags, F_new_x | F_new_y)) { // Only change in X, Y _store_stop = false; diff --git a/direct/src/distributed/cDistributedSmoothNodeBase.h b/direct/src/distributed/cDistributedSmoothNodeBase.h index ac72d8af97..363aa6d639 100644 --- a/direct/src/distributed/cDistributedSmoothNodeBase.h +++ b/direct/src/distributed/cDistributedSmoothNodeBase.h @@ -59,6 +59,7 @@ private: INLINE void d_setSmStop(); INLINE void d_setSmH(float h); + INLINE void d_setSmZ(float z); INLINE void d_setSmXY(float x, float y); INLINE void d_setSmXZ(float x, float z); INLINE void d_setSmPos(float x, float y, float z);