About Store Forum Documentation Contact
Donations:
309$/mo



Post Reply 
Interaction with water
Author Message
kulesz Offline
Member

Post: #1
Interaction with water
Hi,

I'd like to ask, is there some way to interact with water, eg.: putting some waterboat on it, adding splashes and "tail" behind a sailing ship? I'd like to do it both on default water (infinite) and on some world-made river/lakes.
02-25-2010 09:28 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
RE: Interaction with water
you can simulate boat physics manually
boat splashes simulate with particles
on water surface effects will be in the future
02-25-2010 02:56 PM
Find all posts by this user Quote this message in a reply
kulesz Offline
Member

Post: #3
RE: Interaction with water
About boat physics:
Is it possible to cut some shape (mesh, phys or actor) with a plane and calculate, which part is over and which is under the plane (in a volume percentage, for example)? Generally, I'd like to know, how much some shape is immersed in water. Is it possible to do with actual physics engine?
03-03-2010 05:13 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #4
RE: Interaction with water
just calculate the min.y and max.y of a shape compare them to water level and take some average
03-03-2010 05:38 PM
Find all posts by this user Quote this message in a reply
kulesz Offline
Member

Post: #5
RE: Interaction with water
Is it possible to toggle through position of all vertexes of an actor? (for computing min/max y)
03-03-2010 07:11 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #6
RE: Interaction with water
that would be inefficient
you can use Actor::shape if its from 1 shape
or secondary Mesh::box transformed by Actor::matrix
03-03-2010 08:53 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #7
RE: Interaction with water
you can also use Actor::massCenter..
03-03-2010 09:03 PM
Find all posts by this user Quote this message in a reply
kulesz Offline
Member

Post: #8
RE: Interaction with water
OK, I've found quite nice and effective algorithm of calculating buoyancy forces in water. I need to treat water as a plane (which is already done in engine, I think) and if some object collides with the water, I need to make bounding box of the immersed part. Then I calculate volume of the bbox and apply force in the middle of it.
My question is, how to calculate to bbox of part of an object, intersected by a water plane (red part):

[Image: waterproblem.jpg]
03-08-2010 02:59 PM
Find all posts by this user Quote this message in a reply
Post Reply