ships now have their own control manager that the avatar uses when he takes the wheel

This commit is contained in:
Josh Wilson 2007-01-25 05:24:40 +00:00
parent f4d998e214
commit 6e32e478cf
2 changed files with 185 additions and 624 deletions

View File

@ -13,7 +13,6 @@ from direct.directnotify import DirectNotifyGlobal
#if __debug__:
# import DevWalker
from direct.task import Task
CollisionHandlerRayStart = 4000.0 # This is a hack, it may be better to use a line instead of a ray.
class ControlManager:
@ -162,6 +161,7 @@ class ControlManager:
def delete(self):
assert self.notify.debugCall(id(self))
self.disable()
# TODO: put controls delete code in here
del self.controls
del self.currentControls
@ -201,13 +201,21 @@ class ControlManager:
def enable(self):
assert self.notify.debugCall(id(self))
self.isEnabled = 1
self.currentControls.enableAvatarControls()
if self.currentControls:
self.currentControls.enableAvatarControls()
def disable(self):
assert self.notify.debugCall(id(self))
self.isEnabled = 0
self.currentControls.disableAvatarControls()
if self.currentControls:
self.currentControls.disableAvatarControls()
def stop(self):
self.disable()
self.currentControls.setCollisionsActive(0)
self.currentControls.setAvatar(None)
self.currentControls = None
def disableAvatarJump(self):
"""
prevent

File diff suppressed because it is too large Load Diff