- 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
This commit is contained in:
nor..67 2012-06-02 22:40:43 +00:00
parent 1ef93999a3
commit 3450b171c2

View File

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