Programming
Fundamentials
Setting Up Development Environment
UnigineScript
High-Level Systems
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine and Tools
GUI
Double Precision Coordinates
API
Bounds-Related Classes
Containers
Controls-Related Classes
Core Library
Engine-Related Classes
GUI-Related Classes
Node-Related Classes
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
Rendering-Related Classes
Utility Classes

ObjectWaterGlobal Class

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.

To use this class, include the UnigineObjectWaterGlobal.h file.

ObjectWaterGlobal Class

Members


ObjectWaterGlobal ()

Constructor. Creates a new global water object.

float getWaterLevel ()

Returns the minimum Z coordinate of the water object.

Return value

The Z coordinate value.

float getWaterLevelMax ()

Returns the maximum Z coordinate of the water object.

Return value

The Z coordinate value.

Math::vec3 getNormal (const Math::Vec3 & position)

Returns a normal vector of a given point (to orient objects along the waves normals).

Arguments

  • const Math::Vec3 & position - Normal vector.

Return value

Normal vector.

float getHeight (const Math::Vec3 & position)

Returns a height offset of a given point relatively to the water surface.

Arguments

  • const Math::Vec3 & position - Point position coordinates.

Return value

Height offset of the point.

setOctaveCurrentOffset (int index, const Math::vec3 & offset)

Arguments

  • int index
  • const Math::vec3 & offset

getOctaveCurrentOffset (int index)

Arguments

  • int index

getWaterTime ()

getIntersection (const Math::vec3 & p0, const Math::vec3 & p1, Math::vec3 * ret_point, Math::vec3 * ret_normal, Math::vec4 * ret_texcoord)

Arguments

  • const Math::vec3 & p0
  • const Math::vec3 & p1
  • Math::vec3 * ret_point
  • Math::vec3 * ret_normal
  • Math::vec4 * ret_texcoord

setWaterTime (float time)

Arguments

  • float time

int SEA_OCTAVES_COUNT

Last update: 2017-07-03