|
|
@ -120,6 +120,7 @@ public class BombControl extends RigidBodyControl implements PhysicsCollisionLis |
|
|
|
vector2.subtractLocal(vector); |
|
|
|
vector2.subtractLocal(vector); |
|
|
|
float force = explosionRadius - vector2.length(); |
|
|
|
float force = explosionRadius - vector2.length(); |
|
|
|
force *= forceFactor; |
|
|
|
force *= forceFactor; |
|
|
|
|
|
|
|
force = force > 0 ? force : 0; |
|
|
|
vector2.normalizeLocal(); |
|
|
|
vector2.normalizeLocal(); |
|
|
|
vector2.multLocal(force); |
|
|
|
vector2.multLocal(force); |
|
|
|
((PhysicsRigidBody) physicsCollisionObject).applyImpulse(vector2, Vector3f.ZERO); |
|
|
|
((PhysicsRigidBody) physicsCollisionObject).applyImpulse(vector2, Vector3f.ZERO); |
|
|
@ -165,6 +166,4 @@ public class BombControl extends RigidBodyControl implements PhysicsCollisionLis |
|
|
|
public void write(JmeExporter ex) throws IOException { |
|
|
|
public void write(JmeExporter ex) throws IOException { |
|
|
|
throw new UnsupportedOperationException("Saving not supported."); |
|
|
|
throw new UnsupportedOperationException("Saving not supported."); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|