This page has been translated automatically.
UnigineScript
The Language
Core Library
Engine Library
Node-Related Classes
GUI-Related Classes
Plugins Library
High-Level Systems
Samples
C++ API
API Reference
Integration Samples
Usage Examples
C++ Plugins
Content Creation
Materials
Unigine Material Library
Tutorials
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.

PhysicalWater Class

A PhysicalWater class is used to simulate a force field affecting water objects.

PhysicalWater Class

This class inherits from Physical

Members


PhysicalWater (vec3 size)

Constructor. Creates physical water node of the specified size.

Arguments

  • vec3 size - Water box size in units.

float getAngularDamping ()

Returns the current value indicating how much the angular velocity of the objects decreases when they get into the physical water.

Return value

Angular damping value.

Body getContactBody (int num)

Returns the body of the object by the given contact with physical water.

Arguments

  • int num - Contact number.

Return value

Body of the object.

float getContactDepth (int num)

Returns the depth of the object submergence by the given contact.

Arguments

  • int num - Contact number.

Return value

Depth of object submergence in units.

vec3 getContactForce (int num)

Returns the force in the point of a given contact.

Arguments

  • int num - Contact number.

Return value

Force value.

vec3 getContactPoint (int num)

Returns the coordinates of the contact point.

Arguments

  • int num - Contact number.

Return value

Contact point coordinates.

vec3 getContactVelocity (int num)

Returns the relative velocity between the object and the physical water.

Arguments

  • int num - Contact number.

Return value

Relative velocity in units per second.

float getDensity ()

Returns the current density of the physical water that determines objects buoyancy.

Return value

Density value.

float getLinearDamping ()

Returns the current value indicating how much the linear velocity of the objects decreases when they get into the physical water.

Return value

Linear damping value.

int getNumContacts ()

Returns the number of contacts between the physical water and the objects.

Return value

Number of contacts.

vec3 getSize ()

Returns the current size of the physical water node.

Return value

Water box size.

vec3 getVelocity ()

Returns the current velocity of the flow in physical water.

Return value

Velocity in units per second.

void setAngularDamping (float damping)

Sets a value indicating how much the angular velocity of the objects decreases when they get into the physical water. The default is 1.

Arguments

  • float damping - Angular damping value. If a negative value is provided, 0 will be used instead.

void setDensity (float density)

Sets the density of the water that determines objects buoyancy. The default is 1.

Arguments

  • float density - Density value. If a negative value is provided, 0 will be used instead.

void setLinearDamping (float damping)

Sets a value indicating how much the linear velocity of the objects decreases when they get into the physical water. The default is 1.

Arguments

  • float damping - Linear damping value. If a negative value is provided, 0 will be used instead.

void setSize (vec3 size)

Sets the size of the physical water node. The default is (1,1,1).

Arguments

  • vec3 size - Water box size in units.

void setVelocity (vec3 velocity)

Sets velocity of the flow in physical water. The default is (0,0,0).

Arguments

  • vec3 velocity - Velocity in units per second.
Last update: 2017-07-03
Build: ()