nego
1
BombControl applies negative force (Implosion instead of Explosion)
[java]# This patch file was generated by NetBeans IDE
It uses platform neutral UTF-8 encoding and n newlines.
— Base (BASE)
+++ Locally Modified (Based On LOCAL)
@@ -118,7 +118,10 @@
PhysicsRigidBody rBody = (PhysicsRigidBody) physicsCollisionObject;
rBody.getPhysicsLocation(vector2);
vector2.subtractLocal(vector);
force *= forceFactor;
vector2.normalizeLocal();
vector2.multLocal(force);[/java]
normen
2
Huh? No it doesn’t… In what cases?
nego
3
explosionRadius is sometimes smaller than the length of the force vector2
→ force is negative → vector2 becomes inverted → rBody gets “sucked” in
normen
4
But these rigidbodies should not be affected because they are out of the explosion radius…
nego
5
But they are affected, check out it out in TestWalkingChar.java
The problem is some part of the rigidbody overlaps, but the center of the rigidbody is farther away.
Very problematic on big rigidbodies.
better solution though:
[patch]
This patch file was generated by NetBeans IDE
It uses platform neutral UTF-8 encoding and n newlines.
— Base (BASE)
+++ Locally Modified (Based On LOCAL)
@@ -119,6 +119,9 @@
rBody.getPhysicsLocation(vector2);
vector2.subtractLocal(vector);
float force = explosionRadius - vector2.length();
-
if (force<0f) {<br />
-
force = 0f;<br />
-
}<br />
force *= forceFactor;
vector2.normalizeLocal();
vector2.multLocal(force);
[/patch]