Hello JMonkeyWorld !!!
I want my car to lay on my circuit, my problem is that when I erase the two lines:
dCircuit.setModelBound(new BoundingBox());
dCircuit.updateModelBound();
from my BuildCircuit() code my car pass trough the circuit. It's ok with myCar/myTerrain.
My Circuit is a single 3D object curved like _/ and a BoundingBox is not the solution. I readed about TriMesh. How can I proceed ?
private void buildCircuit() {
Circuit = loadModel("data/circuit/myfirstcircuit.jme");
Circuit.setLocalScale(30);
Quaternion q2 = new Quaternion();
q2.fromAngleAxis(FastMath.PI*1.5f, new Vector3f(1,0,0));
Circuit.setLocalRotation(q2);
Circuit.setRenderQueueMode(Renderer.QUEUE_OPAQUE);
Circuit.getLocalTranslation().set( new Vector3f (190,257,150) );
dCircuit = getPhysicsSpace().createStaticNode();
dCircuit.attachChild( Circuit );
scene.attachChild( dCircuit );
dCircuit.setModelBound(new BoundingBox());
dCircuit.updateModelBound();
dCircuit.generatePhysicsGeometry();
scene.updateGeometricState(0, true);
}
Thanks in advance !!!
I've read this 4 times now still don't understand what you mean.
Maybe you can clarify to the slow of us somehow ?
If I understood you well, you want to use triangle-accuracy collitions for your track branch of the scenery.
This is achieved changing:
dCircuit.generatePhysicsGeometry();
for this:
dCircuit.generatePhysicsGeometry(true);
I have had some problems with this, though. I
Thanks for your replies !
dCircuit.generatePhysicsGeometry(true) works fine!
See you !