Browse Source

added debug info

Dave Schuyler 22 years ago
parent
commit
9bd3e99d5c
1 changed files with 10 additions and 0 deletions
  1. 10 0
      direct/src/showbase/DevWalker.py

+ 10 - 0
direct/src/showbase/DevWalker.py

@@ -22,6 +22,7 @@ import DirectObject
 class DevWalker(DirectObject.DirectObject):
 class DevWalker(DirectObject.DirectObject):
 
 
     notify = DirectNotifyGlobal.directNotify.newCategory("DevWalker")
     notify = DirectNotifyGlobal.directNotify.newCategory("DevWalker")
+    wantDebugIndicator = base.config.GetBool('want-avatar-physics-indicator', 0)
 
 
     # Ghost mode overrides this:
     # Ghost mode overrides this:
     slideName = "slide-is-disabled"
     slideName = "slide-is-disabled"
@@ -69,6 +70,12 @@ class DevWalker(DirectObject.DirectObject):
     def oneTimeCollide(self):
     def oneTimeCollide(self):
         pass
         pass
 
 
+    def displayDebugInfo(self):
+        """
+        For debug use.
+        """
+        onScreenDebug.add("controls", "DevWalker")
+
     def handleAvatarControls(self, task):
     def handleAvatarControls(self, task):
         """
         """
         Check on the arrow keys and update the avatar.
         Check on the arrow keys and update the avatar.
@@ -96,6 +103,9 @@ class DevWalker(DirectObject.DirectObject):
         self.rotationSpeed=(
         self.rotationSpeed=(
                 (turnLeft and self.avatarControlRotateSpeed) or
                 (turnLeft and self.avatarControlRotateSpeed) or
                 (turnRight and -self.avatarControlRotateSpeed))
                 (turnRight and -self.avatarControlRotateSpeed))
+           
+        if self.wantDebugIndicator:
+            self.displayDebugInfo()
             
             
         # Check to see if we're moving at all:
         # Check to see if we're moving at all:
         if self.speed or self.liftSpeed or self.slideSpeed or self.rotationSpeed:
         if self.speed or self.liftSpeed or self.slideSpeed or self.rotationSpeed: