This page has been translated automatically.
视频教程
界面
要领
高级
实用建议
基础
专业(SIM)
UnigineEditor
界面概述
资源工作流程
Version Control
设置和首选项
项目开发
调整节点参数
Setting Up Materials
设置属性
照明
Sandworm
使用编辑器工具执行特定任务
如何擴展編輯器功能
嵌入式节点类型
Nodes
Objects
Effects
Decals
光源
Geodetics
World Nodes
Sound Objects
Pathfinding Objects
Players
编程
基本原理
搭建开发环境
使用范例
C++
C#
UnigineScript
统一的Unigine着色器语言 UUSL (Unified UNIGINE Shader Language)
Plugins
File Formats
材质和着色器
Rebuilding the Engine Tools
GUI
双精度坐标
应用程序接口(API)参考
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
Physics-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

关节 (Joints)

Joints provide constraints removing degrees of freedom from a body and are used to connect pairs of bodies. Each joint has an anchor point, which is by default placed between the centers of mass of connected bodies. The properties of each connection depend on the selected joint type and its parameters. Joint parameters can be divided into two groups:关节提供了限制,从而消除了物体(body)的自由度,并用于连接成对的body。每个关节都有一个锚点,默认情况下,该锚点位于连接实体的质心之间。每个连接的属性取决于所选的关节类型及其参数。联合参数可以分为两组:

  • Common parameters — basic set of parameters shared by all joints. 通用参数 -所有关节共享的基本参数集。
  • Type-specific parameters — a set of specific parameters for each joint type. 类型特定的参数-每种关节类型的一组特定参数。

See also
也可以看看#

Programming implementation:编程实现:

Usage examples:用法示例:

Fragment of video tutorial on physics about joints关于关节的物理视频教程的片段

Adding a Joint
添加关节#

Assume you have two objects with physical bodies assigned. Remember that a body must have a shape assigned. To connect them using a joint via UnigineEditor, perform the following steps:假设您有两个分配了物理物体的对象。请记住,物体必须具有指定的形状。要通过 UnigineEditor 使用关节来连接它们,请执行以下步骤:

  1. Open the World Hierarchy window. 打開 World Hierarchy 窗口。
  2. Select the first body to connect.选择第一个要连接的物体
  3. Go to the Physics tab in the Parameters window.转到 Parameters窗口中的Physics選項卡。
  4. In the Joints section, click and choose an appropriate type of joint.Joints部分中,单击,然后选择适当的关节类型。

    添加关节

  5. Select the second body by picking its name in the dialog window and click OK.
    Selecting a body
    在对话框窗口中选择第二个物体的名称,然后单击OK
    Selecting a body
  6. Set joint parameters in the Joints section.Joints部分中设置关节参数。

You can enable visualization of the joint by checking Helpers panel → Physics item → Joints option (Visualizer should be enabled).您可以通过选中Helpers面板→Physics项目→Joints选项(应启用Visualizer)来启用关节的可视化。

Common Joint Parameters
通用关节参数#

Common Joint Parameters通用关节参数

All joints regardless of their type have a set of common parameters:所有关节,无论其类型如何,都有一族通用的参数:

Type Type of the joint. It can be changed after creation, while the name will remain unchanged.关节的类型。创建后可以更改,而名称将保持不变。
Collision A flag indicating if collision detection between the connected bodies is enabled.一个标志,指示是否在连接的物体之间启用碰撞检测
Iterations Joints, like collisions, are calculated iteratively. This parameter specifies the number of iterations used to solve joints. Note that if this value is too low, the precision of calculations will suffer.关节像碰撞一样被迭代计算。此参数指定用于求解关节的迭代次数。请注意,如果此值太低,则会影响计算的精度。
Max Force Maximum force that can be exerted on the joint. If this limit is exceeded, the joint breaks. The default value is inf, i.e. the joint is unbreakable.可以在关节上施加的最大力。如果超过此限制,则关节会断裂。默认值为 inf ,即关节是不可破坏的。
Max Torque Maximum torque that can be exerted on the joint. If this limit is exceeded, the joint breaks. The default value is inf, i.e. the joint is unbreakable.可以施加在关节上的最大扭矩。如果超过此限制,则关节会断裂。默认值为 inf ,即关节是不可破坏的。
Linear Restitution

