direct.controls.PhysicsWalker
from direct.controls.PhysicsWalker import PhysicsWalker
PhysicsWalker.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 messages that allow a listener to play sounds or animations based on walker events.
Inheritance diagram
- class PhysicsWalker(gravity=-32.174, standableGround=0.707, hardLandingForce=16.0)[source]
Bases:
DirectObject
- determineHeight(self)[source]
returns the height of the avatar above the ground. If there is no floor below the avatar, 0.0 is returned. aka get airborne height.
- initializeCollisions(self, collisionTraverser, avatarNodePath, wallBitmask, floorBitmask, avatarRadius=1.4, floorOffset=1.0, reach=1.0)[source]
Set up the avatar collisions
- notify = <direct.directnotify.Notifier.Notifier object>
- oneTimeCollide(self)[source]
Makes one quick collision pass for the avatar, for instance as a one-time straighten-things-up operation after collisions have been disabled.
- placeOnFloor(self)[source]
Make a reasonable effort to place the avatar on the ground. For example, this is useful when switching away from the current walker.
- useHeightRay = 0
- useLifter = 0
- wantDebugIndicator = 0