verlet physics update

Blitz3D Forums/Blitz3D Programming/verlet physics update

some more answers i hope are helpfull for you swift.

"Okay, but I suspect that this is because you modeled the tires in a funny way. You don't have any actual springs connecting them to the body"
im not sure what you mean. if you mean code that uses correct physics for a spring? if so then yes i dont have that. but each tire does have many constraint springs connected to verlets that represent the body.
heres a list of what the connections are for the tires.

verleta and verletb are front tires.
verlete and verletf are rear tires.
verlets c,d,g,h form the roof of the car body
verleti is the center verlet that the player_pivot is tied to.

so here is one of the front tires, verleta, is connected.
the following 3 are consider edge connections (imagine the edges of a cube)
Constraint2(verleta,verletb) from tire a to tire b (parrelel to x axis)
Constraint2(verleta,verletd) from tire a to roof body d (parrellel to y axis)
Constraint2(verleta,verlete) from tire a to rear tire e (parellel to z axis)

the next 3 are cross face connections (imagine a dice, look at a face on the dice and draw a line diaganol corner to corner across that face)
Constraint2(verleta,verletc) tire a to roof c
Constraint2(verleta,verletf) tire a to rear tire f
Constraint2(verleta,verleth) tire a to roof h

the next one is a connection that travels thru the middle of the imaginary cube. (hold a dice so that you are looking directly at one face. pick a corner of that face and draw a line thru the middle of the dice to a corner of a face on the opposite side)
Constraint2(verleta,verletg) tire a to roof g

the last type of connection is the easiest. every verlet is connected to the center verlet.


you also wrote:
"and they don't have a correct mass because you used the mass to fake a spring effect."
actually if you think about it the wheels having a much lower mass is very realistic. how much does a tire/wheel weigh? lets say 75 pounds. how much does the body of the car weigh? a ton? so that part is correct. you DO want the wheels to have a low mass. the part about faking a spring effect, yeah i admit i have abosultely no clue how to code a real spring. so maybe if you know how to do that it could take the sim one step closer in realism.

"Also, because you only have one acceleration parameter, you don't have the ability to specify an acceleration in any direction you want to. "
it is typical to accumulate all your forces, or in our case accelerations, before you send them to the integrator. the code has one line that is messing this all up. if i fixed it you could accelerate the car in any vector direction by storing them in the accululator, vGrav.Vector = Vector(0.0,9,0.0). the reason it isnt working properly is i am resetting that accumulator in the main loop. thats one of the bugs that needs to be fixed. but it is a VERY easy fix.