{"repo":"corentin-ryr/Boat-Simulation","free":true,"listed":false,"github":"https://github.com/corentin-ryr/Boat-Simulation","clone":"git clone https://github.com/corentin-ryr/Boat-Simulation.git","description":"Buoyancy simulation with mesh intersection in Unity.","language":"C#","stars":39,"topics":["buoyancy","unity3d","mesh","compute-shader"],"license":null,"category":"game-templates","readme_excerpt":"Buoyancy simulation This is a simulation of the buoyancy on mesh objects. This method is applicable to any mesh to simulate a floating behaviour. This method works for a moving water surface. https://user-images.githubusercontent.com/21026578/232889953-69d9c95f-19a6-47b4-996e-9a279ac0ba2f.mp4 Usage The buoyancy system requires two elements: The water The floating object Water The system needs a water manager in the scene (of type WaterManager) and a water object that implements the IWater interface. This interface only needs the object to have a transform and a GetHeight method (that returns the water height at a given position). Floater The floating object needs the PressureFloater component. This component requires a meshCollider with convex set to true and a RigidBody with gravity enabled. By default the floter component uses the collider mesh as the hull of the floating object. For complex meshes, it is good practice to give the floater a simpler mesh as the hull (through the public attribute). For a boat mesh, the system will assume that anything outside the mesh is water (so act as if the boat was filled with water). The method To simulate the buoyancy, we need to apply two forces, the gravity at the center of mass and the buoyant force at the geometric center of the immersed part of the object and oriented toward the normal of the water surface. To find the immersed part of the mesh, we compute the intersection between the water mesh and the floating object's mesh. The","default_branch":null,"files":null,"tree":[],"storefront":"/r/corentin-ryr","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/corentin-ryr/Boat-Simulation/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}