Linear stiffness of the joint. Defines how fast it compensates for linear coordinate change between two bodies. When bodies are dragged apart, restitution controls the magnitude of force which is applied to both bodies so that their anchor points to become aligned again.关节的线性刚度。定义补偿两个物体之间线性坐标变化的速度。将物体拉开时,恢复力控制施加在两个物体上的力的大小,以使它们的锚点再次对齐。

  • 1 means that the joint is to return bodies in place throughout 1 physics tick. 1 表示关节将在整个1个物理滴答中返回到位。
  • 0.2 means that the joint is to return bodies in place throughout 5 physics ticks. 0.2 表示关节将在整个5个物理滴答中将物体返回到位。
注意
The maximum value of 1 can lead to destabilization of physics (as too great forces are applied). 1 的最大值可能导致物理不稳定(因为施加的力过大)。
Angular Restitution

Angular stiffness of the joint. Defines how fast it compensates for change of the angle between two bodies. When bodies are turned relative each other, restitution controls the magnitude of force which is applied to both bodies so that their anchor points to become aligned again.关节的角刚度。定义补偿两个物体之间角度变化的速度。当物体彼此相对旋转时,恢复力控制施加到两个物体的力的大小,以使它们的锚点再次对齐。

  • 1 means that the joint is to return bodies in place throughout 1 physics tick. 1 表示关节将在整个1个物理滴答中返回到位。
  • 0.2 means that the joint is to return bodies in place throughout 5 physics ticks. 0.2 表示关节将在整个5个物理滴答中将物体返回到位。
注意
The maximum value of 1 can lead to destabilization of physics (as too great forces are applied). 1 的最大值可能导致物理不稳定(因为施加的力过大)。
Linear Softness

Linear elasticity of the joint. Defines whether linear velocities of the bodies are averaged out when the joint is stretched.关节的线弹性。定义在拉伸关节时是否将实体的线速度平均化。

  • 0 means that the joint is rigid. Velocities of the first and the second body are independent. 0 表示关节是刚性的。第一和第二物体的速度是独立的。
  • 1 means that the joint is elastic (jelly-like). If the first body changes its velocity, velocity of the second body is equalized with it. 1 表示关节具有弹性(果冻状)。如果第一个物体的速度发生变化,则第二个物体的速度将与其相等。
Angular Softness

Angular elasticity of the joint. Defines whether linear velocities of the bodies are averaged out when the joint is twisted.关节的角度弹性。定义在扭曲关节时是否将实体的线速度平均化。

  • 0 means that the joint is rigid. Velocities of the first and the second body are independent. 0 表示关节是刚性的。第一和第二物体的速度是独立的。
  • 1 means that the joint is elastic (jelly-like). If the first body changes its velocity, velocity of the second body is equalized with it. 1 表示关节具有弹性(果冻状)。如果第一个物体的速度发生变化,则第二个物体的速度将与其相等。
Anchor 0 Node Node of the first body connected to the joint. This is the current node and it cannot be changed.连接到关节的第一个物体的节点。这是当前节点,无法更改。
Anchor 0 Position Position of the anchor point of the first connected body in the body coordinate space.第一个连接物体的锚点在其局部坐标系中的位置。
Anchor 1 Node Node of the second body connected to the joint. It can be changed by dragging the node that is an object having a physical body from the World Nodes hierarchy.连接到关节的第二个物体的节点。可以通过从世界节点层次结构中拖动具有物理体的节点来更改此节点。
Anchor 1 Position Position of the anchor point of the second connected body in the body coordinate space.第二个连接物体的锚点在其局部坐标系中的位置。
Fix 0 Changes the position of Anchor 0 to match the position of Anchor 1.将 Anchor 0 的位置调整为与 Anchor 1 的位置匹配。
Fix 1 Changes the position of Anchor 1 to match the position of Anchor 0.将 Anchor 1 的位置调整为与 Anchor 0 的位置匹配。
Fix 01 Shifts both anchors to the middle of the line between them.将两个锚点移动到它们之间连线的中点位置。

To organize the joints, the following options are available:为了组织关节,提供了以下选项:

Adds a new joint.添加新关节。
A pair of buttons to move the joint up or down in the list.一对按钮,用于在列表中向上或向下移动关节。
Deletes the selected joint(s).删除所选关节。

To disable a joint, uncheck the checkbox:要禁用某个关节,请取消选中复选框:

Fixed Joint
Fixed Joint#

Fixed joints connect two bodies in a manner that strictly preserves their positions with respect to each other.固定关节以严格保持彼此位置的方式连接两个物体。

Fixed joint
Fixed Joint

In addition to the common parameters, fixed joints also have the following constraint parameters:除了通用参数外,固定关节还具有以下约束参数:

Fixed Joint Parameters

