This page has been translated automatically.
视频教程
界面
要领
高级
实用建议
UnigineEditor
界面概述
资产工作流程
设置和首选项
项目开发
调整节点参数
Setting Up Materials
Setting Up Properties
照明
Landscape Tool
Sandworm
使用编辑器工具执行特定任务
Extending Editor Functionality
嵌入式节点类型
Nodes
Objects
Effects
Decals
光源
Geodetics
World Nodes
Sound Objects
Pathfinding Objects
Players
编程
基本原理
搭建开发环境
Usage Examples
C++
C#
UnigineScript
UUSL (Unified UNIGINE Shader Language)
Plugins
File Formats
Rebuilding the Engine Tools
GUI
双精度坐标
应用程序接口
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
IG Plugin
CIGIConnector Plugin
Rendering-Related Classes
创建内容
Content Optimization
Materials
Art Samples
Tutorials

Unigine::ObjectWaterGlobal Class

Header: #include <UnigineObjects.h>
Inherits from: 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

Members


static ObjectWaterGlobalPtr create ( ) #

Constructor. Creates a new global water object.

float getHeight ( const Math::Vec3& position ) const#

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.

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

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.

int getPhysicsFieldMask ( ) const#

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

Return value

The FieldHeight physics mask.

int getVisualFieldMask ( ) const#

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

Return value

The FieldHeight visual mask.

float getWaterLevelMax ( ) const#

Returns the maximum Z coordinate of the water object.

Return value

The Z coordinate value.

float getWaterLevelMin ( ) const#

Returns the minimum Z coordinate of the water object.

Return value

The Z coordinate value.

float getWaterProceduralLevelMax ( const Math::Vec3& position ) const#

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

  • const Math::Vec3& position - A position vector of additional fields.

float getWaterProceduralLevelMin ( const Math::Vec3& position ) const#

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

  • const Math::Vec3& position - A position vector of additional fields.

void setWaterTime ( float time ) #

Sets water time value for water synchronization. It is used for effects, such as normals, caustics, and foam.

To make water surface immoveble, octave offset also needs to be reset:

Source code (C++)
//to be called in the update() method

water->setWaterTime(0);
for (int i = 0; i < 3; ++i)
  water->setOctaveCurrentOffset(i, vec3(0.0,0.0,0.0));

Arguments

  • float time - Water time value.

float getWaterTime ( ) const#

Returns water time value for water synchronization.

Return value

Water time value.

static int type ( ) #

void setWindDirectionAngle ( float angle ) #

Arguments

  • float angle

float getWindDirectionAngle ( ) const#

void setWindAffect ( float affect ) #

Arguments

  • float affect

float getWindAffect ( ) const#

void setHeightAmplitudeThreshold ( float threshold ) #

Arguments

  • float threshold

float getHeightAmplitudeThreshold ( ) const#

void setHeightQuality ( int quality ) #

Arguments

  • int quality

int getHeightQuality ( ) const#

void setIntersectionAccuracy ( float accuracy ) #

Arguments

  • float accuracy

float getIntersectionAccuracy ( ) const#

void setIntersectionAmplitudeThreshold ( float threshold ) #

Arguments

  • float threshold

float getIntersectionAmplitudeThreshold ( ) const#

void setIntersectionQuality ( int quality ) #

Arguments

  • int quality

int getIntersectionQuality ( ) const#

bool isWaterFieldHeightInteraction ( ) const#

bool isWaterFieldShorelineInteraction ( ) const#

void setManual ( bool manual ) #

Arguments

  • bool manual

bool isManual ( ) const#

int addWave ( float length, float amplitude, float steepness, float direction_angle, float phase ) #

Arguments

  • float length
  • float amplitude
  • float steepness
  • float direction_angle
  • float phase

void removeWave ( int index ) #

Arguments

  • int index

int getNumWaves ( ) const#

float getWaveLength ( int index ) const#

Arguments

  • int index

void setWaveLength ( int index, float value ) #

Arguments

  • int index
  • float value

float getWaveAmplitude ( int index ) const#

Arguments

  • int index

void setWaveAmplitude ( int index, float value ) #

Arguments

  • int index
  • float value

float getWaveSteepness ( int index ) const#

Arguments

  • int index

void setWaveSteepness ( int index, float value ) #

Arguments

  • int index
  • float value

float getWaveDirectionAngle ( int index ) const#

Arguments

  • int index

void setWaveDirectionAngle ( int index, float value ) #

Arguments

  • int index
  • float value

float getWavePhaseOffset ( int index ) const#

Arguments

  • int index

void setWavePhaseOffset ( int index, float value ) #

Arguments

  • int index
  • float value

int addLayer ( ) #

void removeLayer ( int layer ) #

Arguments

  • int layer

int getNumLayers ( ) const#

void swapLayer ( int num_0, int num_1 ) #

Arguments

  • int num_0
  • int num_1

void setLayerEnabled ( int layer, bool enabled ) #

Arguments

  • int layer
  • bool enabled

bool isLayerEnabled ( int layer ) const#

Arguments

  • int layer

int getLayerNumWaves ( int layer ) const#

Arguments

  • int layer

void setLayerNumWaves ( int layer, int num ) #

Arguments

  • int layer
  • int num

Math::vec2 getLayerLengthRange ( int layer ) const#

Arguments

  • int layer

void setLayerLengthRange ( int layer, const Math::vec2& value ) #

Arguments

  • int layer
  • const Math::vec2& value

Math::vec2 getLayerAmplitudeRange ( int layer ) const#

Arguments

  • int layer

void setLayerAmplitudeRange ( int layer, const Math::vec2& value ) #

Arguments

  • int layer
  • const Math::vec2& value

float getLayerSteepnessScale ( int layer ) const#

Arguments

  • int layer

void setLayerSteepnessScale ( int layer, float value ) #

Arguments

  • int layer
  • float value

float getLayerDirectionAngleVariance ( int layer ) const#

Arguments

  • int layer

void setLayerDirectionAngleVariance ( int layer, float value ) #

Arguments

  • int layer
  • float value

float getLayerWeight ( int layer ) const#

Arguments

  • int layer

void setLayerWeight ( int layer, float value ) #

Arguments

  • int layer
  • float value

const char * getLayerName ( int layer ) const#

Arguments

  • int layer

void setLayerName ( int layer, const char * value ) #

Arguments

  • int layer
  • const char * value

float getLayerMinVisibleDistance ( int layer ) const#

Arguments

  • int layer

void setLayerMinVisibleDistance ( int layer, float value ) #

Arguments

  • int layer
  • float value

float getLayerMaxVisibleDistance ( int layer ) const#

Arguments

  • int layer

void setLayerMaxVisibleDistance ( int layer, float value ) #

Arguments

  • int layer
  • float value

float getLayerMinFadeDistance ( int layer ) const#

Arguments

  • int layer

void setLayerMinFadeDistance ( int layer, float value ) #

Arguments

  • int layer
  • float value

float getLayerMaxFadeDistance ( int layer ) const#

Arguments

  • int layer

void setLayerMaxFadeDistance ( int layer, float value ) #

Arguments

  • int layer
  • float value
Last update: 2021-09-17
Build: ()