mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-05 03:15:07 -04:00
*** empty log message ***
This commit is contained in:
parent
3851d0af4d
commit
00e2d94a05
50
direct/src/controls/ObserverWalker.py
Executable file
50
direct/src/controls/ObserverWalker.py
Executable file
@ -0,0 +1,50 @@
|
|||||||
|
"""
|
||||||
|
ObserverWalker.py is for avatars.
|
||||||
|
|
||||||
|
A walker control such as this one provides:
|
||||||
|
- creation of the collision nodes
|
||||||
|
- handling the keyboard and mouse input for avatar movement
|
||||||
|
- moving the avatar
|
||||||
|
|
||||||
|
it does not:
|
||||||
|
- play sounds
|
||||||
|
- play animations
|
||||||
|
|
||||||
|
although it does send messeges that allow a listener to play sounds or
|
||||||
|
animations based on walker events.
|
||||||
|
"""
|
||||||
|
|
||||||
|
from direct.showbase.ShowBaseGlobal import *
|
||||||
|
|
||||||
|
from direct.directnotify import DirectNotifyGlobal
|
||||||
|
import NonPhysicsWalker
|
||||||
|
|
||||||
|
class ObserverWalker(NonPhysicsWalker.NonPhysicsWalker):
|
||||||
|
notify = DirectNotifyGlobal.directNotify.newCategory("ObserverWalker")
|
||||||
|
|
||||||
|
# Ghosts slide instead of jump:
|
||||||
|
slideName = "jump"
|
||||||
|
|
||||||
|
def initializeCollisions(self, collisionTraverser, avatarNodePath,
|
||||||
|
avatarRadius = 1.4, floorOffset = 1.0, reach = 1.0):
|
||||||
|
"""
|
||||||
|
Set up the avatar for collisions
|
||||||
|
"""
|
||||||
|
NonPhysicsWalker.NonPhysicsWalker.initializeCollisions(
|
||||||
|
self, collisionTraverser, avatarNodePath,
|
||||||
|
avatarRadius, floorOffset, reach)
|
||||||
|
self.cTrav.removeCollider(self.cRayNodePath)
|
||||||
|
|
||||||
|
def enableAvatarControls(self):
|
||||||
|
"""
|
||||||
|
Activate the arrow keys, etc.
|
||||||
|
"""
|
||||||
|
assert(self.debugPrint("enableAvatarControls"))
|
||||||
|
pass
|
||||||
|
|
||||||
|
def disableAvatarControls(self):
|
||||||
|
"""
|
||||||
|
Ignore the arrow keys, etc.
|
||||||
|
"""
|
||||||
|
assert(self.debugPrint("disableAvatarControls"))
|
||||||
|
pass
|
Loading…
x
Reference in New Issue
Block a user