Fixed Joint ParametersFixed Joint的参数
Anchor 0 Rotation Orientation of the first body relative to the anchor point.第一个实体相对于锚点的方向。
Anchor 1 Rotation Orientation of the second body relative to the anchor point.第二个实体相对于锚点的方向。

For more information refer to JointFixed Class description. An example illustrating connection of two bodies using a fixed joint can be found here.有关更多信息,请参见JointFixed类描述。 此处

Watch the illustration of the Fixed joint in our video tutorial on physics.在我们的物理视频教程中观看固定关节的插图。

Hinge Joint
Hinge Joint#

Hinge joints allow the connected bodies to rotate along the joint's axis at the anchor point. This joint has an angular motor attached.铰链关节允许连接的实体在锚点处沿关节的轴旋转。该关节连接了一个有角度的 motor

Hinge joint Hinge joint
Hinge Joint

In addition to the common parameters, hinge joints also have the following constraint parameters:除了通用参数外,铰链关节还具有以下约束参数:

Hinge Joint Parameters Hinge Joint参数

Anchor 0 Axis Axis of the first connected body represented by a normalized vector.第一个连接物体的轴,由归一化向量表示。
Anchor 1 Axis Axis of the second connected body represented by a normalized vector.第二个连接物体的轴,由归一化向量表示。
Damping Angular damping coefficient of the hinge joint.铰链接头的角阻尼系数。
From Minimum angle in the range of movement at which the hinge stops. The angle is specified in degrees in the [-180; 180] range.铰链停止运动范围内的最小角度。角度在[ -180 中以度为单位指定; 180 ]范围。
To Maximum angle in the range of movement at which the hinge stops. The angle is specified in degrees in the [-180; 180] range.铰链停止运动范围内的最大角度。角度在[ -180 中以度为单位指定; 180 ]范围。
Velocity Target velocity of the attached angular motor.附加角电机的目标速度。
Torque Maximum torque of the angular motor. 0 detaches the motor.角度电机的最大扭矩。 0 拆下电动机。
Angle Target angle of the attached angular spring. The spring (if it is enabled) tries to keep the specified angle between the connected bodies.附加角弹簧的目标角度。弹簧(如果已启用)将尝试使连接的物体之间保持指定的角度。
Spring Spring rigidity coefficient, determines how strong the joint resists rotation. If rigidity is set to 0, the spring is disabled.弹簧刚度系数确定关节抵抗旋转的强度。如果将刚度设置为 0 ,则会禁用弹簧。

For more information refer to JointHinge Class description. An example illustrating connection of two bodies using a hinge joint can be found here.有关更多信息,请参见JointHinge类描述。可以在此处找到使用铰链接头连接两个物体的示例。

Watch the illustration of the Hinge joint settings in our video tutorial on physics.在我们的物理视频教程中观看铰链关节设置的图示。

Ball Joint
Ball Joint#

Ball joints provide a point around which the connected objects can rotate.球形接头提供了一个连接对象可以围绕其旋转的点。

Ball joint Ball joint
Ball Joint

In addition to the common parameters, ball joints also have the following constraint parameters:除了通用参数外,球形接头还具有以下约束参数:

Ball Joint Parameters Ball Joint参数

Anchor 0 Axis Axis of the first connected body represented by a normalized vector.第一个连接物体的轴,由归一化向量表示。
Anchor 1 Axis Axis of the second connected body represented by a normalized vector.第二个连接物体的轴,由归一化向量表示。
Damping Angular damping coefficient of the ball joint.球形接头的角阻尼系数。
Angle Swing angle limit, specifies how much connected bodies can bend from the joint axis.摆动角度限制,指定连接的物体可以从关节轴弯曲多少。
From Minimum angle in the range of twisting around the joint axis. The angle is specified in degrees in the [-180; 180] range.围绕关节轴扭转范围内的最小角度。角度在[ -180 中以度为单位指定; 180 ]范围。
To Maximum angle in the range of twisting around the joint axis. The angle is specified in degrees in the [-180; 180] range.在围绕关节轴的扭曲范围内的最大角度。角度在[ -180 中以度为单位指定; 180 ]范围。

For more information refer to JointBall Class description. An example illustrating connection of two bodies using a ball joint can be found here.有关更多信息,请参考 JointBall类描述。可以在此处找到使用球形接头连接两个物体的示例。

Watch the illustration of the Ball joint settings in our video tutorial on physics.在我们的物理视频教程中观看球形关节设置的图示。

Prismatic Joint
Prismatic Joint#

Prismatic joints allow movement along the joint axis. This joint has a linear motor attached.棱形关节允许沿关节轴移动。该关节具有连接的线性 motor

Prismatic joint Prismatic joint
Prismatic Joint

