This page has been translated automatically.
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
Plugins-Related Classes
Rendering-Related Classes
Utility Classes
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

PhysicalWater Class

Interface for physical water handling. Physical water is used to simulate a force field affecting water objects.

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

PhysicalWater Class

Members


PhysicalWater (const Math::vec3 & size)

Constructor. Creates a physical water node of the specified size.

Arguments

  • const Math::vec3 & size - Water box size in units.

void setVelocity (const Math::vec3 & velocity)

Sets a velocity of the flow in physical water.

Arguments

  • const Math::vec3 & velocity - A velocity in units per second.

Math::Vec3 getContactPoint (int num)

Returns the coordinates of the contact point.

Arguments

  • int num - Contact number.

Return value

Contact point coordinates.

float getDensity ()

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

Return value

The density value.

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

The angular damping value.

void setSize (const Math::vec3 & size)

Sets a size of the physical water node.

Arguments

  • const Math::vec3 & size - A size of the water box in units. If a negative value is provided, 0 will be used instead.

void setAngularDamping (float damping)

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

Arguments

  • float damping - An angular damping 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.

Arguments

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

Math::vec3 getContactForce (int num)

Returns the force in the point of a given contact.

Arguments

  • int num - Contact number.

Return value

Force 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

The linear damping value.

Math::vec3 getSize ()

Returns the current size of the physical water node.

Return value

The size of the water box in units.

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.

Math::vec3 getVelocity ()

Returns the current velocity of the flow in physical water.

Return value

The velocity in units per second.

Ptr<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.

int getNumContacts ()

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

Return value

Number of contacts.

Math::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.

void setDensity (float density)

Sets a density of the water that determines objects buoyancy.

Arguments

  • float density - A density value. If a negative value is provided, 0 will be used instead.
Last update: 2017-07-03
Build: ()