Panda3D
Loading...
Searching...
No Matches
PhysicsWalker Class Reference
Inheritance diagram for PhysicsWalker:
DirectObject

Public Member Functions

 __init__ (self, gravity=-32.1740, standableGround=0.707, hardLandingForce=16.0)
 
 addBlastForce (self, vector)
 
 avatarPhysicsIndicator (self, task)
 
 debugPrint (self, message)
 
 deleteCollisions (self)
 
 determineHeight (self)
 
 disableAvatarControls (self)
 
 displayDebugInfo (self)
 
 doDeltaPos (self)
 
 enableAvatarControls (self)
 
 flushEventHandlers (self)
 
 getCollisionsActive (self)
 
 getSpeeds (self)
 
 getVelocity (self)
 
 handleAvatarControls (self, task)
 
 initializeCollisions (self, collisionTraverser, avatarNodePath, wallBitmask, floorBitmask, avatarRadius=1.4, floorOffset=1.0, reach=1.0)
 
 oneTimeCollide (self)
 
 placeOnFloor (self)
 
 reset (self)
 
 setAirborneHeightFunc (self, getAirborneHeight)
 
 setAvatar (self, avatar)
 
 setAvatarPhysicsIndicator (self, indicator)
 
 setCollisionsActive (self, active=1)
 
 setPriorParentVector (self)
 
 setupAvatarPhysicsIndicator (self)
 
 setupPhysics (self, avatarNodePath)
 
 setupRay (self, floorBitmask, floorOffset)
 
 setupSphere (self, bitmask, avatarRadius)
 
 setWalkSpeed (self, forward, jump, reverse, rotate)
 
- Public Member Functions inherited from DirectObject
 __init__ (self)
 
 accept (self, event, method, extraArgs=[])
 
 acceptOnce (self, event, method, extraArgs=[])
 
 addTask (self, *args, **kwargs)
 
 detectLeaks (self)
 
 doMethodLater (self, *args, **kwargs)
 
 getAllAccepting (self)
 
 ignore (self, event)
 
 ignoreAll (self)
 
 isAccepting (self, event)
 
 isIgnoring (self, event)
 
 removeAllTasks (self)
 
 removeTask (self, taskOrName)
 

Public Attributes

 acForce = LinearVectorForce(0.0, 0.0, 0.0)
 
 actorNode = ActorNode("PW physicsActor")
 
 avatar = avatar
 
int avatarControlForwardSpeed = 0
 
int avatarControlJumpForce = 0
 
int avatarControlReverseSpeed = 0
 
int avatarControlRotateSpeed = 0
 
 avatarNodePath = render.attachNewNode("physContactIndicator")
 
 avatarPhysicsIndicator
 
 avatarRadius = avatarRadius
 
 avatarViscosity = LinearFrictionForce(0.0, 1.0, 0)
 
int collisionsActive = 0
 
 cRay = CollisionRay(0.0, 0.0, CollisionHandlerRayStart, 0.0, 0.0, -1.0)
 
 cRayBitMask = floorBitmask
 
 cRayNodePath = self.avatarNodePath.attachNewNode(cRayNode)
 
 cRayQueue = CollisionHandlerQueue()
 
 cSphere = CollisionSphere(0.0, 0.0, centerHeight, avatarRadius)
 
 cSphereBitMask = bitmask
 
 cSphereNodePath = self.avatarNodePath.attachNewNode(cSphereNode)
 
 cTrav = collisionTraverser
 
float floorOffset = 7.0
 
 getAirborneHeight = None
 
 gravity = gravity
 
 handleAvatarControls = "AvatarControls-%s"%(id(self),)
 
int highMark = 0
 
int isAirborne = 0
 
 lifter = CollisionHandlerFloor()
 
int needToDeltaPos = 0
 
 phys = PhysicsManager()
 
 physContactIndicator = contactIndicatorNode
 
 physVelocityIndicator = None
 
 priorParent = priorParent
 
 priorParentNp = fnp
 
 pusher = PhysicsCollisionHandler()
 
 reset
 

Static Public Attributes

 notify = DirectNotifyGlobal.directNotify.newCategory("PhysicsWalker")
 
int useHeightRay = 0
 
int useLifter = 0
 
 wantDebugIndicator = ConfigVariableBool('want-avatar-physics-indicator', False)
 
- Static Public Attributes inherited from DirectObject
 accept_once = acceptOnce
 
 add_task = addTask
 
 detect_leaks = detectLeaks
 
 do_method_later = doMethodLater
 
 get_all_accepting = getAllAccepting
 
 ignore_all = ignoreAll
 
 is_accepting = isAccepting
 
 is_ignoring = isIgnoring
 
 remove_all_tasks = removeAllTasks
 
 remove_task = removeTask
 

Additional Inherited Members

- Protected Member Functions inherited from DirectObject
 _addTask (self, task)
 
 _clearTask (self, task)
 
- Protected Attributes inherited from DirectObject
dict _taskList = {}
 

Constructor & Destructor Documentation

◆ __init__()

__init__ ( self,
gravity = -32.1740,
standableGround = 0.707,
hardLandingForce = 16.0 )

Member Function Documentation

◆ addBlastForce()

addBlastForce ( self,
vector )

◆ avatarPhysicsIndicator()