In addition to the common parameters, prismatic joints also have the following constraint parameters:除了通用参数外,棱形关节还具有以下约束参数:

Prismatic Joint Parameters Prismatic Joint参数

Anchor 0 Axis Axis of the first connected body represented by a normalized vector.第一个连接物体的轴,由归一化向量表示。
Anchor 0 Rotation Orientation of the first body relative to the anchor point.第一个实体相对于锚点的方向。
Anchor 1 Rotation Orientation of the second body relative to the anchor point.第二个实体相对于锚点的方向
Damping Linear damping coefficient of the prismatic joint.棱柱形接头的线性阻尼系数。
From Minimum distance between the bodies along the joint axis.物体之间沿关节轴的最小距离。
To Maximum distance between the bodies along the joint axis.物体之间沿关节轴的最大距离。
Velocity Target velocity of the attached linear motor.附加直线电机的目标速度。
Force Maximum force of the attached linear motor. 0 detaches the motor.连接的直线电动机的最大力。 0 拆下电动机。
Distance Target linear distance of the attached spring. The spring (if it is enabled) tries to keep the specified distance between the connected bodies.所连接弹簧的目标线性距离。弹簧(如果启用)会尝试保持连接的实体之间的指定距离。
Spring Spring rigidity coefficient, determines how strong the joint resists linear motion. If rigidity is set to 0, the spring is disabled.弹簧刚度系数,确定接头抵抗线性运动的强度。如果将刚度设置为 0 ,则会禁用弹簧。

For more information refer to JointPrismatic Class description. An example illustrating connection of two bodies using a prismatic joint can be found here.有关更多信息,请参见JointPrismatic类描述。可以在此处找到使用棱镜连接两个物体的示例。

Watch the illustration of the Prismatic joint in our video tutorial on physics.在我们的物理学视频教程中观看棱柱关节的图示。

Cylindrical Joint
Cylindrical Joint#

Cylindrical joints are like prismatic ones with an additional degree of freedom: rotation around the joint axis. This joint has a linear and an angular motors attached.圆柱关节就像棱柱形关节一样,具有额外的自由度:绕关节轴旋转。该关节具有线性和成角度的电动机

Cylindrical joint Cylindrical joint
Cylindrical Joint

In addition to the common parameters, cylindrical joints also have the following constraint parameters:除了通用参数外,圆柱关节还具有以下约束参数:

Cylindrical Joint Parameters Cylindrical Joint参数

Anchor 0 Axis Axis of the first connected body represented by a normalized vector.第一个连接物体的轴,由归一化向量表示。
Anchor 1 Axis Axis of the second connected body represented by a normalized vector.第二个连接物体的轴,由归一化向量表示。
Linear Damping Linear damping coefficient of the cylindrical joint.圆柱接头的线性阻尼系数。
Linear From The minimum distance between the bodies along the joint axis.物体之间沿关节轴的最小距离。
Linear To The maximum distance between the bodies along the joint axis.物体之间沿关节轴的最大距离。
Linear Velocity Target velocity of the attached linear motor.附加直线电机的目标速度。
Linear Force Maximum force of the attached linear motor. 0 detaches the motor.连接的直线电动机的最大力。 0 拆下电动机。
Linear Distance A target linear distance of the attached spring. The spring (if it is enabled) tries to keep the specified distance between the connected bodies.所连接弹簧的目标线性距离。弹簧(如果启用)会尝试保持连接的实体之间的指定距离。
Linear Spring Spring rigidity coefficient, determines how strong the joint resists linear motion. If rigidity is set to 0, the spring is disabled.弹簧刚度系数,确定接头抵抗线性运动的强度。如果将刚度设置为 0 ,则会禁用弹簧。
Angular Damping Angular damping coefficient of the cylindrical joint.圆柱接头的角阻尼系数。
Angular From The minimum angle in the range of twisting around the joint axis. The angle is specified in degrees in the [-180; 180] range.围绕关节轴扭转范围内的最小角度。角度在[ -180 中以度为单位指定; 180 ]范围。
Angular To The maximum angle in the range of twisting around the joint axis. The angle is specified in degrees in the [-180; 180] range.在围绕关节轴的扭曲范围内的最大角度。角度在[ -180 中以度为单位指定; 180 ]范围。
Angular Velocity Target velocity of the attached angular motor.附加角电机的目标速度。
Angular Torque Maximum torque of the angular motor. 0 detaches the motor.角度电机的最大扭矩。 0 拆下电动机。
Angular Angle A target angle of the attached angular spring. The spring (if it is enabled) tries to keep the specified angle between the connected bodies.所连接的角弹簧的目标角度。弹簧(如果已启用)将尝试使连接的物体之间保持指定的角度。
Angular Spring Spring rigidity coefficient, determines how strong the joint resists rotation. If rigidity is set to 0, the spring is disabled.弹簧刚度系数确定关节抵抗旋转的强度。如果将刚度设置为 0 ,则会禁用弹簧。

