Panda3D
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
GravityWalker Class Reference
Inheritance diagram for GravityWalker:
BattleWalker TwoDWalker

Public Member Functions

def __init__ (self, gravity=64.348, standableGround=0.707, hardLandingForce=16.0, legacyLifter=False)
 
def addBlastForce (self, vector)
 
def debugPrint (self, message)
 
def deleteCollisions (self)
 
def disableAvatarControls (self)
 
def displayDebugInfo (self)
 
def doDeltaPos (self)
 
def enableAvatarControls (self)
 
def flushEventHandlers (self)
 
def getAirborneHeight (self)
 
def getCollisionsActive (self)
 
def getGravity (self, gravity)
 
def getIsAirborne (self)
 
def getSpeeds (self)
 
def getVelocity (self)
 
def handleAvatarControls (self, task)
 
def initializeCollisions (self, collisionTraverser, avatarNodePath, avatarRadius=1.4, floorOffset=1.0, reach=1.0)
 
def oneTimeCollide (self)
 
def placeOnFloor (self)
 
def reset (self)
 
def setAirborneHeightFunc (self, unused_parameter)
 
def setAvatar (self, avatar)
 
def setAvatarPhysicsIndicator (self, indicator)
 
def setCollisionRayHeight (self, height)
 
def setCollisionsActive (self, active=1)
 
def setFloorBitMask (self, bitMask)
 
def setGravity (self, gravity)
 
def setMayJump (self, task)
 
def setPriorParentVector (self)
 
def setTag (self, key, value)
 
def setupEventSphere (self, bitmask, avatarRadius)
 
def setupFloorSphere (self, bitmask, avatarRadius)
 
def setupRay (self, bitmask, floorOffset, reach)
 
def setupWallSphere (self, bitmask, avatarRadius)
 
def setWalkSpeed (self, forward, jump, reverse, rotate)
 
def setWallBitMask (self, bitMask)
 
def startJumpDelay (self, delay)
 
def swapFloorBitMask (self, oldMask, newMask)
 

Public Attributes

 avatar
 
 avatarControlForwardSpeed
 
 avatarControlJumpForce
 
 avatarControlReverseSpeed
 
 avatarControlRotateSpeed
 
 avatarNodePath
 
 avatarRadius
 
 cEventSphereNodePath
 
 cFloorSphereNodePath
 
 collisionsActive
 
 controlsTask
 
 cRay
 
 cRayNodePath
 
 cTrav
 
 cWallSphereNodePath
 
 event
 
 falling
 
 floorBitmask
 
 getAirborneHeight
 
 highMark
 
 indicatorTask
 
 isAirborne
 
 jumpDelayTask
 
 lifter
 
 mayJump
 
 moving
 
 needToDeltaPos
 
 physVelocityIndicator
 
 priorParent
 
 pusher
 
 pusherFloorhandler
 
 rotationSpeed
 
 slideSpeed
 
 speed
 
 vel
 
 wallBitmask
 

Static Public Attributes

int DiagonalFactor = math.sqrt(2.) / 2.
 
 earlyEventSphere = ConfigVariableBool('early-event-sphere', False)
 
 notify = directNotify.newCategory("GravityWalker")
 
 wantDebugIndicator = ConfigVariableBool('want-avatar-physics-indicator', False)
 
 wantFloorSphere = ConfigVariableBool('want-floor-sphere', False)
 

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  gravity = 64.348,
  standableGround = 0.707,
  hardLandingForce = 16.0,
  legacyLifter = False 
)

Member Function Documentation

◆ addBlastForce()

def addBlastForce (   self,
  vector 
)

◆ debugPrint()

def debugPrint (   self,
  message 
)
for debugging

◆ deleteCollisions()

def deleteCollisions (   self)

◆ disableAvatarControls()

def disableAvatarControls (   self)
Ignore the arrow keys, etc.

◆ displayDebugInfo()

def displayDebugInfo (   self)
For debug use.

◆ doDeltaPos()

def doDeltaPos (   self)

◆ enableAvatarControls()

def enableAvatarControls (   self)
Activate the arrow keys, etc.

◆ flushEventHandlers()

def flushEventHandlers (   self)

◆ getAirborneHeight()

def getAirborneHeight (   self)

◆ getCollisionsActive()

def getCollisionsActive (   self)

◆ getGravity()

def getGravity (   self,
  gravity 
)

◆ getIsAirborne()

def getIsAirborne (   self)

◆ getSpeeds()

def getSpeeds (   self)

Reimplemented in BattleWalker.

◆ getVelocity()

