Переглянути джерело

TestSweepTest: fix crash on native bullet (natives not loaded when shapes are created)

shadowislord 10 роки тому
батько
коміт
38e4580857

+ 5 - 2
jme3-examples/src/main/java/jme3test/bullet/TestSweepTest.java

@@ -21,8 +21,8 @@ import java.util.List;
 public class TestSweepTest extends SimpleApplication {
 public class TestSweepTest extends SimpleApplication {
 
 
     private BulletAppState bulletAppState = new BulletAppState();
     private BulletAppState bulletAppState = new BulletAppState();
-    private CapsuleCollisionShape obstacleCollisionShape = new CapsuleCollisionShape(0.3f, 0.5f);
-    private CapsuleCollisionShape capsuleCollisionShape = new CapsuleCollisionShape(1f, 1f);
+    private CapsuleCollisionShape obstacleCollisionShape;
+    private CapsuleCollisionShape capsuleCollisionShape;
     private Node capsule;
     private Node capsule;
     private Node obstacle;
     private Node obstacle;
     private float dist = .5f;
     private float dist = .5f;
@@ -33,6 +33,9 @@ public class TestSweepTest extends SimpleApplication {
 
 
     @Override
     @Override
     public void simpleInitApp() {
     public void simpleInitApp() {
+        obstacleCollisionShape = new CapsuleCollisionShape(0.3f, 0.5f);
+        capsuleCollisionShape = new CapsuleCollisionShape(1f, 1f);
+        
         stateManager.attach(bulletAppState);
         stateManager.attach(bulletAppState);
 
 
         capsule = new Node("capsule");
         capsule = new Node("capsule");