# PhysicalWater Class

A PhysicalWater class is used to simulate water interaction effects.

Notice
The water will affect only objects, to which a cloth body or a rigid body are assigned. If the rigid body is used, a shape should be also assigned.

• An article on Physical Water
• A set of samples located in the data/samples/physicals folder:
1. water_00
2. water_01

## PhysicalWater Class

This class inherits from Physical

## PhysicalWater (vec3 size)

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

### Arguments

• vec3 size - Water box size in units.

## floatgetAngularDamping ()

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.

## BodygetContactBody (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.

## floatgetContactDepth (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.

## vec3getContactForce (int num)

Returns the force in the point of a given contact.

### Arguments

• int num - Contact number.

Force value.

## vec3getContactPoint (int num)

Returns the coordinates of the contact point.

### Arguments

• int num - Contact number.

### Return value

Contact point coordinates.

## vec3getContactVelocity (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.

## floatgetDensity ()

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

Density value.

## floatgetLinearDamping ()

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.

## intgetNumContacts ()

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

### Return value

Number of contacts.

## vec3getSize ()

Returns the current size of the physical water node.

Water box size.

## vec3getVelocity ()

Returns the current velocity of the flow in physical water.

### Return value

Velocity in units per second.

## voidsetAngularDamping (float damping)

Sets a value indicating how much the angular velocity of the objects decreases when they get into the physical water. The higher the value is, the lower the angular velocity will be.

### Arguments

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

## voidsetDensity (float density)

Sets the density of the water that determines buoyancy of objects that float in the physical water. The higher the value is, the higher buoyancy of the object.

### Arguments

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

## voidsetLinearDamping (float damping)

Sets a value indicating how much the linear velocity of the objects decreases when they get into the physical water. The higher the value is, the lower the linear velocity will be.

### Arguments

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

## voidsetSize (vec3 size)

Sets the size of the physical water node.

### Arguments

• vec3 size - Water box size in units.

## voidsetVelocity (vec3 velocity)

Sets velocity of the flow in physical water.

### Arguments

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