def getVelocity (   self)

◆ handleAvatarControls()

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

Reimplemented in BattleWalker, TwoDWalker, and BattleWalker.

◆ initializeCollisions()

def initializeCollisions (   self,
  collisionTraverser,
  avatarNodePath,
  avatarRadius = 1.4,
  floorOffset = 1.0,
  reach = 1.0 
)
floorOffset is how high the avatar can reach.  I.e. if the avatar
    walks under a ledge that is <= floorOffset above the ground (a
    double floor situation), the avatar will step up on to the
    ledge (instantly).

Set up the avatar collisions

◆ oneTimeCollide()

def 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()

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

◆ reset()

def reset (   self)

◆ setAirborneHeightFunc()

def setAirborneHeightFunc (   self,
  unused_parameter 
)

◆ setAvatar()

def setAvatar (   self,
  avatar 
)

◆ setAvatarPhysicsIndicator()

def setAvatarPhysicsIndicator (   self,
  indicator 
)
indicator is a NodePath

◆ setCollisionRayHeight()

def setCollisionRayHeight (   self,
  height 
)

◆ setCollisionsActive()

def setCollisionsActive (   self,
  active = 1 
)

◆ setFloorBitMask()

def setFloorBitMask (   self,
  bitMask 
)

◆ setGravity()

def setGravity (   self,
  gravity 
)

◆ setMayJump()

def setMayJump (   self,
  task 
)
This function's use is internal to this class (maybe I'll add
the __ someday).  Anyway, if you want to enable or disable
jumping in a general way see the ControlManager (don't use this).

◆ setPriorParentVector()

def setPriorParentVector (   self)

◆ setTag()

def setTag (   self,
  key,
  value 
)

◆ setupEventSphere()

def setupEventSphere (   self,
  bitmask,
  avatarRadius 
)
Set up the collision sphere

◆ setupFloorSphere()

def setupFloorSphere (   self,
  bitmask,
  avatarRadius 
)
Set up the collision sphere

◆ setupRay()

def setupRay (   self,
  bitmask,
  floorOffset,
  reach 
)

◆ setupWallSphere()

def setupWallSphere (   self,
  bitmask,
  avatarRadius 
)
Set up the collision sphere

◆ setWalkSpeed()

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

◆ setWallBitMask()

def setWallBitMask (   self,
  bitMask 
)

◆ startJumpDelay()

def startJumpDelay (   self,
  delay 
)

◆ swapFloorBitMask()

def swapFloorBitMask (   self,
  oldMask,
  newMask 
)

Member Data Documentation

◆ avatar

avatar

◆ avatarControlForwardSpeed

avatarControlForwardSpeed

◆ avatarControlJumpForce

avatarControlJumpForce

◆ avatarControlReverseSpeed

avatarControlReverseSpeed

◆ avatarControlRotateSpeed

avatarControlRotateSpeed

◆ avatarNodePath

avatarNodePath

◆ avatarRadius

avatarRadius

◆ cEventSphereNodePath

cEventSphereNodePath

◆ cFloorSphereNodePath

cFloorSphereNodePath

◆ collisionsActive

collisionsActive

◆ controlsTask

controlsTask

◆ cRay

cRay

◆ cRayNodePath

cRayNodePath

◆ cTrav

cTrav

◆ cWallSphereNodePath

cWallSphereNodePath

◆ DiagonalFactor

int DiagonalFactor = math.sqrt(2.) / 2.
static

◆ earlyEventSphere

earlyEventSphere = ConfigVariableBool('early-event-sphere', False)
static

◆ event

event

◆ falling

falling

◆ floorBitmask

floorBitmask

◆ getAirborneHeight

getAirborneHeight

◆ highMark

highMark

◆ indicatorTask

indicatorTask

◆ isAirborne

isAirborne

◆ jumpDelayTask

jumpDelayTask

◆ lifter

lifter

◆ mayJump

mayJump

◆ moving

moving

◆ needToDeltaPos

needToDeltaPos

◆ notify

notify = directNotify.newCategory("GravityWalker")
static

◆ physVelocityIndicator

physVelocityIndicator

◆ priorParent

priorParent

◆ pusher

pusher

◆ pusherFloorhandler

pusherFloorhandler

◆ rotationSpeed

rotationSpeed

◆ slideSpeed

slideSpeed

◆ speed

speed

◆ vel

vel

◆ wallBitmask

wallBitmask

◆ wantDebugIndicator

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

◆ wantFloorSphere

wantFloorSphere = ConfigVariableBool('want-floor-sphere', False)
static