For more information refer to JointCylindrical Class description. An example illustrating connection of two bodies using a cylindrical joint can be found here.有关更多信息,请参见JointCylindrical类描述。 此处

Watch the illustration of the Cylindrical joint in our video tutorial on physics.在我们的物理视频教程中观看圆柱关节的插图。

Wheel Joint
Wheel Joint#

Wheel joints are used to create ray-cast vehicle wheels. It connects two rigid bodies: the first body is a frame, the second one is a wheel. There is no need to assign a shape to the wheel: ray casting is used to detect collision of the wheel with a surface. This joint has an angular motor attached.车轮关节用于制造射线铸型的车轮。它连接两个刚性实体:第一个实体是框架,第二个实体是轮子。无需为车轮指定形状:射线投射用于检测车轮与表面的碰撞。该关节连接了一个有角度的 motor

注意

The order of the bodies connected using a wheel joint, matters!使用车轮关节连接物体的顺序很重要

  • If the bodies are connected using UnigineEditor:如果物体使用 UnigineEditor 连接:

    1. Select the vehicle frame.选择车架。
    2. Add a wheel joint.添加车轮关节。
    3. Specify the wheel to be attached.指定要安装的轮子。
  • If the bodies are connected via code:如果物体以编程方式连接:

    • b0 is a frame. b0是一个车架。
    • b1 is a wheel. b1 是一个车轮.
Wheel joint Wheel joint
Wheel Joint

In addition to the common parameters, wheel joints also have the following constraint parameters:除了通用参数外,车轮关节还具有以下约束参数:

Wheel Joint Parameters Wheel Joint参数

Anchor 00 Axis Coordinates of a vertical axis (suspension axis) that acts like a cylindrical joint providing steering and damping.垂直轴(悬架轴)的坐标,其作用类似于提供转向和阻尼的圆柱关节。
Anchor 10 Axis Coordinates of a horizontal axis around which the wheel rotates, in the coordinate system of the frame (which is body 0).在车架(即body 0)的坐标系中,车轮旋转的水平轴坐标。
Anchor 11 Axis Coordinates of a horizontal axis around which the wheel rotates, in the coordinate system of the wheel (which is body 1).在车轮(即body 1)的坐标系中,车轮旋转的水平轴坐标。
Linear Damping Linear damping coefficient of the suspension.悬架的线性阻尼系数。
Linear From Lower suspension ride limit.悬架行驶下限。
Linear To Upper suspension ride limit.悬架行驶上限。
Linear Distance Target suspension height. The suspension spring (if it is enabled) tries to keep the specified height.目标悬架高度。悬架弹簧(如果启用)会尝试保持指定的高度。
Linear Spring Suspension spring rigidity coefficient, determines how strong the joint resists vertical linear motion. If rigidity is set to 0, the spring is disabled.悬架弹簧刚度系数确定关节抵抗垂直线性运动的强度。如果将刚度设置为0,则会禁用弹簧。
Angular Damping Angular damping coefficient of wheel rotation.车轮旋转的角阻尼系数。
Angular Velocity Target velocity of the attached angular motor.附加角电机的目标速度。
Angular Torque Maximum torque of the angular motor. 0 detaches the motor.角度电机的最大扭矩。 0拆下电动机。
Tangent Angle Coefficient specifying how fast the optimal longitudinal force can be achieved. The larger this value, the more is the impulse produced by the tire.指定最佳纵向力可实现速度的系数。该值越大,轮胎产生的冲量越大。
Tangent Friction Longitudinal (forward) friction of the tire.轮胎的纵向(前进方向)摩擦力。
Binormal Angle Coefficient specifying how fast the optimal lateral force can be achieved. The larger this value, the more is the impulse produced by the tire.指定最佳侧向力可实现速度的系数。该值越大,轮胎产生的冲量越大。
Binormal Friction Lateral (sideways) friction of the tire.轮胎的侧向(横向)摩擦力。
Wheel Mass Mass of the attached wheel.附加车轮的质量。
Wheel Threshold Threshold difference between the wheel and ground velocities. When it is too small, the longitudinal force is scaled down to prevent unnatural vibrations.车轮与地面速度之间的阈值差。当该值过小时,纵向力会被按比例减小,以防止不自然的振动。
Wheel Radius Radius of the attached wheel.附加车轮的半径。

