mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 02:15:43 -04:00
added debug info
This commit is contained in:
parent
c876c52dbd
commit
9bd3e99d5c
@ -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.
|
||||||
@ -97,6 +104,9 @@ class DevWalker(DirectObject.DirectObject):
|
|||||||
(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:
|
||||||
# How far did we move based on the amount of time elapsed?
|
# How far did we move based on the amount of time elapsed?
|
||||||
|
Loading…
x
Reference in New Issue
Block a user