This page has been translated automatically.
UnigineEditor
Interface Overview
Assets Workflow
Settings and Preferences
Working With Projects
Adjusting Node Parameters
Setting Up Materials
Setting Up Properties
Landscape Tool
Using Editor Tools for Specific Tasks
Extending Editor Functionality
Programming
Fundamentals
Setting Up Development Environment
Usage Examples
UnigineScript
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine 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
Objects-Related Classes
Networking Functionality
Pathfinding-Related Classes
Plugins-Related Classes
IG Plugin
CIGIConnector 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.BodyWater Class

Inherits: Body

This class is used to simulate water body that provide buoyancy and waves from other physical bodies. It is simulated as a 2D grid with point particles positioned in the vertices of the mesh.

See Also#

  • A set of UnigineScript API samples located in the <UnigineSDK>/data/samples/physics/ folder:
    • water_00
    • water_01
    • water_02
    • water_03
    • water_04

BodyWater Class

Properties

float Liquidity#

The current fluidity of the water.
set
Updates the viscosity of the water.
set value - Liquidity value. If a negative value is provided, 0 will be used instead.

int Intersection#

A value indicating if intersection with the ground is enabled. the ground should be a parent node.
set
Updates a value indicating if intersection with the ground is enabled. The ground should be a parent node.
set value - Positive value to enable intersection, 0 to disable it.

float InteractionForce#

The current interaction force that determines how much velocity values of water and objects that get into it are leveled.
set
Updates the interaction force that determines how much velocity values of water and objects that get into it are leveled.
set value - Interaction force value. If a negative value is provided, 0 will be used instead.

float LinearDamping#

The current value indicating how much the linear velocity of the objects decreases when they get into the water.
set
Updates a value indicating how much the linear velocity of the objects decreases when they get into the water.
set value - Linear damping value. If a negative value is provided, 0 will be used instead.

float AngularDamping#

The current value indicating how much the angular velocity of the objects decreases when they get into the water.
set
Updates a value indicating how much the angular velocity of the objects decreases when they get into the water.
set value - Anglular damping value. If a negative value is provided, 0 will be used instead.

float Distance#

The current distance of water simulation. it does not interfere with objects buoyancy.
set
Updates the distance of water simulation. It does not interfere with objects buoyancy.
set value - Simulation distance. If a negative value is provided, 0 will be used instead.

float Depth#

The current depth of the water (unless intersection has occurred).
set
Updates the depth of the water (unless intersection has occurred).
set value - Depth value. If a negative value is provided, 0 will be used instead.

float Density#

The current density of the water that determines objects buoyancy.
set
Updates the density of the water that determines objects buoyancy.
set value - Density value. If a negative value is provided, 0 will be used instead.

int Absorption#

A value indicating if the waves are dispersed along the mesh perimeter.
set
Updates a value indicating if the waves should be dispersed along the mesh perimeter.
set value - Positive number to allow wave dispersion, 0 for the waves to be reflected.

Members


static BodyWater ( ) #

Constructor. Creates a water body with default properties.

static BodyWater ( Object object ) #

Constructor. Creates a water body with default properties for a given object.

Arguments

  • Object object - Object with a new water body.

float GetParticleHeight ( vec3 position ) #

Returns the vertical shift of the given point of the water.

Arguments

  • vec3 position - Point local coordinates (only along X and Y axes).

Return value

Height in units of the vertical water shift.

vec3 GetParticleVelocity ( vec3 position ) #

Returns the velocity value in the given point of the water.

Arguments

  • vec3 position - Point local coordinates (only along X and Y axes).

Return value

Velocity value.

void AddParticleHeight ( vec3 position, float height ) #

Adds the vertical shift to the water. Nearby water particles, that form a plane water grid, will change their height accordingly, simulating rings on the water.

Arguments

  • vec3 position - Point local coordinates (only along X and Y axes) of the vertical shift.
  • float height - Height in units of the vertical water shift.

void AddParticleVelocity ( vec3 position, vec3 velocity ) #

Applies the force to the water. To nearby water particles, that form a plane water grid, will be passed appropriate velocity values, simulating wake from the moving object.

Arguments

  • vec3 position - Point local coordinates (only along X and Y axes) of applying the force.
  • vec3 velocity - Velocity value.
Last update: 2020-04-10
Build: ()