mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
added smooth wrtReparent support
This commit is contained in:
parent
a06907e583
commit
ee45d77be1
@ -71,6 +71,7 @@ class DistributedSmoothNode(DistributedNode.DistributedNode,
|
|||||||
self.smoother = SmoothMover()
|
self.smoother = SmoothMover()
|
||||||
self.smoothStarted = 0
|
self.smoothStarted = 0
|
||||||
self.lastSuggestResync = 0
|
self.lastSuggestResync = 0
|
||||||
|
self._smoothWrtReparents = False
|
||||||
|
|
||||||
def delete(self):
|
def delete(self):
|
||||||
DistributedSmoothNodeBase.DistributedSmoothNodeBase.delete(self)
|
DistributedSmoothNodeBase.DistributedSmoothNodeBase.delete(self)
|
||||||
@ -127,6 +128,10 @@ class DistributedSmoothNode(DistributedNode.DistributedNode,
|
|||||||
self.forceToTruePosition()
|
self.forceToTruePosition()
|
||||||
self.smoothStarted = 0
|
self.smoothStarted = 0
|
||||||
|
|
||||||
|
def setSmoothWrtReparents(self, flag):
|
||||||
|
self._smoothWrtReparents = flag
|
||||||
|
def getSmoothWrtReparents(self):
|
||||||
|
return self._smoothWrtReparents
|
||||||
|
|
||||||
def forceToTruePosition(self):
|
def forceToTruePosition(self):
|
||||||
"""
|
"""
|
||||||
@ -280,9 +285,13 @@ class DistributedSmoothNode(DistributedNode.DistributedNode,
|
|||||||
# We override this NodePath method to force it to
|
# We override this NodePath method to force it to
|
||||||
# automatically reset the smoothing position when we call it.
|
# automatically reset the smoothing position when we call it.
|
||||||
if self.smoothStarted:
|
if self.smoothStarted:
|
||||||
self.forceToTruePosition()
|
if self._smoothWrtReparents:
|
||||||
NodePath.wrtReparentTo(self, parent)
|
self.smoother.handleWrtReparent(self.getParent(), parent)
|
||||||
self.reloadPosition()
|
NodePath.wrtReparentTo(self, parent)
|
||||||
|
else:
|
||||||
|
self.forceToTruePosition()
|
||||||
|
NodePath.wrtReparentTo(self, parent)
|
||||||
|
self.reloadPosition()
|
||||||
else:
|
else:
|
||||||
NodePath.wrtReparentTo(self, parent)
|
NodePath.wrtReparentTo(self, parent)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user