hi all,
I have a problem using CollisionShape and I don’t know why.
Use this code to verify proper operation of collisionShape:
[java]
bulletAppState.getPhysicsSpace().enableDebug(assetManager);
[/java]
I using this code and the game run properly, I see the car and collision are good, FPS arround 200
Ferrari model is default asset of jME.
[java]
vehicleNode =(Node)assetManager.loadModel(“Models/Ferrari.j3o”);
vehicleNode.setShadowMode(ShadowMode.Cast);
//Spatial car=assetManager.loadModel(“Models/Ferrari.j3o”);
//Create a hull collision shape for the chassis
CollisionShape carHull = CollisionShapeFactory.createDynamicMeshShape(vehicleNode);
vehicle = new VehicleControl(carHull,mass);
…
[/java]
if I modify the model Ferrari on the other model, imported SketchUp, the game will run very very slow, near 0 or 1 FPS
The problem is CollisionShape, because I use to create collisionShape Ferrari model, and the vehicleNode put my own model, and works well, then the problem is the model of my car? because if you use the ferrari with my model works well but if the collision does not correspond with the new car.
[java]
vehicleNode =(Node)assetManager.loadModel(“Models/other/renault.j3o”);
vehicleNode.setShadowMode(ShadowMode.Cast);
//Spatial car=assetManager.loadModel(“Models/Ferrari.j3o”);
//Create a hull collision shape for the chassis
CollisionShape carHull = CollisionShapeFactory.createDynamicMeshShape(vehicleNode);
vehicle = new VehicleControl(carHull,mass);
…
[/java]
I searched other threads but have not found the solution
Thanks for the help.
Maybe your wheels are inside of the car and cause constant computations? Its a bit of work getting the vehicle to work properly, maybe try using the SDK tool for that.
Please can you explain a little more.
What do you mean the wheels inside the car?
I have a model where I have 4 wheels and the vehicle.
Using this model, the wheels were put in different places than using the model Ferrari.
Is there any way for the wheels are placed automatically in the correct place, or have to put manually, using the position vectors)
Thnkz