[Solved] Very Specific Question about OgreNewt and buoyancy

Apouche

07-03-2007 04:03:42

Hi, I've just posted this message on the general forum but was adviced to post it here instead.

I am new on the forum I've been using Ogre in a while now and I wonder if there is any way to have a more complex mesh rather than a simple plane when you apply the buoyancy force on an object.
It written on the example that it can be done (for a more complex animated sea) but how ?

I've even looked on Newton source and seems like the callback can expect more that only 4 arguments (the A B C D parameters of the plane) but how to use it ?

Thanks for your help

Game_Ender

07-03-2007 15:44:16

I don't think you understand how bouyancy works in Newton. For every update, for every body, Newton calls the bouyancy callback function assigned to that body. So all you have to do is check the state of the waves at that instant in time, find the vector normal to the waters surface at the point just below/above the body and create the plane based on that. You must do this for every physics update for each body, so you have a chance to update your planes as the waves move.

Apouche

07-03-2007 16:41:48

Of course !!!
I'm ashamed I didn't even think about that !
Thanks a lot