"But if you look closely you will see that there is an if statement that checks if its a front wheel or rear wheel. i only apply thrust to the wheels not the entire body. this is for the z axis. so its basically a 4 wheel drive car."
""Instead what I am suggesting is a method like the above, but where the TIRES themselves are allowed to provide thrust to themselves when they touch the ground individually, and in turn their contrained connection to the car, via springs, is what actually pulls the car's body forward.""
"that is how it is working now."
Okay, I didn't look at the code yet, but assuming what you're saying is true, then it's working more like I want, but not exactly like I want.
Right now, you are calling the function, passing it the car, and the acceleration for the car. Then, I guess if what you say is true, you're acting on the WHEELS inside the function when you passed it the car.
The way I see a proper system functioning would be to call DoVerlet once for each verlet object in the world, or for none at all, having the function iterate through them seperately and add any acceleration you want added this frame. That way I could easily change the code on the fly to apply force only to the front tires, or only to the back tires, and there would not be a difference ebtween tires at all, and I could make a six wheeled vehicle with two sets of turning tires if I so desired.
Also, because you only have one acceleration parameter, you don't have the ability to specify an acceleration in any direction you want to. So for example, there's no way to suddenly give the body of the car a sudden vertical push if it goes over say, a fan, or to give the tires a sudden downward push to shove them into the ground which should make the car jump.
""Also, in the current system you get just as much thrust if one tire is touching the ground as you do if four are.""
"in the original code it did exactly what you describe, but i turned it off because the wheel bounces so much that car did not maintain its speed very well. so this is very much on purpose for playability reasons."
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, and they don't have a correct mass because you used the mass to fake a spring effect.
The thing about springs is they're used in cars to keep the tires sticking to the road even when the tire goes over a bump. So I think that exchanging the stick constraints with a spring constraint would solve that problem.
If I knew which constraints in the code were the sticks connecting the tires to the car body then I could attempt to create a spring constraint and test it out. I need to know which ones go up and down.
I'm guessing that you chose to use a single constraint that can go up and down. I need to know which one that is for each tire.
Another way to connect the tires to the body would be with two stick constraints and a spring, in a tetrahedron type of formation, connected to a triangle of sticks which are fixed in position on the car. Then you wouldn't need an axis constraint on the spring. I dunno if that would make things more stable or less stable though.
""Instead what I am suggesting is a method like the above, but where the TIRES themselves are allowed to provide thrust to themselves when they touch the ground individually, and in turn their contrained connection to the car, via springs, is what actually pulls the car's body forward.""
"that is how it is working now."
Okay, I didn't look at the code yet, but assuming what you're saying is true, then it's working more like I want, but not exactly like I want.
Right now, you are calling the function, passing it the car, and the acceleration for the car. Then, I guess if what you say is true, you're acting on the WHEELS inside the function when you passed it the car.
The way I see a proper system functioning would be to call DoVerlet once for each verlet object in the world, or for none at all, having the function iterate through them seperately and add any acceleration you want added this frame. That way I could easily change the code on the fly to apply force only to the front tires, or only to the back tires, and there would not be a difference ebtween tires at all, and I could make a six wheeled vehicle with two sets of turning tires if I so desired.
Also, because you only have one acceleration parameter, you don't have the ability to specify an acceleration in any direction you want to. So for example, there's no way to suddenly give the body of the car a sudden vertical push if it goes over say, a fan, or to give the tires a sudden downward push to shove them into the ground which should make the car jump.
""Also, in the current system you get just as much thrust if one tire is touching the ground as you do if four are.""
"in the original code it did exactly what you describe, but i turned it off because the wheel bounces so much that car did not maintain its speed very well. so this is very much on purpose for playability reasons."
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, and they don't have a correct mass because you used the mass to fake a spring effect.
The thing about springs is they're used in cars to keep the tires sticking to the road even when the tire goes over a bump. So I think that exchanging the stick constraints with a spring constraint would solve that problem.
If I knew which constraints in the code were the sticks connecting the tires to the car body then I could attempt to create a spring constraint and test it out. I need to know which ones go up and down.
I'm guessing that you chose to use a single constraint that can go up and down. I need to know which one that is for each tire.
Another way to connect the tires to the body would be with two stick constraints and a spring, in a tetrahedron type of formation, connected to a triangle of sticks which are fixed in position on the car. Then you wouldn't need an axis constraint on the spring. I dunno if that would make things more stable or less stable though.