User Tools


Water Object Manager

WaterObjectManager inspector.

Water Object Manager is the main script of Dynamic Water Physics 2 and it needs to be added to every scene that will have water physics enabled. All the physics calculations for all the Water Objects in the scene are done in here. Centralizing all the calculations has been done to make use of Unity Jobs (multi-threading). Water Object Manager can be attached to any object in the scene, as long as exactly one is present.

Fields
  • Fluid Density - Density of the fluid in kg/m3. Default is 1030 which equals salt water.
  • Dynamic Force Coefficient - Roughly equal to the viscosity of the fluid. 1 is default value for water. All forces except for buoyant forces are multiplied by this value.
  • High Resolution Water Queries - Only effective is Crest, Ocean Community Next Gen, Lux Water or some other wavy water asset is used. Instead of querying for water height at the center of each triangle, water heights will be queried for each point of each triangle tripling the number of queries. Enabling this option is recommended for when higher accuracy is required (e.g. ship simulator).
  • Query Water Heights - Only effective when wavy water asset is used. If disabled wave heights will not be queried and instead script will assume flat water. It is useful to toggle this option if using wavy water asset but with wave amplitude set to 0 (e.g. Crest wiyhout waves) as it improves performance drastically.
  • Query Water Velocities - Should water surface velocity be queried (rivers, streams)? At the moment there are no supported water assets that support this feature but the option has been added as some assets have announced this feature. If there is a need to imitate simple water flow, Rigidbody.AddForce can be used from an external script.
  • Generate Gizmos - If enabled and gizmos are turned on in the editor Gizmos for all water objects will be generated and drawn.