From f417cfc9d57fb9a951bccf919c30a3a777e85096 Mon Sep 17 00:00:00 2001 From: Samir Naik Date: Tue, 8 Mar 2005 07:49:59 +0000 Subject: [PATCH] better turbo support --- direct/src/controls/ShipPilot.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/direct/src/controls/ShipPilot.py b/direct/src/controls/ShipPilot.py index 071567e177..40f4e57342 100755 --- a/direct/src/controls/ShipPilot.py +++ b/direct/src/controls/ShipPilot.py @@ -634,12 +634,16 @@ class ShipPilot(PhysicsWalker.PhysicsWalker): (turnLeft and self.ship.turnRate) or (turnRight and -self.ship.turnRate)) + + # Enable debug turbo mode + maxSpeed = self.ship.maxSpeed if __debug__: debugRunning = inputState.isSet("debugRunning") - if debugRunning: + if debugRunning or base.localAvatar.getTurbo(): self.__speed*=4.0 self.__slideSpeed*=4.0 self.__rotationSpeed*=1.25 + maxSpeed = self.ship.maxSpeed * 4.0 #*# @@ -790,7 +794,7 @@ class ShipPilot(PhysicsWalker.PhysicsWalker): #newVector = self.acForce.getLocalVector()+Vec3(step) newVector = Vec3(step) #newVector=Vec3(rotMat.xform(newVector)) - #maxLen = self.ship.maxSpeed + #maxLen = maxSpeed maxLen = self.ship.acceleration if newVector.length() > maxLen: newVector.normalize() @@ -832,9 +836,9 @@ class ShipPilot(PhysicsWalker.PhysicsWalker): #*# speed = physObject.getVelocity() speedLen = speed.length() - if speedLen > self.ship.maxSpeed: + if speedLen > maxSpeed: speed.normalize() - speed *= self.ship.maxSpeed + speed *= maxSpeed self.avatarViscosity.setCoef(0.5)