Hi,
I have identical code with TestFancyCar except tuned paramters of car. Every thing runs fine with model provided in tutorial (Ferrari):
Here is the code:
[java]//Load model and get chassis Geometry
carNode = (Node)assetManager.loadModel(“Models/Ferrari/Car.scene”);
//carNode = (Node)assetManager.loadModel(“Models/felicia.obj”);
carNode.setShadowMode(ShadowMode.CastAndReceive);
Geometry chasis = findGeom(carNode, “Car”);
BoundingBox box = (BoundingBox) chasis.getModelBound();[/java]
Buy when I change it to my model or any other, even models which are bundled in jme3-test-data it throws NullPointerException on the last line in my code sample
[java] //Load model and get chassis Geometry
//carNode = (Node)assetManager.loadModel(“Models/Ferrari/Car.scene”);
carNode = (Node)assetManager.loadModel(“Models/felicia.obj”); //and I also tried to convert it into j3o, no change
carNode.setShadowMode(ShadowMode.CastAndReceive);
Geometry chasis = findGeom(carNode, “Car”);
BoundingBox box = (BoundingBox) chasis.getModelBound(); //this is line 351
[/java]
SEVERE: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main] java.lang.NullPointerException at mygame.Main.buildPlayer(Main.java:351) at mygame.Main.simpleInitApp(Main.java:144) at com.jme3.app.SimpleApplication.initialize(SimpleApplication.java:225) at com.jme3.system.lwjgl.LwjglAbstractDisplay.initInThread(LwjglAbstractDisplay.java:130) at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:207) at java.lang.Thread.run(Thread.java:722)
I can’t really understand what is the problem. Model can be loaded without problem as you can see it is already loaded on the screenshot as rigidBodyControl (blue/green car on the left).
I really appreciate any help