For more information refer to JointWheel Class description. For an example illustrating the use of wheel joints see the Creating a Car with Wheel Joints article.有关更多信息,请参见JointWheel类描述。有关说明使用车轮节的示例,请参见使用车轮节创建汽车文章。

Watch how to simulate a wheel using the Wheel joint in our video tutorial on physics.在我们的物理视频教程中,观看如何使用Wheel关节模拟车轮。

Suspension Joint
Suspension Joint#

警告
This joint type is deprecated and will be removed in the upcoming releases. It is recommended to use the Wheel Joint instead.此联合类型已被弃用,并将在以后的版本中删除。建议改用车轮接头

Suspension joints are used to create wheel suspension for vehicles. It connects two rigid bodies: the first body is a frame, the second one is a wheel. This joint has an angular motor attached.悬挂关节用于制造车辆的车轮悬架。它连接两个刚性实体:第一个实体是框架,第二个实体是轮子。该关节连接了一个有角度的 motor

注意

The order of the bodies connected using a suspension joint, matters!使用粒子关节连接物体的顺序很重要

  • If the bodies are connected using UnigineEditor:如果物体使用 UnigineEditor 连接:

    1. Select the vehicle frame.选择车架。
    2. Add a suspension joint.添加悬架接头。
    3. Specify the wheel to be attached.指定要安装的轮子。
  • If the bodies are connected via code:如果物体以编程方式连接:

    • b0 is a frame. b0是一个车架。
    • b1 is a wheel. b1 是一个车轮.
Suspension joint Suspension joint
Suspension Joint

In addition to the common parameters, suspension joints also have the following constraint parameters:除了通用参数外,悬挂关节还具有以下约束参数:

Suspension Joint Parameters Suspension Joint参数

Anchor 00 Axis Coordinates of a vertical axis (suspension axis) that acts like a cylindrical joint providing steering and damping.垂直轴(悬架轴)的坐标,其作用类似于提供转向和阻尼的圆柱关节。
Anchor 10 Axis Coordinates of a horizontal axis around which the wheel rotates, in the coordinate system of the frame (which is body 0).在车架(即body 0)的坐标系中,车轮旋转的水平轴坐标。
Anchor 11 Axis Coordinates of a horizontal axis around which the wheel rotates, in the coordinate system of the wheel (which is body 1).在车轮(即body 1)的坐标系中,车轮旋转的水平轴坐标。
Linear Damping Linear damping coefficient of the suspension.悬架的线性阻尼系数。
Linear From Lower suspension ride limit.悬架行驶下限。
Linear To Upper suspension ride limit.悬架行驶上限。
Linear Distance Target suspension height. The suspension spring (if it is enabled) tries to keep the specified height.目标悬架高度。悬架弹簧(如果启用)会尝试保持指定的高度。
Linear Spring Suspension spring rigidity coefficient, determines how strong the joint resists vertical linear motion. If rigidity is set to 0, the spring is disabled.悬架弹簧刚度系数确定关节抵抗垂直线性运动的强度。如果将刚度设置为 0 ,则会禁用弹簧。
Angular Damping Angular damping coefficient of wheel rotation.车轮旋转的角阻尼系数。
Angular Velocity Target velocity of the attached angular motor.附加角电机的目标速度。
Angular Torque Maximum torque of the angular motor. 0 detaches the motor.角度电机的最大扭矩。 0 拆下电动机。

For more information refer to JointSuspension Class description. An example illustrating connection of two bodies using a suspension joint can be found here.有关更多信息,请参见JointSuspension类描述。可以在此处找到使用悬架关节连接两个物体的示例。

For the difference between the Suspension and Wheel joints, see our video tutorial on physics.有关悬架和车轮关节之间的区别,请参见我们的有关物理的视频教程

Path Joint
Path Joint#

Path joint is used to attach a rigid body to a path body and to make it move along this path. This joint can be used to make a train move along the tracks. This joint has a linear motor attached.路径关节用于将刚体附加到路径体,并使其沿该路径移动。该接头可用于使火车沿着轨道移动。该关节具有连接的线性 motor

注意

