I imported a model and I want it to collide with a box. I followed the tutorial, but I can’t find how to make the collision shape for the model exactly like the model. Any help would be appreciated.
If the model moves, you’ll want to use a simple collision shape like a capsule, or a compoundcollisionshape depending on what shape your model is.
[java]CapsuleCollisionShape capsuleShape = new CapsuleCollisionShape(1.5f, 6f, 1);
CharacterControl character_phys = new CharacterControl(capsuleShape, 0.01f);
spatial.addControl(character_phys);[/java]
If its static and you want mesh perfect collision detection (still not recommended if its a complex model) you can just do. [java]spatial.add(new RigidBodyControl(0))[/java] and it will create it for you. https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:advanced:physics details all of this.