Hey,
I just startet playing around with jbullet-jme and it looks really cool, but i got a Problem with the PhysicsVehicleNode.
So this is how i try to use it:
physicsCar=new PhysicsVehicleNode(carBody,CollisionShape.ShapeTypes.BOX);
physicsCar.setFrictionSlip(0.8f);
physicsCar.setMaxSuspensionTravelCm(20);
physicsCar.setMass(250);
float stiffness=190;//200=f1 car
float compValue=0.2f; //(lower than damp!)
float dampValue=0.5f;
physicsCar.setSuspensionCompression(compValue*2.0f*FastMath.sqrt(stiffness));
physicsCar.setSuspensionDamping(dampValue*2.0f*FastMath.sqrt(stiffness));
physicsCar.setSuspensionStiffness(stiffness);
Vector3f wheelDirection=new Vector3f(0,-1,0);
Vector3f wheelAxle=new Vector3f(-1,0,0);
// Front left
physicsCar.addWheel(wheel1, new Vector3f(0.7f,0.4f,1.2f), wheelDirection, wheelAxle, 0.13f, 0.34f, true);
physicsCar.setRollInfluence(0, 1);
// Front right
physicsCar.addWheel(wheel2, new Vector3f(-0.7f,0.4f,1.2f), wheelDirection, wheelAxle, 0.13f, 0.34f, true);
physicsCar.setRollInfluence(1, 1);
physicsCar.addWheel(wheel3, new Vector3f(0.7f,0.4f,-1.2f), wheelDirection, wheelAxle, 0.13f, 0.34f, false);
physicsCar.setRollInfluence(2, 1);
physicsCar.addWheel(wheel4, new Vector3f(-0.7f,0.4f,-1.2f), wheelDirection, wheelAxle, 0.13f, 0.34f, false);
physicsCar.setRollInfluence(3, 1);
physicsCar.setLocalScale(3.5f);
physicsCar.setLocalTranslation(new Vector3f(-20,2,0));
rootNode.attachChild(physicsCar);
physicsCar.updateRenderState();
pSpace.add(physicsCar);
The Node carBody, as the name already says, only contains the Car-Body and the wheel-Nodes are all clones from one wheel.
First it starts falling until it hits the ground. This works now, after it took me some time to get the (hopefully) right values for the suspension-stuff.
But as soon as i try to accelerate the vehicle just starts spinning around like crazy and falls through the ground.
Do you have any Idea what i'm doing wrong?
Dennis