Assign a shape to a rigid body before connecting it to a path body!
The order of the bodies connected using a path joint, matters!
形状分配给刚体,然后再将其连接到路径体!
使用路径关节连接物体的顺序很重要

  • If the bodies are connected using UnigineEditor:
    1. Select a rigid body.Select a rigid body.
    2. Add a path joint.Add a path joint.
    3. Specify the path body.Specify the path body.
    Select a rigid body.Add a path joint.Specify the path body.
    如果物体使用 UnigineEditor 连接:
    1. Select a rigid body.选择刚体。
    2. Add a path joint.添加路径关节。
    3. Specify the path body.指定路径物体。
  • If the bodies are connected via code:
    • b0 is a BodyRigid.b0 is a BodyRigid.
    • b1 is a BodyPath.b1 is a BodyPath.
    b0 is a BodyRigid.b1 is a BodyPath.
    如果物体以编程方式连接:
    • b0 is a BodyRigid. b0 是一个 BodyRigid
    • b1 is a BodyPath. b1 是一个 BodyPath
Path joint
Path Joint

In addition to the common parameters, path joints also have the following constraint parameters:除了通用参数外,路径关节还具有以下约束参数:

Path Joint Parameters Path Joint参数

Anchor 0 Rotation Orientation of the body relative to the path.指定物体相对于路径的方向。
Damping Linear damping coefficient of the path joint.路径关节的线性阻尼系数。
Velocity Target velocity of the attached linear motor.附加直线电机的目标速度。
Force Maximum force of the attached linear motor. 0 detaches the motor.连接的直线电动机的最大力。 0 拆下电动机。

For more information refer to JointPath Class description. An example illustrating connection of two bodies using a path joint can be found here.有关更多信息,请参见JointPath类描述。可以在此处找到使用路径关节连接两个物体的示例。

Our video tutorial on physics shows how to attach a rigid body to a path body using the Path joint.我们的物理视频教程显示了如何使用“路径”关节将刚体连接到路径体。

Particles Joint
Particles Joint#

Particles joint is used to pin cloth body or rope body to a rigid body, ragdoll body or a dummy body.粒子关节用于将衣服物体绳索物体固定到刚性物体布娃娃物体虚拟物体

注意

The order of the bodies connected using a particles joint, matters!使用粒子关节连接物体的顺序很重要

  • If the bodies are connected using UnigineEditor:如果物体使用 UnigineEditor 连接:

    1. Select a rigid body, a ragdoll body or a dummy body.选择刚体,布娃娃体或虚拟体。
    2. Add a particles joint.添加粒子关节。
    3. Specify a cloth body or a rope body.指定布料物体或绳索物体。
  • If the bodies are connected via code:如果物体以编程方式连接:

    • b0 is a BodyRigid / BodyRagdoll / BodyDummy. b0 是一個 BodyRigid / BodyRagdoll / BodyDummy
    • b1 is a BodyCloth / BodyRope. b1 是一個 BodyCloth / BodyRope
Particles joint
Particles Joint

In addition to the common parameters, particles joints also have the following constraint parameters:除了通用参数外,粒子关节还具有以下约束参数:

Particles Joint Parameters Particles Joint参数

Size Size of the area for pinning vertices of cloth or rope body to another body.指定将布料或绳索物体的顶点固定到另一个物体的区域。
Threshold Distance for pinning vertices of cloth or rope body to another body. If vertices are closer than the threshold, they are pinned together; otherwise, particles stay loose.确定将布料或绳索物体的顶点固定到另一个物体的距离。如果顶点之间的距离小于阈值,它们将被固定在一起;否则,粒子将保持松散状态。

For more information refer to JointParticles Class description. An example illustrating attachment of a cloth body using a particles joint can be found here.有关更多信息,请参见JointParticles类描述。可以在此处找到一个示例,该示例说明了使用粒子关节连接衣服物体

An example illustrating the use of rope body and particles joint can be found here.可以在此处找到使用绳体和粒子关节的示例。

Our video tutorial on physics shows how to attach a rope or a cloth to other bodies using the Particles joint.我们的物理视频教程展示了如何使用“粒子”关节将绳索或布料连接到其他物体。

Motors and Springs
马达和弹簧#

Joints can have motors and springs associated with them.关节可以具有与之关联的电动机和弹簧。

Springs try to keep the bodies connected with a joint at some specific distance (linear) or angle (angular). The behavior of a particular spring depends on its rigidity and damping coefficient. 弹簧尝试使物体与关节保持一定的距离(线性)或角度(角度)。特定弹簧的性能取决于其刚度和阻尼系数。

Motors provide movement or rotation of bodies connected with a joint relative to each other by applying a torque (or force) to a joint's degree of freedom. There are linear and angular motors that exert a limited force to a joint, pushing or rotating connected objects. 电动机通过向关节的自由度施加扭矩(或力),使与关节连接的物体彼此相对运动或旋转。有 linear angular 个电动机会向关节施加有限的力,推动或旋转连接的物体。

