From ee45d77be13d38bc2384e8328308a420095d95d4 Mon Sep 17 00:00:00 2001 From: Darren Ranalli Date: Fri, 29 Jun 2007 21:19:59 +0000 Subject: [PATCH] added smooth wrtReparent support --- direct/src/distributed/DistributedSmoothNode.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/direct/src/distributed/DistributedSmoothNode.py b/direct/src/distributed/DistributedSmoothNode.py index f9ce66c405..f008cf1623 100644 --- a/direct/src/distributed/DistributedSmoothNode.py +++ b/direct/src/distributed/DistributedSmoothNode.py @@ -71,6 +71,7 @@ class DistributedSmoothNode(DistributedNode.DistributedNode, self.smoother = SmoothMover() self.smoothStarted = 0 self.lastSuggestResync = 0 + self._smoothWrtReparents = False def delete(self): DistributedSmoothNodeBase.DistributedSmoothNodeBase.delete(self) @@ -127,6 +128,10 @@ class DistributedSmoothNode(DistributedNode.DistributedNode, self.forceToTruePosition() self.smoothStarted = 0 + def setSmoothWrtReparents(self, flag): + self._smoothWrtReparents = flag + def getSmoothWrtReparents(self): + return self._smoothWrtReparents def forceToTruePosition(self): """ @@ -280,9 +285,13 @@ class DistributedSmoothNode(DistributedNode.DistributedNode, # We override this NodePath method to force it to # automatically reset the smoothing position when we call it. if self.smoothStarted: - self.forceToTruePosition() - NodePath.wrtReparentTo(self, parent) - self.reloadPosition() + if self._smoothWrtReparents: + self.smoother.handleWrtReparent(self.getParent(), parent) + NodePath.wrtReparentTo(self, parent) + else: + self.forceToTruePosition() + NodePath.wrtReparentTo(self, parent) + self.reloadPosition() else: NodePath.wrtReparentTo(self, parent)