mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 02:15:43 -04:00
*** empty log message ***
This commit is contained in:
parent
775083920f
commit
1cd919c551
@ -5,7 +5,8 @@ from ShowBaseGlobal import *
|
||||
#from IntervalGlobal import *
|
||||
|
||||
import Avatar
|
||||
import DevWalker
|
||||
if __debug__:
|
||||
import DevWalker
|
||||
import DirectNotifyGlobal
|
||||
import GhostWalker
|
||||
import GravityWalker
|
||||
@ -23,10 +24,14 @@ class ControlManager:
|
||||
def __init__(self, avatar):
|
||||
self.avatar = avatar
|
||||
assert(self.debugPrint("ControlManager()"))
|
||||
|
||||
self.enableJumpCounter = 1
|
||||
|
||||
self.swimControls=GravityWalker.GravityWalker(
|
||||
gravity = -32.1740 * 2.0)
|
||||
#self.swimControls=NonPhysicsWalker.NonPhysicsWalker()
|
||||
self.ghostControls=GhostWalker.GhostWalker()
|
||||
if __debug__:
|
||||
self.devControls=DevWalker.DevWalker()
|
||||
if self.wantAvatarPhysics:
|
||||
self.walkControls=GravityWalker.GravityWalker(
|
||||
@ -143,6 +148,7 @@ class ControlManager:
|
||||
if self.isEnabled:
|
||||
self.currentControls.enableAvatarControls()
|
||||
|
||||
if __debug__:
|
||||
def useDevControls(self):
|
||||
assert(self.debugPrint("useDevControls()"))
|
||||
if self.currentControls is not self.devControls:
|
||||
@ -178,6 +184,7 @@ class ControlManager:
|
||||
toonJumpForce,
|
||||
toonReverseSpeed,
|
||||
toonRotateSpeed)
|
||||
if __debug__:
|
||||
self.devControls.setWalkSpeed(
|
||||
toonForwardSpeed,
|
||||
toonJumpForce,
|
||||
@ -209,6 +216,7 @@ class ControlManager:
|
||||
self.ghostControls.disableAvatarControls()
|
||||
self.ghostControls.setCollisionsActive(0)
|
||||
|
||||
if __debug__:
|
||||
self.devControls.initializeCollisions(cTrav, self.avatar,
|
||||
wallBitmask, floorBitmask, avatarRadius, floorOffset)
|
||||
self.devControls.setAirborneHeightFunc(self.avatar.getAirborneHeight)
|
||||
@ -223,6 +231,7 @@ class ControlManager:
|
||||
self.walkControls.deleteCollisions()
|
||||
self.swimControls.deleteCollisions()
|
||||
self.ghostControls.deleteCollisions()
|
||||
if __debug__:
|
||||
self.devControls.deleteCollisions()
|
||||
|
||||
def collisionsOn(self):
|
||||
@ -247,12 +256,18 @@ class ControlManager:
|
||||
"""
|
||||
Stop forcing the ctrl key to return 0's
|
||||
"""
|
||||
self.enableJumpCounter+=1
|
||||
if self.enableJumpCounter:
|
||||
assert self.enableJumpCounter == 1
|
||||
self.enableJumpCounter = 1
|
||||
inputState.unforce("jump")
|
||||
|
||||
def disableAvatarJump(self):
|
||||
"""
|
||||
Force the ctrl key to return 0's
|
||||
"""
|
||||
self.enableJumpCounter-=1
|
||||
if self.enableJumpCounter <= 0:
|
||||
inputState.force("jump", 0)
|
||||
|
||||
def monitor(self, foo):
|
||||
|
Loading…
x
Reference in New Issue
Block a user