Buoyancy on waves

semprini

27-06-2006 05:47:38

Hiya,

I have a scene where objects need to bob in moving water. The simple buoyancy is fine.

I need to calculate the height of the water underneath an object and set the buyancy plane & normals.

I can see two ways to do this.
1 - create a water mesh from manually created vertex buffers and write a func to return vertex heights (like in the ogre water demo)
2 - use ogreopcode

Has anyone played around with this?

OvermindDL1

05-07-2006 17:48:42

Assuming you do the water's waves in shaders, I'd say just use a sine function to simulate it (make sure it is lined up with the graphical water's sine generator though).

If it is a real mesh deformation (slower), but just hit-trace.

Horizon

06-07-2006 14:43:56

The bouyancy callback allows you to put in a water surface. Determine tangents at the objects location and construe a plane from that. If you want realistic behaviour, split your objects in multiple, independently buoyant, parts in a compositeobject (or what it's called in newton).