Prechádzať zdrojové kódy

new pie-throwing interface

David Rose 22 rokov pred
rodič
commit
0be153797e

+ 0 - 1
direct/src/showbase/ControlManager.py

@@ -58,7 +58,6 @@ class ControlManager:
         inputState.watch("jump", "shift-control", "shift-control-up")
         inputState.watch("jump", "shift-control", "shift-control-up")
         
         
         inputState.watch("slide", "slide-is-disabled", "slide-is-disabled")
         inputState.watch("slide", "slide-is-disabled", "slide-is-disabled")
-        inputState.watch("pie", "begin-pie", "end-pie")
         
         
         #inputState.watch("slideLeft", "shift-arrow_left", "shift-arrow_left-up")
         #inputState.watch("slideLeft", "shift-arrow_left", "shift-arrow_left-up")
         #inputState.watch("slideLeft", "control-arrow_left", "control-arrow_left-up")
         #inputState.watch("slideLeft", "control-arrow_left", "control-arrow_left-up")

+ 1 - 0
direct/src/showbase/InputState.py

@@ -73,6 +73,7 @@ class InputState(DirectObject.DirectObject):
     def set(self, name, isSet):
     def set(self, name, isSet):
         assert(self.debugPrint("set(name=%s, isSet=%s)"%(name, isSet)))
         assert(self.debugPrint("set(name=%s, isSet=%s)"%(name, isSet)))
         self.state[name] = isSet
         self.state[name] = isSet
+        messenger.send(name, [isSet])
     
     
     def isSet(self, name):
     def isSet(self, name):
         """
         """

+ 0 - 7
direct/src/showbase/NonPhysicsWalker.py

@@ -153,7 +153,6 @@ class NonPhysicsWalker(DirectObject.DirectObject):
         turnRight = inputState.isSet("turnRight")
         turnRight = inputState.isSet("turnRight")
         slide = inputState.isSet("slide")
         slide = inputState.isSet("slide")
         #jump = inputState.isSet("jump")
         #jump = inputState.isSet("jump")
-        pie = inputState.isSet("pie")
         # Determine what the speeds are based on the buttons:
         # Determine what the speeds are based on the buttons:
         self.speed=(forward and self.avatarControlForwardSpeed or 
         self.speed=(forward and self.avatarControlForwardSpeed or 
                     reverse and -self.avatarControlReverseSpeed)
                     reverse and -self.avatarControlReverseSpeed)
@@ -164,12 +163,6 @@ class NonPhysicsWalker(DirectObject.DirectObject):
         self.rotationSpeed=not slide and (
         self.rotationSpeed=not slide and (
                 (turnLeft and self.avatarControlRotateSpeed) or
                 (turnLeft and self.avatarControlRotateSpeed) or
                 (turnRight and -self.avatarControlRotateSpeed))
                 (turnRight and -self.avatarControlRotateSpeed))
-
-        # No moving allowed while throwing a pie.
-        if pie:
-            self.speed = 0
-            self.slideSpeed = 0
-            self.rotationSpeed = 0
             
             
         # How far did we move based on the amount of time elapsed?
         # How far did we move based on the amount of time elapsed?
         dt=min(ClockObject.getGlobalClock().getDt(), 0.1)
         dt=min(ClockObject.getGlobalClock().getDt(), 0.1)

+ 0 - 8
direct/src/showbase/PhysicsWalker.py

@@ -415,7 +415,6 @@ class PhysicsWalker(DirectObject.DirectObject):
         slideLeft = inputState.isSet("slideLeft")
         slideLeft = inputState.isSet("slideLeft")
         slideRight = inputState.isSet("slideRight")
         slideRight = inputState.isSet("slideRight")
         jump = inputState.isSet("jump")
         jump = inputState.isSet("jump")
-        pie = inputState.isSet("pie")
         # Determine what the speeds are based on the buttons:
         # Determine what the speeds are based on the buttons:
         self.__speed=(forward and self.avatarControlForwardSpeed or 
         self.__speed=(forward and self.avatarControlForwardSpeed or 
                 reverse and -self.avatarControlReverseSpeed)
                 reverse and -self.avatarControlReverseSpeed)
@@ -430,13 +429,6 @@ class PhysicsWalker(DirectObject.DirectObject):
                 (turnLeft and self.avatarControlRotateSpeed) or
                 (turnLeft and self.avatarControlRotateSpeed) or
                 (turnRight and -self.avatarControlRotateSpeed))
                 (turnRight and -self.avatarControlRotateSpeed))
 
 
-        # No moving allowed while throwing a pie.
-        if pie:
-            self.__speed = 0
-            self.__slideSpeed = 0
-            self.__rotationSpeed = 0
-            jump = 0
-
         # How far did we move based on the amount of time elapsed?
         # How far did we move based on the amount of time elapsed?
         dt=min(ClockObject.getGlobalClock().getDt(), 0.1)
         dt=min(ClockObject.getGlobalClock().getDt(), 0.1)