FancyCar Chassis ConnectionPoint

Hey Guys,

The FancyCarTest has the following code: (0.42f being my change)

float back_wheel_h = (wheelRadius * 1.7f) - 1f + 0.42f;
float front_wheel_h = (wheelRadius * 1.9f) - 1f + 0.42f;

What does this code actually do? (I don’t know how you come up with Radius * 1.9f etc)
I know that this is basically the offset on how the chassis connects to the suspension.

Now what I did: I had to change the value to atleast 0.4f (which means setting the connection point DOWN) so the wheels don’t get stuck in the fender and the car is flying over and leaving the map.

When I change that value too high, I get an offroad feeling (which I don’t want).
The reason why I actually changed that setting is because the collissionshape in debugDraw doesn’t match the wheel spatial (but the wheel spatial is what actually seems to matter?)

Now how could I leave the connectionPoint as it is and change the suspension so it works?
What does restLength define? The Length the Suspension has in rest (e.g. free fall) or the “Restlänge” which means the “final” length the suspension has (like the minimum).

I guess it’s the first one, so how can I change the length in idle state? Making the suspension more stiff will effect the drive-feeling :confused:

I made a picture, may be can help understand.

The demo is quite cool, I still wonder how the guy made it. I also tuned it a bit on my PC.

Yes, should be the length when resting, so I guess it’s the first one too.

Did you see, there is a “Vehicle Creator” plugin in the jME SDK? Never used it though.

So the chassisConnection is where the red and cyan lines intersect?
And yep I saw the vehicle creator but it’s not really working in 3.0

Simply enabling the debug view of the physics space should help.

That’s true. What also helped is simply making the wheel (spatial) bigger, but:

It’s wierd since the displayed wheel in debug mode isn’t touching the ground (I guess this should display the connection point) and then the connection line is the suspension?

I am trying to wrap my head around the restLength vs said offset. I play with them and I can adjust the debug-display-wheel and the spatial so they match but the car becomes undrivable because the suspension seems to hit the chassis.

I guess I simply need to try dozens of years :smiley:

Or you just take the working car example (not fancy car) and see what the parameters do?

1 Like