Explorar el Código

added legacy lifter support

Darren Ranalli hace 16 años
padre
commit
25ea239df0
Se han modificado 1 ficheros con 4 adiciones y 1 borrados
  1. 4 1
      direct/src/controls/GravityWalker.py

+ 4 - 1
direct/src/controls/GravityWalker.py

@@ -32,12 +32,13 @@ class GravityWalker(DirectObject.DirectObject):
 
 
     # special methods
     # special methods
     def __init__(self, gravity = 64.348, standableGround=0.707,
     def __init__(self, gravity = 64.348, standableGround=0.707,
-            hardLandingForce=16.0):
+            hardLandingForce=16.0, legacyLifter=False):
         assert self.notify.debugStateCall(self)
         assert self.notify.debugStateCall(self)
         DirectObject.DirectObject.__init__(self)
         DirectObject.DirectObject.__init__(self)
         self.__gravity=gravity
         self.__gravity=gravity
         self.__standableGround=standableGround
         self.__standableGround=standableGround
         self.__hardLandingForce=hardLandingForce
         self.__hardLandingForce=hardLandingForce
+        self._legacyLifter = legacyLifter
 
 
         self.mayJump = 1
         self.mayJump = 1
         self.jumpDelayTask = None
         self.jumpDelayTask = None
@@ -187,6 +188,8 @@ class GravityWalker(DirectObject.DirectObject):
 
 
         # set up floor collision mechanism
         # set up floor collision mechanism
         self.lifter = CollisionHandlerGravity()
         self.lifter = CollisionHandlerGravity()
+        #self.lifter = CollisionHandlerHighestEvent()
+        self.lifter.setLegacyMode(self._legacyLifter)
         self.lifter.setGravity(self.__gravity)
         self.lifter.setGravity(self.__gravity)
         self.lifter.addInPattern("enter%in")
         self.lifter.addInPattern("enter%in")
         self.lifter.addAgainPattern("again%in")
         self.lifter.addAgainPattern("again%in")