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
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
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

Unigine::PhysicalForce Class

Interface for physical force handling.

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

Unigine::PhysicalForce Class

Members


static int type ()

PhysicalForce type.

Return value

PhysicalForce type identifier.

static Ptr< PhysicalForce > create (const NodePtr & node)

PhysicalForce constructor.

Arguments

  • const NodePtr & node - Node smart pointer.

static Ptr< PhysicalForce > create (const PhysicalPtr & physical)

PhysicalForce constructor.

Arguments

  • const PhysicalPtr & physical - Physical smart pointer.

static Ptr< PhysicalForce > create (float radius)

PhysicalForce constructor.

Arguments

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

virtual void setRadius (float radius) const =0

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.

virtual float getRadius () const =0

Returns the current radius set for applying the physical force.

Return value

The radius in units.

virtual void setAttenuation (float attenuation) const =0

Updates the attenuation factor for the physical force.

Arguments

  • float attenuation - A new attenuation factor.

virtual float getAttenuation () const =0

Returns the current attenuation factor for the physical force.

Return value

The attenuation factor.

virtual void setAttractor (float attractor) const =0

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.

virtual float getAttractor () const =0

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.

virtual void setRotator (float rotator) const =0

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.

virtual float getRotator () const =0

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

Return value

The rotation force value.
Last update: 2017-07-03
Build: ()