add getVelocity

This commit is contained in:
Samir Naik 2005-02-08 19:41:33 +00:00
parent 0cc932301d
commit db891ff937
3 changed files with 10 additions and 0 deletions

View File

@ -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.

View File

@ -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.

View File

@ -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.