Page 1 of 1

Question about vehicle physics...

Posted: Mon Feb 13, 2012 2:48 pm
by DjSt3rios
Hello, I am a new programmer, and recently I started a project. I am using C4 engine, and I have Bullet physics engine integrated in C4. So I was making an accelerating system, but the problem is when my vehicle reaches like 90 KM/h, it start doing a wheelie(I mean the front wheels do not touch the ground). I tried to set the mass of the chassis to 1500, or more, but still the car starts acting weird if I put a lot of mass, so It doesn't really work as I want it to work... could someone help me with this issue? how I could make it more stable?

Re: Question about vehicle physics...

Posted: Mon Feb 13, 2012 3:39 pm
by kloplop321
You could have a base frame which the wheels are attached to and then have another (non-rendered) body which is attached to it using several nonflexible constraints that has a lot of mass, so you're simulating how it would work with an engine inside.

Re: Question about vehicle physics...

Posted: Mon Feb 13, 2012 4:01 pm
by DjSt3rios
kloplop321 wrote:You could have a base frame which the wheels are attached to and then have another (non-rendered) body which is attached to it using several nonflexible constraints that has a lot of mass, so you're simulating how it would work with an engine inside.
so I could sort of, create an invisible chassis, with like 1500 mass, and attach the wheels to it, and put another chassis which would be visible, with like 1000 mass?

Re: Question about vehicle physics...

Posted: Mon Feb 13, 2012 5:15 pm
by kloplop321
Well, one body would be visible, with some mass. The other would not be visible, with some mass.
The current problem is that the inertia is being calculated wrong as it assumes that the mass is evenly distributed, which it is not.
That's why you are currently doing a wheelie.
So, if you actually calculated the form of inertia that you want, then you could just use that instead of complicating the simulation.

Re: Question about vehicle physics...

Posted: Mon Feb 13, 2012 6:04 pm
by DjSt3rios
kloplop321 wrote:Well, one body would be visible, with some mass. The other would not be visible, with some mass.
The current problem is that the inertia is being calculated wrong as it assumes that the mass is evenly distributed, which it is not.
That's why you are currently doing a wheelie.
So, if you actually calculated the form of inertia that you want, then you could just use that instead of complicating the simulation.
I don't really think that I can do that.. I am still new at this.. also about the inertia thing you said, I found a function SetMassProps which you can set the mass and the inertia, but I am not sure what I can do with it yet...