UnigineScript
The Language
Core Library
Engine Library
Node-Related Classes
GUI-Related Classes
Plugins Library
High-Level Systems
Samples
Usage Examples
C++ API
API Reference
Integration Samples
Usage Examples
C++ Plugins
Migration
Migrating to UNIGINE 2.0
C++ API Migration
Migrating from UNIGINE 2.0 to UNIGINE 2.1

PhysicalNoise Class

A PhysicalNoise class is used to simulate a force field affecting physical bodies based on a volumetric noise texture. It creates an additional distribution flow specifying the force and the displacement direction for bodies at each point of the force field.

PhysicalNoise Class

This class inherits from Physical

Members


PhysicalNoise (vec3 size)

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

Arguments

  • vec3 size - Physical noise box size in units.

float getForce ()

Returns the value of the force multiplier that affects on the value of the resulting force that affects objects.

Return value

Force multiplier.

int getFrequency ()

Returns the number of octaves for the Perlin noise.

Return value

Number of octaves for the Perlin noise. The minimum value is 1, the maximum value is 16.

int getImageSize ()

Returns the size of the noise texture in pixels.

Return value

Size of the noise texture.

Image getImage ()

Returns the noise texture image.

Return value

The noise texture image.

vec3 getOffset ()

Returns the sampling offset that is used for pixel sampling from the noise texture.

Return value

Sampling offset along the axes.

float getScale ()

Returns the value of the noise texture scale.

Return value

Scale of the noise texture. The minimum value is 0, the maximum value is 1.

vec3 getSize ()

Returns the current size of the physical noise node.

Return value

Size of the physical noise box in units.

vec3 getStep ()

Returns the sampling step that is used for pixel sampling from the noise texture.

Return value

Size of the sampling step.

vec3 getThreshold ()

Returns the threshold distance set for the physical noise node. The threshold determines the distance of gradual change from zero to full force value. This values are relative to the size of the physical noise box. It means that the threshold values should be less than the size of the physical noise box.

Return value

Threshold distance along the axes.

void setForce (float force)

Sets the value of the force multiplier. The higher the value is, the higher the value of the resulting force that affects an object inside the physical noise node will be.

Arguments

  • float force - Force multiplier.

void setFrequency (int frequency)

Sets a number of octaves for the Perlin noise.

Arguments

  • int frequency - Number of octaves. The minimum value is 1, the maximum value is 16.

void setImageSize (int size)

Sets a size of the noise texture in units.

Arguments

  • int size - Size of the noise texture in units.

void setOffset (vec3 offset)

Sets a sampling offset that will be used for pixel sampling from the noise texture.

Arguments

  • vec3 offset - Sampling offset along the axes.

void setScale (float scale)

Sets a value of the noise texture scale.

Arguments

  • float scale - Scale of the noise texture. The minimum value is 0, the maximum value is 1.

void setSize (vec3 size)

Sets a size for the physical noise node.

Arguments

  • vec3 size - Physical noise box size in units.

void setStep (vec3 step)

Sets the step for the physical noise node.

Arguments

  • vec3 step - Sampling step.

void setThreshold (vec3 threshold)

Sets a threshold distance set for the physical noise node. The threshold determines the distance of gradual change from zero to full force value. This values are relative to the size of the physical noise box. It means that the threshold values should be less than the size of the physical noise box.

Arguments

  • vec3 threshold - Threshold distance along the axes.
Last update: 2017-07-03