Springs and Motors

Motors have two parameters:电动机具有两个参数:

  • Target velocity
  • Maximum force (or torque) that is available to reach that velocity.达到该速度的最大力(或扭矩)。

This is a very simple model of real life motors. However, is it quite useful when modeling a motor, that is geared down with a gearbox before being connected to the joint. Such devices are often controlled by setting a target velocity, and can only generate a maximum amount of power to achieve that speed (which corresponds to a certain amount of force available at the joint).这是现实生活中的电机非常简单的模型。但是,在建模电动机时非常有用,该电动机在连接到关节之前先用齿轮箱减速。此类设备通常是通过设置目标速度来控制的,并且只能产生最大功率以达到该速度(这对应于关节处可用的一定量的力)。

To activate an angular motor perform the following steps:启动角度电动机,请执行以下步骤:

  1. Set angular velocity — target angular velocity of the motor, This value determines how fast the motor can rotate.设置angular velocity-电动机的目标角速度,该值确定电动机可以旋转的速度。

    • positive value — the motor rotates counterclockwise. 正值-电动机逆时针旋转。
    • negative value — the motor rotates clockwise. 负值-电动机顺时针旋转。
  2. Set angular torque — maximum torque applied by the motor to reach target velocity. This value determines how fast the motor reaches maximum velocity.设置angular torque-电机达到目标速度所施加的最大转矩。该值确定电动机达到最大速度的速度。

    • 0 disables the motor. 0 禁用电动机。
    • If a negative value is provided, 0 will be used instead.如果提供负值,则将使用 0

To activate a linear motor perform the following steps:启动线性电动机,请执行以下步骤:

  1. Set linear velocity — target linear velocity of the motor, This value determines how fast the motor can push.设置linear velocity-电动机的目标线速度,该值确定电动机可以推动多快。

    • positive value — the motor pushes forward. 正值-电动机向前推动。
    • negative value — the motor pulls backward. 负值-电动机向后拉动。
  2. Set linear force — maximum force applied by the motor to reach target velocity. This value determines how fast the motor reaches maximum velocity.设置linear force-电机达到目标速度所施加的最大力。该值确定电动机达到最大速度的速度。

    • 0 disables the motor. 0 禁用电动机。
    • If a negative value is provided, 0 will be used instead.如果提供负值,则将使用 0

Vehicles
汽车#

Vehicles are important in real-time games, therefore, they are to be described separately. There are two approaches to simulation of moving vehicles. Each approach has a corresponding joint type to connect wheels to vehicle body.车辆在实时游戏中很重要,因此,将分别对其进行描述。有两种模拟移动车辆的方法。每种方法都有对应的关节类型,用于将车轮连接至车身。

  • The first approach uses a suspension joint and assumes that wheels are represented as physical bodies with shapes. As each wheel has a collider shape, collisions with objects on the ground are handled correctly. For example, such car runs on a curb smoothly. This approach requires more calculations and is to be used when more accurate simulation is needed especially for step-like ground surface and wheels have a complex shape. 第一种方法使用suspension joint并假定将车轮表示为具有形状的物理物体。由于每个车轮都具有对撞机形状,因此可以正确处理与地面上的物体的碰撞。例如,这种汽车在路缘上平稳行驶。这种方法需要进行更多的计算,并且在需要更精确的仿真时尤其是对于阶状地面和形状复杂的车轮时应使用。
  • The second approach uses a wheel joint and assumes that the wheels are virtual. Wheels do not collide with the surface of the road. Instead, rays are cast down from the car body to detect surface unevenness. In this case steep changes of the terrain are not handled accurately. This approach is faster then the first one and provides acceptable results for smooth terrain, e.g. for racing cars simulation. However, on cross-country terrains it may not work correctly. 第二种方法使用wheel joint并假定车轮是虚拟的。车轮不会与路面碰撞。取而代之的是,将射线从车身投射下来以检测表面不平整。在这种情况下,不能正确处理地形的陡峭变化。这种方法比第一种更快,并且可以为平滑地形提供可接受的结果,例如用于赛车模拟。但是,在越野地形上,它可能无法正常工作。

Both joints have a motor associated with them, which rotates the wheels and pushes the vehicle forward.两个关节都有一个与它们关联的 motor ,它使车轮旋转并向前推动车辆。

光线投射和陡峭障碍物的问题

A problem with the wheels simulated using ray casting使用射线投射模拟车轮的问题

本页面上的信息适用于 UNIGINE 2.20 SDK.

最新更新: 2025-02-28
Build: ()