This page has been translated automatically.
UnigineEditor
Interface Overview
Assets Workflow
Settings and Preferences
Adjusting Node Parameters
Setting Up Materials
Setting Up Properties
Landscape Tool
Using Editor Tools for Specific Tasks
FAQ
Programming
Fundamentals
Setting Up Development Environment
Usage Examples
UnigineScript
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine and Tools
GUI
Double Precision Coordinates
API
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
CIGI Client Plugin
Rendering-Related Classes
Warning! This version of documentation is OUTDATED, as it describes an older SDK version! Please switch to the documentation for the latest SDK version.
Warning! This version of documentation describes an old SDK version which is no longer supported! Please upgrade to the latest SDK version.

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.

ObjectWaterGlobal Class

Members


static ObjectWaterGlobal()

Constructor. Creates a new global water object.

ObjectWaterGlobal cast(Object base)

Casts an ObjectWaterGlobal out of the Object instance.

Arguments

  • Object base - Object instance.

Return value

ObjectWaterGlobal instance.

ObjectWaterGlobal cast(Node node)

Casts an ObjectWaterGlobal out of the Node instance.

Arguments

  • Node node - Node instance.

Return value

ObjectWaterGlobal instance.

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

Return value

An offset vector.

int getPhysicsFieldMask()

Returns the FieldHeight physics mask of the assigned material on the Global Water.

Return value

The FieldHeight physics mask.

int getVisualFieldMask()

Returns the FieldHeight visual mask of the assigned material on the Global Water.

Return value

The FieldHeight visual mask.

int getWaterFieldHeightInteraction()

Checks if the assigned material on the Global Water object has enabled FieldHeight interaction option.

Return value

1 if the FieldHeight interaction option is enabled, otherwise, 0.

float getWaterLevel()

Returns the average 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.

float getWaterLevelMin()

Returns the minimum Z coordinate of the water object.

Return value

The Z coordinate value.

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.

void setWaterTime(float time)

Sets water time value for water synchronization.

Arguments

  • float time - Water time value.

float getWaterTime()

Returns water time value for water synchronization.

Return value

Water time value.

int getWorldIntersection(Vec3 wp0, Vec3 wp1, vec3[] ret_point, vec3[] ret_normal, vec4[] ret_texcoord)

Searches for intersections with given line.

Arguments

  • Vec3 wp0 - The line's start point coordinates.
  • Vec3 wp1 - The line's end point coordinates.
  • vec3[] ret_point - Intersection point coordinates.
  • vec3[] ret_normal - Normal vector of the intersection point.
  • vec4[] ret_texcoord - Texture coordinates of the intersection point (vec4, where vec4.xy is for the first (0) UV channel, vec4.zw is for the second (1) UV channel).

Return value

1 if intersections are found; otherwise, 0.

int type()

Returns the type of the object.

Return value

ObjectWaterGlobal type identifier.

int SEA_OCTAVES_COUNT

Description

Octaves counter. Specifies, how many octaves (heightmap samples) are used for a Global Water object.
Last update: 2018-08-10
Build: ()