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
材质和着色器
Rebuilding the Engine Tools
GUI
双精度坐标
应用程序接口
Animations-Related Classes
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
VR-Related Classes
创建内容
内容优化
材质
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Tutorials

Unigine.BodyRagdoll Class

Inherits from: Body

This class is used to simulate ragdoll bodies. This body automatically generates a ragdoll skeleton, i.e. collision shapes that are bound to the bones and joints that connect them.

See Also#

  • A set of UnigineScript API samples located in the <UnigineSDK>/data/samples/physics/ folder:
    • ragdoll_00
    • ragdoll_01
    • ragdoll_02
    • ragdoll_03
    • ragdoll_04
    • ragdoll_05
    • ragdoll_06
    • ragdoll_07
    • ragdoll_08
    • ragdoll_09
    • ragdoll_10
    • ragdoll_11

BodyRagdoll Class

Properties

int NumBones#

The number of bones in the ragdoll.

Node Bones#

The Exports a set of bones into a given node.

bool FrameBased#

The A value indicating if ragdoll bones move according to the animation written in the file.

float Rigidity#

The rigidity of bones movement, i.e. how much interpolated linear and angular velocities of all bones affect velocities of each separate bone.

float Mass#

The mass of the ragdoll.
Notice
If g (Earth's gravity) equals to 9.8 m/s 2, and 1 unit equals to 1 m, the mass is measured in kilograms.

Members


BodyRagdoll ( ) #

Constructor. Creates a ragdoll with default properties.

BodyRagdoll ( Object object ) #

Constructor. Creates a ragdoll with default properties for a given object.

Arguments

  • Object object - Object approximated with the new ragdoll.

void SetBoneFrameBased ( int bone, int based ) #

Sets a value indicating if bone transformations should be based on skinned animation data or conditioned by physics.

Arguments

  • int bone - Bone number.
  • int based - Positive value to set skinned animation-based transformations, 0 for ragdoll physical animation.

bool IsBoneFrameBased ( int bone ) #

Returns a value indicating if bone transformations are based on skinned animation data or conditioned by physics.

Arguments

  • int bone - Bone number.

Return value

Positive value if transformations are based on skinned animation, 0 if they are ragdoll physical animation.

string GetBoneName ( int bone ) #

Returns the name of a given bone.

Arguments

  • int bone - Bone number.

Return value

Bone name.

int GetBoneNumber ( int bone ) #

Checks whether the bone with the given number exists.

Arguments

  • int bone - The number of the bone.

Return value

Bone number.

void SetBones ( Node node ) #

Imports a set of bones from a given node.

Arguments

  • Node node - Node, from which the bones will be imported.

bool UpdateBones ( ) #

Updates transformations of all ragdoll bones.

Return value

true if transformations of all ragdoll bones were updated successfully; otherwise, false.

mat4 GetBoneTransform ( int bone ) #

Returns the transformation of animation bone for the current frame.

Arguments

  • int bone - Bone number.

Return value

Bone transformation matrix.

int CreateBones ( float error = 0.2, float threshold = 0.01, int capsule = 0 ) #

Automatically generates a simplified skeleton from the mesh and its bones. Each bone is approximated with a convex hull or a capsule based on given parameters.

Arguments

  • float error - Permissible error, which is used for creating convex hulls. This is an optional parameter.
  • float threshold - Threshold, which is used to detect and discard too small convex hulls. A convex hull, which volume is smaller than an average volume multiplied by the threshold, is discarded. This is an optional parameter.
  • int capsule - Approximation shape. By the value of 0, convex hull is used; the value of 1 sets capsule approximation.

Return value

Created bone number.

int FindBone ( string name ) #

Searches for a bone with a given name.

Arguments

  • string name - Name of the bone.

Return value

Number of the bone in the list of bones, if it is found; otherwise, -1.
Last update: 2024-04-19
Build: ()