Panda3D
Loading...
Searching...
No Matches
ControlManager Class Reference

Public Member Functions

 __init__ (self, enable=True, passMessagesThrough=False)
 
 __str__ (self)
 
 add (self, controls, name="basic")
 
 collisionsOff (self)
 
 collisionsOn (self)
 
 delete (self)
 
 deleteCollisions (self)
 
 disable (self)
 
 disableAvatarJump (self)
 
 enable (self)
 
 enableAvatarJump (self)
 
 get (self, name)
 
 getIsAirborne (self)
 
 getSpeeds (self)
 
 lockControls (self)
 
 monitor (self, foo)
 
 placeOnFloor (self)
 
 remove (self, name)
 
 setSpeeds (self, forwardSpeed, jumpForce, reverseSpeed, rotateSpeed, strafeLeft=0, strafeRight=0)
 
 setTag (self, key, value)
 
 setWASDTurn (self, turn)
 
 stop (self)
 
 unlockControls (self)
 
 use (self, name, avatar)
 

Public Attributes

dict controls = {}
 
dict currentControls = None
 
 currentControlsName = None
 
 forceAvJumpToken = None
 
bool ignoreUse = True
 
list inputStateTokens = []
 
int isEnabled = 0
 
# for not breaking toontown passMessagesThrough = passMessagesThrough
 
list WASDTurnTokens = []
 

Static Public Attributes

 notify = DirectNotifyGlobal.directNotify.newCategory("ControlManager")
 
 wantWASD = ConfigVariableBool('want-WASD', False)
 

Constructor & Destructor Documentation

◆ __init__()

__init__ ( self,
enable = True,
passMessagesThrough = False )

Member Function Documentation

◆ __str__()

__str__ ( self)

◆ add()

add ( self,
controls,
name = "basic" )
Add a control instance to the list of available control systems.

Args:
    controls: an avatar control system.
    name (str): any key that you want to use to refer to the controls
        later (e.g. using the use(<name>) call).

See also: :meth:`use()`.

◆ collisionsOff()

collisionsOff ( self)

◆ collisionsOn()

collisionsOn ( self)

◆ delete()

delete ( self)

◆ deleteCollisions()

deleteCollisions ( self)

◆ disable()

disable ( self)

◆ disableAvatarJump()

disableAvatarJump ( self)
prevent

◆ enable()

enable ( self)

◆ enableAvatarJump()

enableAvatarJump ( self)
Stop forcing the ctrl key to return 0's

◆ get()

get ( self,
name )

◆ getIsAirborne()

getIsAirborne ( self)

◆ getSpeeds()

getSpeeds ( self)

◆ lockControls()

lockControls ( self)

◆ monitor()

monitor ( self,
foo )

◆ placeOnFloor()

placeOnFloor ( self)

◆ remove()

remove ( self,
name )
Remove a control instance from the list of available control
systems.

Args:
    name: any key that was used to refer to the controls when they were
        added (e.g. using the add(<controls>, <name>) call).

See also: :meth:`add()`.

◆ setSpeeds()

setSpeeds ( self,
forwardSpeed,
jumpForce,
reverseSpeed,
rotateSpeed,
strafeLeft = 0,
strafeRight = 0 )

◆ setTag()

setTag ( self,
key,
value )

◆ setWASDTurn()

setWASDTurn ( self,
turn )

◆ stop()

stop ( self)

◆ unlockControls()

unlockControls ( self)

◆ use()

use ( self,
name,
avatar )
name is a key (string) that was previously passed to add().

Use a previously added control system.

See also: :meth:`add()`.

Member Data Documentation

◆ controls

dict controls = {}

◆ currentControls

dict currentControls = None

◆ currentControlsName

currentControlsName = None

◆ forceAvJumpToken

forceAvJumpToken = None

◆ ignoreUse

bool ignoreUse = True

◆ inputStateTokens

list inputStateTokens = []

◆ isEnabled

int isEnabled = 0

◆ notify

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

◆ passMessagesThrough

# for not breaking toontown passMessagesThrough = passMessagesThrough

◆ wantWASD

wantWASD = ConfigVariableBool('want-WASD', False)
static

◆ WASDTurnTokens

list WASDTurnTokens = []