Hi, guys.
I have the idea to scale my car according to terrain scale factor.
But I have some problems with wheels position scaling.
Is it possible?
Let’s take FancyCarTest for example
//Load model and get chassis Geometry
carNode = (Node)assetManager.loadModel("Models/Ferrari/Car.scene");
carNode.scale(2); - here I scale all model with wheels and it is work good.
carNode.setShadowMode(RenderQueue.ShadowMode.Cast);
Geometry chasis = findGeom(carNode, "Car");
BoundingBox box = (BoundingBox) chasis.getModelBound();
But what about wheels position
Geometry wheel_fr = findGeom(carNode, "WheelFrontRight"); wheel_fr.center(); box = (BoundingBox) wheel_fr.getModelBound(); wheelRadius = box.getYExtent(); float back_wheel_h = (wheelRadius * 1.7f) - 1f; float front_wheel_h = (wheelRadius * 1.9f) - 1f; player.addWheel(wheel_fr.getParent(), box.getCenter().add(0, -front_wheel_h, 0), wheelDirection, wheelAxle, 0.2f, wheelRadius, true);
box.getCenter().add(0, -front_wheel_h, 0), - changing zeros here doesn’t do anything.
How can I correctly change the wheel position according to my scale factor?