Water, and Ships flipping over

OvermindDL1

30-01-2006 01:24:19

Say I have some small ships, the person will be these ships so the overall collision is one object. How do I keep it from flipping around in the water, but not be constrained completely up using an upvector or whatnot, would a spring work, and what would I attach it to?

If you would prefer me to post on the newton page I can, just signed up for an account...

haffax

30-01-2006 09:11:23

Is the inertia high enough? You can make it higher for a ship, than a solid object has of this form, since mass is distributed more on the outer side, than the inner.

OvermindDL1

30-01-2006 22:18:10

Mind you, never used a physics engine before, always wrote my own movement code so that is a bit greek'ish to me. Basically asking if there is a way to make the bottom of the thing heavier so it will always remain up-right, but can still tilt around under heavier influences, like tight turning, or a powerful impact (say weapon, or bumping).

I take it I should ask this in the NGE forums...

haffax

31-01-2006 00:07:27

Inertia is exactly what controls this behaviour you want. Since you didn't provide more info, I am unable to be more specific with the actual values.

walaber

31-01-2006 00:19:17

also, moving the center of mass of the object lower will make the object react to buoyancy as if the bottom is very heavy (that's why the center of mass is located there).

you can either offset the model in your modeller (and the subequent collision shape in OgreNewt), or you can use the new setCenterOfMass() function in the latest release to tweak the COM however you want. in that case, you pass a vector relative to the local origin of the body for the new center of mass.

OvermindDL1

31-01-2006 00:27:58

Ah, offset the center, that makes obvious sense, and will work fine, will just ask them to offset the model itself.

walaber

31-01-2006 00:54:30

and don't forget to try offsetting in OgreNewt (body->setCenterOfMass()) later for fine-tuning.

OvermindDL1

31-01-2006 01:32:01

I will add it to my objects initial properties section so it can be overridden from script. Thanks for the help.