Ejemplo n.º 1
0
 def applyDistantImpulse(self, position, impulseValue, reason = ImpulseReason.ME_HIT):
     if reason != ImpulseReason.SPLASH and reason != ImpulseReason.PROJECTILE_HIT:
         return
     impulse = BigWorld.player().getOwnVehiclePosition() - position
     distance = impulse.length
     if distance <= 1.0:
         distance = 1.0
     impulse.normalise()
     if reason == ImpulseReason.PROJECTILE_HIT:
         if not cameras.isPointOnScreen(position):
             return
         distance = 1.0
     impulse *= impulseValue / distance
     self.applyImpulse(position, impulse, reason)
Ejemplo n.º 2
0
 def applyDistantImpulse(self, position, impulseValue, reason=ImpulseReason.ME_HIT):
     if reason != ImpulseReason.SPLASH and reason != ImpulseReason.PROJECTILE_HIT:
         return
     impulse = BigWorld.player().getOwnVehiclePosition() - position
     distance = impulse.length
     if distance <= 1.0:
         distance = 1.0
     impulse.normalise()
     if reason == ImpulseReason.PROJECTILE_HIT:
         if not cameras.isPointOnScreen(position):
             return
         distance = 1.0
     impulse *= impulseValue / distance
     self.applyImpulse(position, impulse, reason)