As I catched a bug yesterday, I realised there's something structural
missing perhaps from my sim.
When bottoming out the suspension, I just notice the situation and
kept the suspension from compressing any further. The bug I had was
that the suspension velocity wasn't reset, so it could take some time
before the wheel started moving away from the full compression point
again.
After that, I realised that the real effect was that a collision took
place; I would have to bump the car up, much like when you hit a wall
face on (well ;-) ).
Still, like regular forces, you can easily have all the wheels bottom
out at (nearly) the same time, for example when dropping the car from
1m above the ground. This would in effect bounce the car back straight
up. Does anyone have an idea to the possibility of implementing this
sort of thing cleanly? Seems like an added system of impulses, which
add up somehow, instead of taking 1 collision point and mirror
velocity over that (like I do know when you hit the rail, and I don't
even take into account rotational velocity changes yet).
Gosh I should read Chris Heckers physics docs again I think. Still, I
think that handles only 1 collision, while I want to cleanly handle
things like:
body.AddImpulse(Vector *pointOfApplication,Vector
*velocityAtThatPoint)
Where velocityAtThatPoint is something like either the body velocity,
the collision object velocity (another car?), or just the difference
so it's always like one object is static, and the other one isn't.
Sounds a bit like the problem where you drop a cube cleanly to the
floor and all 4 vertices (well, one face actually) hits the ground in
exactly the same time. I guess it would be better perhaps to just
handle 1 impulse per time step, and do a queue maybe which keeps the
other 3 impulses alive for other timesteps.
Am I answering my own question here? ;-)
Anyway, any thoughts on this? Thanks,
Ruud van Gaal, GPL Rank +53.25
Pencil art : http://www.racesimcentral.net/
Free car sim : http://www.racesimcentral.net/