This page has been translated automatically.
视频教程
界面
要领
高级
实用建议
专业(SIM)
UnigineEditor
界面概述
资源工作流程
设置和首选项
项目开发
调整节点参数
Setting Up Materials
设置属性
照明
Sandworm
使用编辑器工具执行特定任务
如何擴展編輯器功能
嵌入式节点类型
Nodes
Objects
Effects
Decals
光源
Geodetics
World Nodes
Sound Objects
Pathfinding Objects
Players
编程
基本原理
搭建开发环境
使用范例
C++
C#
UnigineScript
UUSL (Unified UNIGINE Shader Language)
Plugins
File Formats
Materials and Shaders
Rebuilding the Engine Tools
GUI
双精度坐标
应用程序接口
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Objects-Related Classes
Networking Functionality
Pathfinding-Related Classes
Plugins-Related Classes
IG Plugin
CIGIConnector Plugin
Rendering-Related Classes
创建内容
内容优化
Materials
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Tutorials
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

Unigine::PhysicalForce Class

Header: #include <UniginePhysicals.h>
Inherits from: 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, a rope or a rigid body. If the rigid body is used, a shape should be also assigned.

See also#

  • An article on Physical Force
  • A set of UnigineScript API samples located in the <UnigineSDK>/data/samples/physicals/ folder:
    • force_00
    • 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.

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.

static int type ( ) #

Returns the type of the node.

Return value

Physical type identifier.
Last update: 2022-12-14
Build: ()