suspension problem

solaris1912

21-03-2008 15:12:48

Hello!

In my racing game, I build my road using "TriangleMeshShape"s. I noticed something about suspension as I move along the circuit.

Here are the suspension values of the car

suspension_damper = 50
suspension_spring = 25000
suspension_target = 0.0
suspension_travel = 0.3


When the cars' all tires are at the same trianglemesh, suspension is very well. However, if one tire moves to another trianglemesh, then the suspension changes as if the suspension_spring value is too high (like 250000) and the body of car moves up a little bit. This is unacceptable for tha game because players feel like the car is jumping on the flat road.

Everything returns back to normal when all tires are at the same trianglemesh.

To test this, I changed the spring value to 250000 and that problem disappeared. But, the suspension effect is gone because 250000 is too high.

Shall I add all trianglemeshes to a one compound shape? Will that effect the performance? And may it solve the problem?

Thanks :)

betajaen

21-03-2008 15:22:22

Try it, and see what happens.

Toby

23-03-2008 10:54:00

I do not noticed such effect in my car game. but i do not use a huge value for spring. I am using 6000 or 10000.

NickM

23-03-2008 12:27:10

I do get the same problem in my game, I haven't bothered looking into it yet though.

solaris1912

23-03-2008 16:23:01

I created trianglemeshshapes as I used to, but instead of creating a body for each trianglemeshshape, I combined them with a single compoundshape. Later, I created a single body for that compoundshape.

That did the trick, suspension is OK and the gameplay is much better now. I have not tested the performance yet, but it seems the same. I'll post performance details after some tests.