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.

PhysicalForce Class

This class is used to simulate a point force that pulls physical object and particles up to or away from the point. It can also rotate them around.

PhysicalForce Class

This class inherits from Physical

Members


PhysicalForce (float radius)

Constructor. Creates a physical force node with specified radius in units.

float getAttenuation ()

Returns the current attenuation factor for the physical force.

Return value

Attenuation factor.

float getAttractor ()

Returns the current attraction force applied to objects in the physical force radius. Positive values pull objects away from the force point, negative values pull them up to it.

Return value

Attraction force value.

float getRadius ()

Returns the current radius set for applying the physical force.

Return value

Radius in units.

float getRotator ()

Returns the current rotation force that will be applied to objects in the physical force radius.

Return value

Rotation force value.

void setAttenuation (float attenuation)

Updates the attenuation factor for the physical force. The default is 1.0.

Arguments

  • float attenuation - Attenuation factor.

void setAttractor (float attractor)

Updates attraction force that will be applied to objects in the physical force radius.

Arguments

  • float attractor - Attraction force value. Positive values pull objects away from the force point, negative values pull them up to it.

void setRadius (float radius)

Updates the radius for applying the physical force. The default is 1.0.

Arguments

  • float radius - Radius in units. If a negative value is provided, 0 will be used instead.

void setRotator (float rotator)

Updates rotation force that will be applied to objects in the physical force radius.

Arguments

  • float rotator - Rotation force value. Positive values are for clockwise rotation, negative value - for counterclockwise one.
Last update: 2017-07-03
Build: ()