Unigine.ObjectWaterGlobal Class
Inherits: | Object |
Interface for object water global handling. A water object represents infinitely spread water (global water) with auto-tessellation (wireframe of the water object is not scaled - regardless of the camera position it stays the same) and the underwater mode. This type is suitable to represent boundless ocean while not overloading the GPU.
However, it cannot have a body assigned, and thus does not provide proper physical interaction with scene objects. Also it is limited to a single water level. It means that the filling level of water always remains the same. So, if you need to create, for example, mountain lakes or water flows with height difference, you should use a water mesh.
See Also#
A UnigineScript API sample <UnigineSDK>/data/samples/objects/water_00
ObjectWaterGlobal Class
Properties
int VisualFieldMask#
int PhysicsFieldMask#
int WaterFieldHeightInteraction#
float WaterTime#
float WaterLevelMin#
float WaterLevelMax#
float WaterLevel#
Members
static ObjectWaterGlobal ( ) #
Constructor. Creates a new global water object.float GetHeight ( vec3 position ) #
Returns a height offset of a given point relatively to the water surface.Arguments
- vec3 position - Point position coordinates.
Return value
Height offset of the point.vec3 GetNormal ( vec3 position ) #
Returns a normal vector of a given point (to orient objects along the waves normals).Arguments
- vec3 position - Normal vector.
Return value
Normal vector.void SetOctaveCurrentOffset ( int index, vec3 offset ) #
Sets new offset for an octave (heightmap sample) with given index. Global Water object can have up to 3 octaves.Arguments
- int index - The index of the octave (a heightmap sample).
- vec3 offset - An offset vector.
vec3 GetOctaveCurrentOffset ( int index ) #
Returns an offset vector for an octave (heightmap sample) with given index. Global Water object can have up to 3 octaves.Arguments
- int index - The index of the octave (a heightmap sample).
Return value
An offset vector.float GetWaterProceduralLevelMax ( vec3 position ) #
Returns the maximum Z coordinate value of the water object including bounds of additional fields of other objects that affected Global Water heights in a given position.Arguments
- vec3 position - A position vector of additional fields.
float GetWaterProceduralLevelMin ( vec3 position ) #
Returns the minimum Z coordinate value of the water object including bounds of additional fields of other objects that affected Global Water heights in a given position.Arguments
- vec3 position - A position vector of additional fields.