mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
add getVelocity
This commit is contained in:
parent
0cc932301d
commit
db891ff937
@ -583,6 +583,9 @@ class GravityWalker(DirectObject.DirectObject):
|
||||
self.lifter.setVelocity(0.0)
|
||||
self.priorParent=Vec3.zero()
|
||||
|
||||
def getVelocity(self):
|
||||
return self.vel
|
||||
|
||||
def enableAvatarControls(self):
|
||||
"""
|
||||
Activate the arrow keys, etc.
|
||||
|
@ -722,6 +722,10 @@ class PhysicsWalker(DirectObject.DirectObject):
|
||||
onScreenDebug.add("highMark", "% 10.4f"%(self.highMark,))
|
||||
onScreenDebug.add("contact", contact.pPrintValues())
|
||||
|
||||
def getVelocity(self):
|
||||
physObject=self.actorNode.getPhysicsObject()
|
||||
return physObject.getVelocity()
|
||||
|
||||
def enableAvatarControls(self):
|
||||
"""
|
||||
Activate the arrow keys, etc.
|
||||
|
@ -912,6 +912,9 @@ class ShipPilot(PhysicsWalker.PhysicsWalker):
|
||||
onScreenDebug.add("highMark", "% 10.4f"%(self.highMark,))
|
||||
onScreenDebug.add("contact", contact.pPrintValues())
|
||||
|
||||
def getVelocity(self):
|
||||
return self.__vel
|
||||
|
||||
def enableAvatarControls(self):
|
||||
"""
|
||||
Activate the arrow keys, etc.
|
||||
|
Loading…
x
Reference in New Issue
Block a user