Rigid Body
Rigid body enables simulation of physical bodies in accordance with Rigid body dynamics. This type of body is the most commonly used and the most efficient in terms of performance.Rigid body 可以根据Rigid body 动态.这种类型的车身是最常用的,在性能方面也是最有效的。
The set of parameters of a Rigid body in accordance with Rigid body dynamics includes the following:一个Rigid body的参数集按照Rigid body 动态包括以下内容:
- Density密度
- Linear Damping and Angular Damping线性阻尼和角阻尼
- Maximum Linear Velocity and Maximum Angular Velocity最大线速度和最大角速度
- Friction摩擦
- Restitution归还
- Freezable可冷冻
- Immovable不可移动
See also也可以看看#
Shape-based mass parameters基于形状的质量参数#
Volume of a Rigid body can be approximated by several shapes (e.g. a concave object divided into a set of convex hulls or a Ragdoll body). Each shape has its mass and density. Therefore certain parameters of a Rigid body, such as its total mass, center of mass, and inertia tensor, are determined by its shapes. These parameters can be calculated automatically if the Shape-based option is enabled.Rigid body 的体积可以近似为几个形状(例如,一个凹对象被分成一组凸包或一个 Ragdoll body)。每个形状都有它的大量的和密度.因此,Rigid body 的某些参数,例如其总质量、质心和惯性张量,由其形状决定。如果启用了 Shape-based 选项,则可以自动计算这些参数。
To enable this option for a body via UnigineEditor perform the following steps:通过以下方式为身体启用此选项统一编辑器执行以下步骤:
- Select the desired object with a Rigid body assigned.选择指定为 Rigid body 的所需对象。
- Go to the Physics tab in the Parameters window.转到 Parameters 窗口中的 Physics 选项卡。
- In the Body section, check the Shape-based option.在 Body 部分,选中 Shape-based 选项。
Overriding Shapes Parameters覆盖形状参数#
Disabling the Shape-based option makes it possible to manually redefine some total parameters for the body. 禁用Shape-based选项可以手动重新定义主体的一些总参数。
To disable this option for a body via UnigineEditor perform the following steps:通过以下方式为身体禁用此选项统一编辑器执行以下步骤:
- Select the desired object with the Rigid body assigned.选择指定为 Rigid body 的所需对象。
- Go to the Physics tab in the Parameters window.转到 Parameters 窗口中的 Physics 选项卡。
- In the Body section, check Shape-based option. The fields of total parameters for the body will be activated.在 Body 部分,选中 Shape-based 选项。身体的总参数字段将被激活。
- Set up body parameters manually.手动设置身体参数。
Center of mass质心#
An arbitrary point can be set to be a center of mass of the body. It may be necessary to correct the motion of an object to provide desirable look. For example, a tilting doll with a sphere shape requires an uneven mass distribution: its center of mass should be located closer to the bottom, so it always stands up when tilted.可以将任意点设置为质心的身体。可能需要校正对象的运动以提供理想的外观。例如,一个球形的倾斜娃娃需要不均匀的质量分布:它的质心应该位于更靠近底部的位置,所以它在倾斜时总是站起来。
Moment of Inertia惯性矩#
The moment of inertia is a rotational analog of mass, describing the resistance of the body to rotation in different directions. It is determined by the distribution of mass throughout the body volume. The farther from the axis of rotation the center of mass is, the more rotational inertia the body has.转动惯量是质量的旋转模拟,描述了物体对不同方向旋转的阻力。它是由质量在整个身体体积中的分布决定的。质心离旋转轴越远,物体的转动惯量越大。
The inertia tensor that allows to compute a moment of inertia about an arbitrary axis is represented as a matrix, I:允许计算关于任意轴的惯性矩的惯性张量表示为矩阵 I:
Ixx | Ixy | Ixz |
Iyx | Iyy | Iyz |
Izx | Izy | Izz |
where Iij sets the moment of inertia around the i -axis when the body is rotated around the j-axis.其中 Iij 设置当主体围绕 j 轴旋转时围绕 i 轴的转动惯量。
As for values of the moment of inertia:至于转动惯量的值:
- The higher the value, the more torque must be be applied to rotate the body about a particular axis.该值越高,必须施加越大的扭矩来围绕特定轴旋转主体。
-
The lower the value, the easier it is to change the angular velocity of a body about a particular axis.值越低,越容易改变物体绕特定轴的角速度。
It is not recommended to set values less than 0.011! Otherwise, the matrix won't be properly inverted, which is necessary to apply collision impulse.不建议设置小于 0.011 的值!否则,矩阵将无法正确反转,这是应用碰撞脉冲所必需的。
Values are corrected with respect to the average value to provide smoother movement.相对于平均值校正值以提供更平滑的移动。
For example, the following illustration shows three boxes with different inertia tensors. The yellow box has very high inertia:例如,下图显示了三个具有不同惯性张量的框。黄色框有很高的惯性:
100 | 0 | 0 |
0 | 100 | 0 |
0 | 0 | 100 |
Because of that, it can only slide down when falling upon the tilted plane. The red box, on the contrary, has the lowest inertia and rotates most eagerly.正因为如此,它只有落在倾斜的平面上时才能向下滑动。相反,红色框的惯性最低,旋转得最急切。
Freezable Body冷冻体#
If the Freezable flag is set for a Rigid body, its simulation is freezed when necessary.如果为 Rigid body 设置了 Freezable 标志,则其模拟被冻结必要时。
Immovable不可移动#
The Immovable flag toggles the static mode for a Rigid body on and off. If the flag is set, the body will ignore all forces in the world and keep its position while remaining to be a collider object.Immovable 标志打开和关闭 Rigid body 的静态模式。如果设置了标志,则身体将忽略世界上的所有力并保持其位置,同时仍然是对撞机对象。
Assigning a Rigid Body指定刚体#
To assign the Rigid body to an object via UnigineEditor perform the following steps:通过将 Rigid body 分配给对象统一编辑器执行以下步骤:
- Open the World Hierarchy window.打开 World Hierarchy 窗口。
- Select an object to assign a Rigid body to.选择要为其分配 Rigid body 的对象。
-
Go to the Physics tab in the Parameters window and assign a physical body to the selected object by selecting Body -> Rigid.转到 Parameters 窗口中的 Physics 选项卡并分配一个物理身体通过选择 Body -> Rigid 到选定的对象。
- Set the body name and change other parameters if necessary.如有必要,设置主体名称并更改其他参数。