mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 10:54:24 -04:00
fixed debug output
This commit is contained in:
parent
e6fd463607
commit
96ec4d6ac1
@ -27,7 +27,7 @@ import math
|
|||||||
class PhysicsWalker(DirectObject.DirectObject):
|
class PhysicsWalker(DirectObject.DirectObject):
|
||||||
|
|
||||||
notify = DirectNotifyGlobal.directNotify.newCategory("PhysicsWalker")
|
notify = DirectNotifyGlobal.directNotify.newCategory("PhysicsWalker")
|
||||||
wantAvatarPhysicsIndicator = base.config.GetBool('want-avatar-physics-indicator', 1)
|
wantAvatarPhysicsIndicator = base.config.GetBool('want-avatar-physics-indicator', 0)
|
||||||
|
|
||||||
# special methods
|
# special methods
|
||||||
def __init__(self, gravity = -32.1740, standableGround=0.707,
|
def __init__(self, gravity = -32.1740, standableGround=0.707,
|
||||||
@ -286,8 +286,9 @@ class PhysicsWalker(DirectObject.DirectObject):
|
|||||||
"""
|
"""
|
||||||
Check on the arrow keys and update the avatar.
|
Check on the arrow keys and update the avatar.
|
||||||
"""
|
"""
|
||||||
onScreenDebug.append("localToon pos = %s\n"%(toonbase.localToon.getPos().pPrintValues(),))
|
if self.wantAvatarPhysicsIndicator:
|
||||||
onScreenDebug.append("localToon hpr = %s\n"%(toonbase.localToon.getHpr().pPrintValues(),))
|
onScreenDebug.append("localToon pos = %s\n"%(toonbase.localToon.getPos().pPrintValues(),))
|
||||||
|
onScreenDebug.append("localToon hpr = %s\n"%(toonbase.localToon.getHpr().pPrintValues(),))
|
||||||
#assert(self.debugPrint("handleAvatarControls(task=%s)"%(task,)))
|
#assert(self.debugPrint("handleAvatarControls(task=%s)"%(task,)))
|
||||||
physObject=self.actorNode.getPhysicsObject()
|
physObject=self.actorNode.getPhysicsObject()
|
||||||
#rotAvatarToPhys=Mat3.rotateMatNormaxis(-self.avatarNodePath.getH(), Vec3.up())
|
#rotAvatarToPhys=Mat3.rotateMatNormaxis(-self.avatarNodePath.getH(), Vec3.up())
|
||||||
@ -559,17 +560,12 @@ class PhysicsWalker(DirectObject.DirectObject):
|
|||||||
|
|
||||||
def setPriorParentVector(self):
|
def setPriorParentVector(self):
|
||||||
assert(self.debugPrint("doDeltaPos()"))
|
assert(self.debugPrint("doDeltaPos()"))
|
||||||
if 0:
|
print "self.__oldDt", self.__oldDt, "self.__oldPosDelta", self.__oldPosDelta
|
||||||
posDelta = self.avatarNodePath.getPosDelta(render)
|
velocity = self.__oldPosDelta*(1/self.__oldDt)
|
||||||
assert(self.debugPrint(" posDelta=%s"%(posDelta,)))
|
assert(self.debugPrint(" __oldPosDelta=%s"%(self.__oldPosDelta,)))
|
||||||
self.priorParent.setVector(Vec3(posDelta))
|
assert(self.debugPrint(" velocity=%s"%(velocity,)))
|
||||||
onScreenDebug.append("posDelta = %s\n"%(posDelta,))
|
self.priorParent.setVector(Vec3(velocity))
|
||||||
else:
|
if self.wantAvatarPhysicsIndicator:
|
||||||
print "self.__oldDt", self.__oldDt, "self.__oldPosDelta", self.__oldPosDelta
|
|
||||||
velocity = self.__oldPosDelta*(1/self.__oldDt)
|
|
||||||
assert(self.debugPrint(" __oldPosDelta=%s"%(self.__oldPosDelta,)))
|
|
||||||
assert(self.debugPrint(" velocity=%s"%(velocity,)))
|
|
||||||
self.priorParent.setVector(Vec3(velocity))
|
|
||||||
onScreenDebug.add("velocity", velocity.pPrintValues())
|
onScreenDebug.add("velocity", velocity.pPrintValues())
|
||||||
|
|
||||||
def resetPhys(self):
|
def resetPhys(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user