Browse Source

- change TestSweepTest to apply the location to the spatial before adding the physics control to avoid having the obstacle at 0/0/0 in the first frame

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9448 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
nor..67 13 years ago
parent
commit
3450b171c2
1 changed files with 2 additions and 2 deletions
  1. 2 2
      engine/src/test/jme3test/bullet/TestSweepTest.java

+ 2 - 2
engine/src/test/jme3test/bullet/TestSweepTest.java

@@ -36,15 +36,15 @@ public class TestSweepTest extends SimpleApplication {
         stateManager.attach(bulletAppState);
 
         capsule = new Node("capsule");
+        capsule.move(-2, 0, 0);
         capsule.addControl(new RigidBodyControl(capsuleCollisionShape, 1));
         capsule.getControl(RigidBodyControl.class).setKinematic(true);
-        capsule.move(-2, 0, 0);
         bulletAppState.getPhysicsSpace().add(capsule);
         rootNode.attachChild(capsule);
 
         obstacle = new Node("obstacle");
-        RigidBodyControl bodyControl = new RigidBodyControl(obstacleCollisionShape, 0);
         obstacle.move(2, 0, 0);
+        RigidBodyControl bodyControl = new RigidBodyControl(obstacleCollisionShape, 0);
         obstacle.addControl(bodyControl);
         bulletAppState.getPhysicsSpace().add(obstacle);
         rootNode.attachChild(obstacle);