I'm experimenting with the code a little bit. And I managed to add
up/down directions for the car, effectively changing it from hovercraft
into flying saucer ;)
After some code analysis I discovered that following things need to be
-- wheel support the car body
+- it means collosion detection for wheels
+- then it means force-transfer from wheels to the car body
-- car 'bouncing off the ground' problem
+- maybe introduce some bool variable 'two-materials-in-contact' ?
it will avoid this constant falling down of the car, then colliding
with ground, so it jumps up and down.
+- maybe changing integrating method from x(t+dt)=x(t)+v*dt into
better method would help? There are at least 5 of them.
I have one right here: x(t+dt)=2*x(t)-x(t-dt)+a(t)*(dt)^2
(this one uses acceleration, smaller error: of range (dt)^2)
If you are interested I'll check formulas for other possibilities.
without checking I can tell only their names: Verlet integration,
Velocity Verlet, Runge-Knutta, Predictor-Corrector, Leap Frog.
Maybe, Velocity Verlet will be the best?
(oh, I've found a good link for Velocity Verlet:
http://www.orcero.org/irbis/md/node14.html :-)) I see that it
involves mass. I think this is very good, and half timesteps, hmmm...)
Maybe with better integration method the car will not bounce off
the ground? I think I will check it...
-- car movement should be caused by rotating wheels. I see this scenario:
+- wheels rotate AND wheels collide with some material (the ground).
THEN a torque is generated that tries to move wheel center forward.
The force that moves wheel center is transferred to car body.
(yeah, easy to say... much harder to implement)
cjk, I'll be toying with the source for a while.
- I'll check if another integration method changes things a little.
(I see that I'll have to introduce acceleration...)
- And I'll try to add 'wheel support the car body'.
I have no idea if I will be succesfull or not. ;-)) depends on how much
time I'll have ;)
ps: cjk, great work you did with car bouncing and rotation ;)
Janek Kozicki |
I have some prblems with launching xxgdb on untimatestunts. Everything
works fine until the moment the SDL is initialised. SDL cannot be
initialised, and ultimatestunts exits. Is this a known problem? any hints how
to deal with this?
Janek Kozicki |