Scale must not have 0 as a component!

I made a simple box, just to try with 3ds max and exported it as .3ds.



spatial.setLocalScale(2);      
spatial.setModelBound(new BoundingBox());
spatial.updateWorldBound();



I want to make it a static physics node, so I gave it a modelbound and so on.
The system tells me :


 java.lang.IllegalArgumentException: scale must not have 0 as a component!
   at com.jmex.physics.impl.ode.geometry.OdeBox.updateWorldVectors(OdeBox.java:69)
   at com.jme.scene.Spatial.updateWorldData(Unknown Source)
   at com.jme.scene.Spatial.updateGeometricState(Unknown Source)
   at com.jme.scene.Node.updateWorldData(Unknown Source)
   at com.jme.scene.Spatial.updateGeometricState(Unknown Source)
   at com.jme.scene.Node.updateWorldData(Unknown Source)
   at com.jme.scene.Spatial.updateGeometricState(Unknown Source)
   at com.jme.scene.Node.updateWorldData(Unknown Source)
   at com.jme.scene.Spatial.updateGeometricState(Unknown Source)



Could someone tell me wich are the requisites to export a 3ds model to fit it in jme ?

This problem only exists if you generate physics collision geometries from your mesh (so this actually belongs into the physics board).



None of your objects in the mesh may result in a collision geometriy that has zero width, height or length to use jME Physics 2. Make sure to either have a scale != 0 (e.g. change that component to 0.0001f) or change the model bound of that object to be larger.

Yes, you're right…but it's strange.



When I load a complex model (but it's an ms3d mesh) for a dynamic physics node i just do :


model = ModelLoader.loadModel(modelFile);
model.setLocalScale(0.8f);
model.setLocalTranslation(new Vector3f(0 , 0 ,0));
model.setModelBound(new BoundingBox());
model.updateModelBound();
model.setIsCollidable(true);                              
model.updateWorldBound();



and all works.

To make the static object live I've done :


spatial.setModelBound(new BoundingBox(new Vector3f(), 1, 1, 1));



The difference, in the first case, is that I didn't need to specify the boundings size.

Boh, what do you say ?

When you update the model bound after setting it the size is wiped either way. So this can't be the reason. Neither can the reason be static or dynamic. Maybe you used another 3ds file?

In dynphysnode, as written, is a ms3d (Milkshape) model.



The problem, giving myself the size of mesh, is that I need to know exaclty the size of element in game.

Actually I make the model and introduce it in game by eye sensing.