avatarPhysicsIndicator ( self,
task )

◆ debugPrint()

debugPrint ( self,
message )
for debugging

◆ deleteCollisions()

deleteCollisions ( self)

◆ determineHeight()

determineHeight ( self)
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.

◆ disableAvatarControls()

disableAvatarControls ( self)
Ignore the arrow keys, etc.

◆ displayDebugInfo()

displayDebugInfo ( self)
For debug use.

◆ doDeltaPos()

doDeltaPos ( self)

◆ enableAvatarControls()

enableAvatarControls ( self)
Activate the arrow keys, etc.

◆ flushEventHandlers()

flushEventHandlers ( self)

◆ getCollisionsActive()

getCollisionsActive ( self)

◆ getSpeeds()

getSpeeds ( self)

◆ getVelocity()

getVelocity ( self)

◆ handleAvatarControls()

handleAvatarControls ( self,
task )
Check on the arrow keys and update the avatar.

◆ initializeCollisions()

initializeCollisions ( self,
collisionTraverser,
avatarNodePath,
wallBitmask,
floorBitmask,
avatarRadius = 1.4,
floorOffset = 1.0,
reach = 1.0 )
Set up the avatar collisions

◆ oneTimeCollide()

oneTimeCollide ( self)
Makes one quick collision pass for the avatar, for instance as
a one-time straighten-things-up operation after collisions
have been disabled.

◆ placeOnFloor()

placeOnFloor ( self)
Make a reasonable effort to place the avatar on the ground.
For example, this is useful when switching away from the
current walker.

◆ reset()

reset ( self)

◆ setAirborneHeightFunc()

setAirborneHeightFunc ( self,
getAirborneHeight )

◆ setAvatar()

setAvatar ( self,
avatar )

◆ setAvatarPhysicsIndicator()

setAvatarPhysicsIndicator ( self,
indicator )
indicator is a NodePath

◆ setCollisionsActive()

setCollisionsActive ( self,
active = 1 )

◆ setPriorParentVector()

setPriorParentVector ( self)

◆ setupAvatarPhysicsIndicator()

setupAvatarPhysicsIndicator ( self)

◆ setupPhysics()

setupPhysics ( self,
avatarNodePath )

◆ setupRay()

setupRay ( self,
floorBitmask,
floorOffset )

◆ setupSphere()

setupSphere ( self,
bitmask,
avatarRadius )
Set up the collision sphere

◆ setWalkSpeed()

setWalkSpeed ( self,
forward,
jump,
reverse,
rotate )

Member Data Documentation

◆ acForce

acForce = LinearVectorForce(0.0, 0.0, 0.0)

◆ actorNode

actorNode = ActorNode("PW physicsActor")

◆ avatar

avatar = avatar

◆ avatarControlForwardSpeed

int avatarControlForwardSpeed = 0

◆ avatarControlJumpForce

int avatarControlJumpForce = 0

◆ avatarControlReverseSpeed

int avatarControlReverseSpeed = 0

◆ avatarControlRotateSpeed

int avatarControlRotateSpeed = 0

◆ avatarNodePath

avatarNodePath = render.attachNewNode("physContactIndicator")

◆ avatarPhysicsIndicator

avatarPhysicsIndicator

◆ avatarRadius

avatarRadius = avatarRadius

◆ avatarViscosity

avatarViscosity = LinearFrictionForce(0.0, 1.0, 0)

◆ collisionsActive

collisionsActive = 0

◆ cRay

cRay = CollisionRay(0.0, 0.0, CollisionHandlerRayStart, 0.0, 0.0, -1.0)

◆ cRayBitMask

cRayBitMask = floorBitmask

◆ cRayNodePath

cRayNodePath = self.avatarNodePath.attachNewNode(cRayNode)

◆ cRayQueue

cRayQueue = CollisionHandlerQueue()

◆ cSphere

cSphere = CollisionSphere(0.0, 0.0, centerHeight, avatarRadius)

◆ cSphereBitMask

cSphereBitMask = bitmask

◆ cSphereNodePath

cSphereNodePath = self.avatarNodePath.attachNewNode(cSphereNode)

◆ cTrav

cTrav = collisionTraverser

◆ floorOffset

float floorOffset = 7.0

◆ getAirborneHeight

getAirborneHeight = None

◆ gravity

gravity = gravity

◆ handleAvatarControls

handleAvatarControls = "AvatarControls-%s"%(id(self),)

◆ highMark

highMark = 0

◆ isAirborne

isAirborne = 0

◆ lifter

lifter = CollisionHandlerFloor()

◆ needToDeltaPos

int needToDeltaPos = 0

◆ notify

notify = DirectNotifyGlobal.directNotify.newCategory("PhysicsWalker")
static

◆ phys

phys = PhysicsManager()

◆ physContactIndicator

physContactIndicator = contactIndicatorNode

◆ physVelocityIndicator

physVelocityIndicator = None

◆ priorParent

priorParent = priorParent

◆ priorParentNp

priorParentNp = fnp

◆ pusher

pusher = PhysicsCollisionHandler()

◆ reset

reset

◆ useHeightRay

int useHeightRay = 0
static

◆ useLifter

int useLifter = 0
static

◆ wantDebugIndicator

wantDebugIndicator = ConfigVariableBool('want-avatar-physics-indicator', False)
static