This page has been translated automatically.
Programming
Fundamentals
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
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Networking Functionality
Pathfinding-Related Classes
Plugins-Related Classes
Rendering-Related Classes
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.

Unigine::PhysicalForce Class

Header:#include <UniginePhysicals.h>
Inherits:Physical

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

Notice
The physical force can affect only a cloth, aropeor arigidbody. If the rigid body is used, ashape should be also assigned.

See also

  • An article on Physical Force
  • A set of samples located in the data/samples/physicals folder:
    1. force_00
    2. force_01

PhysicalForce Class

Members


static PhysicalForcePtr create(float radius)

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

Arguments

  • float radius - The radius of the physical force node in units.

Ptr<PhysicalForce> cast(const Ptr<Node> & node)

Arguments

  • const Ptr<Node> & node

Ptr<PhysicalForce> cast(const Ptr<Physical> & base)

Arguments

  • const Ptr<Physical> & base

void setAttenuation(float attenuation)

Updates the attenuation factor for the physical force.

Arguments

  • float attenuation - A new attenuation factor.

float getAttenuation()

Returns the current attenuation factor for the physical force.

Return value

The attenuation factor.

void setAttractor(float attractor)

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

Arguments

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

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

The attraction force value.

void setRadius(float radius)

Updates the radius for applying the physical force.

Arguments

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

float getRadius()

Returns the current radius set for applying the physical force.

Return value

The radius in units.

void setRotator(float rotator)

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

Arguments

  • float rotator - A new rotation force value. Set a positive value for clockwise rotation or a negative value for counterclockwise one.

float getRotator()

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

Return value

The rotation force value.

int type()

Last update: 2017-07-03
Build: ()