added if __debug__s

This commit is contained in:
Darren Ranalli 2003-11-25 08:11:05 +00:00
parent 3736a20226
commit 4d92e63fdd

View File

@ -175,6 +175,7 @@ class PhysicsWalker(DirectObject.DirectObject):
floorPoint = self.cRayQueue.getEntry(0).getFromIntersectionPoint()
height = -floorPoint.getZ()
self.cRayQueue.clearEntries()
if __debug__:
onScreenDebug.add("height", height)
return height
@ -387,6 +388,7 @@ class PhysicsWalker(DirectObject.DirectObject):
"""
Check on the arrow keys and update the avatar.
"""
if __debug__:
if self.wantAvatarPhysicsIndicator:
onScreenDebug.append("localToon pos = %s\n"%(toonbase.localToon.getPos().pPrintValues(),))
onScreenDebug.append("localToon h = % 10.4f\n"%(toonbase.localToon.getH(),))
@ -520,6 +522,7 @@ class PhysicsWalker(DirectObject.DirectObject):
airborneHeight=self.getAirborneHeight()
if airborneHeight > self.highMark:
self.highMark = airborneHeight
if __debug__:
onScreenDebug.add("highMark", "% 10.4f"%(
self.highMark,))
#if airborneHeight < 0.1: #contact!=Vec3.zero():
@ -560,6 +563,7 @@ class PhysicsWalker(DirectObject.DirectObject):
self.isAirborne = 1 # Avoid double impulse before fully airborne.
else:
self.isAirborne = 0
if __debug__:
onScreenDebug.add("isAirborne", "%d"%(self.isAirborne,))
else:
if contact!=Vec3.zero():
@ -596,6 +600,7 @@ class PhysicsWalker(DirectObject.DirectObject):
if not self.useHeightRay or self.isAirborne:
# ...the airborne check is a hack to stop sliding.
self.phys.doPhysics(dt)
if __debug__:
onScreenDebug.add("phys", "on")
else:
physObject.setVelocity(Vec3.zero())
@ -603,6 +608,7 @@ class PhysicsWalker(DirectObject.DirectObject):
# moveToGround = Vec3(0.0, 0.0, -airborneHeight)
#moveToGround = Vec3(0.0, 0.0, -airborneHeight)
moveToGround = Vec3(0.0, 0.0, -self.determineHeight())
if __debug__:
onScreenDebug.add("phys", "off")
# Check to see if we're moving at all:
if self.__speed or self.__slideSpeed or self.__rotationSpeed or moveToGround!=Vec3.zero():
@ -654,6 +660,7 @@ class PhysicsWalker(DirectObject.DirectObject):
assert(self.debugPrint("doDeltaPos()"))
print "self.__oldDt", self.__oldDt, "self.__oldPosDelta", self.__oldPosDelta
if __debug__:
onScreenDebug.add("__oldDt", "% 10.4f"%self.__oldDt)
onScreenDebug.add("self.__oldPosDelta",
self.__oldPosDelta.pPrintValues())
@ -662,6 +669,7 @@ class PhysicsWalker(DirectObject.DirectObject):
assert(self.debugPrint(" __oldPosDelta=%s"%(self.__oldPosDelta,)))
assert(self.debugPrint(" velocity=%s"%(velocity,)))
self.priorParent.setVector(Vec3(velocity))
if __debug__:
if self.wantAvatarPhysicsIndicator:
onScreenDebug.add("velocity", velocity.pPrintValues())