# Making vehicle larger causes suspension issues

I created a car (with the help of the jMonkeyEngine documentation) and used the fancy car they had. However, I noticed the car was very small, and I wanted it to be larger. So I scaled the car and the wheels by a factor of four. However, when I did that, the wheels started going through the ground and the car. I figured it might be a suspension problem but after trying different suspension values, nothing worked. What is the problem here?

Code (the part of the code responsible for making the car):

``````        public void addToSpace(Node rootNode, BulletAppState state){
Geometry chassis = findGeometry(node, "Car");
chassis.setLocalScale(4f);

box = (BoundingBox) chassis.getModelBound();
CollisionShape hull = CollisionShapeFactory.createDynamicMeshShape(chassis);
car = new VehicleControl(hull, mass);

car.setSuspensionCompression(comp * 2.0f * FastMath.sqrt(stiffness));
car.setSuspensionDamping(damp * 2.0f * FastMath.sqrt(stiffness));
car.setSuspensionStiffness(stiffness);
car.setMaxSuspensionForce(20000f);

createWheel(node, "WheelFrontLeft");
createWheel(node, "WheelFrontRight");
createWheel(node, "WheelBackLeft");
createWheel(node, "WheelBackRight");

car.getWheel(2).setFrictionSlip(4);
car.getWheel(3).setFrictionSlip(4);

rootNode.attachChild(node);
}

private void createWheel(Node carNode, String wheel){
Geometry w = findGeometry(carNode, wheel);
w.center();
w.setLocalScale(4f);
box = (BoundingBox) w.getModelBound();
float backWheel = (radius * 1.7f) - 1f;
float frontWheel = (radius * 1.9f) - 1f;

Vector3f wheelDir = new Vector3f(0, -1, 0);
Vector3f wheelAx = new Vector3f(-1, 0, 0);

if(wheel.equals("WheelFrontRight") || wheel.equals("WheelFrontLeft"))
else if(wheel.equals("WheelBackRight") || wheel.equals("WheelBackLeft"))
}
``````

Which physics library are you using (Minie, jme3-bullet, or jme3-jbullet)?

What vehicle parameters were you using before you scaled up the model?

I am using jme3-bullet, I simple used setLocalScale on the geometry that creates the car, as well as on the wheels before they were added to the car. However, when I did that, the wheels went into the ground and through the car.

1 Like

Are you using the same āFerrariā model thatās used in `TestFancyCar`, or a different model?

Try to do the setLocalScale() on the whole car Node instead,

This node hereā¦

Im using the same Ferrari model from TestFancyCar.

1 Like

I tried that, but the wheels did not update their position accordingly, just their size.

I attempted to re-create your app from the fragment provided. I turned on debug visualization using

``````bulletAppState.setDebugEnabled(true);
``````

Doing so revealed that the wheels were positioned wrong. Get the wheel positions right before you start tuning the suspension.

Hereās a suggestion for wheel positioning:

``````    final private static float modelScale = 4f;

public void addToSpace(Node rootNode, BulletAppState state) {
Geometry chassis = findGeometry(node, "Car");
chassis.scale(modelScale);

CollisionShape hull = CollisionShapeFactory.createDynamicMeshShape(chassis);
car = new VehicleControl(hull, mass);

car.setSuspensionCompression(comp * 2.0f * FastMath.sqrt(stiffness));
car.setSuspensionDamping(damp * 2.0f * FastMath.sqrt(stiffness));
car.setSuspensionStiffness(stiffness);
car.setMaxSuspensionForce(20000f);

createWheel(node, "WheelFrontLeft");
createWheel(node, "WheelFrontRight");
createWheel(node, "WheelBackLeft");
createWheel(node, "WheelBackRight");

car.getWheel(2).setFrictionSlip(4);
car.getWheel(3).setFrictionSlip(4);

rootNode.attachChild(node);
}

private void createWheel(Node carNode, String wheel) {
Geometry w = findGeometry(carNode, wheel);
w.center();
Node wheelNode = w.getParent();
wheelNode.scale(modelScale);
float radius = 0.4727f * modelScale;
Vector3f wheelDir = new Vector3f(0, -1, 0);
Vector3f wheelAx = new Vector3f(-1, 0, 0);

switch (wheel) {
case "WheelFrontLeft":
new Vector3f(-1.12f, 0.5754f, -1.69f).multLocal(modelScale),
break;
case "WheelFrontRight":
new Vector3f(+1.12f, 0.5754f, -1.69f).multLocal(modelScale),
break;
case "WheelBackLeft":
new Vector3f(-1.12f, 0.67f, +2.1f).multLocal(modelScale),