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 one in terms of performance.Rigid物体可以根据Rigid物体动态.这种类型的车身是最常用的,在性能方面也是最有效的。
See also也可以看看#
Assigning a Rigid Body指定刚体#
To assign the Rigid body to an object via UnigineEditor perform the following steps:通过将 Rigid物体分配给对象统一编辑器执行以下步骤:
- 打开 World Hierarchy 窗口。
- 选择要为其分配 Rigid物体的对象。
-
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.如有必要,设置物体名称并更改其他参数。
Parameters参数#
The set of Rigid body parameters in accordance with Rigid body dynamics includes the following:一个Rigid物体的参数集按照Rigid物体动态包括以下内容:
Immovable |
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 being a collider object.打开和关闭 Rigid物体的静态模式。如果设置了标志,则物体将忽略世界上的所有力并保持其位置,同时仍然是对撞机对象。 |
||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Freezable |
注意
This flag is recommended to be always set for all rigid bodies except for Player Actor. Freezing a player causes it to react to the user's input with a time lag, small but nonetheless perceptible.建议始终为除 Player Actor 之外的所有刚体设置 Freezable 标志。冻结玩家会导致它对用户的输入做出反应,时滞很小,但仍然可以察觉。 |
||||||||||||||||||
Shape-Based |
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物体的体积可以近似为几个形状(例如,一个凹对象被分成一组凸包或一个 Ragdoll物体)。每个形状都有它的大量的和密度.因此,Rigid物体的某些参数,例如其总质量、质心和惯性张量,由其形状决定。如果启用了 Shape-based 选项,则可以自动计算这些参数。 注意
Setting the individual masses or densities of the shapes is the most intuitive method to achieve correct physical behavior of the body. Even if overridden by the body parameters, they are still used to determine the distribution of mass within the object.设置形状的各个质量或密度是实现物体正确物理行为的最直观方法。即使被覆盖通过物体参数,它们仍然用于确定物体内的质量分布。 |
||||||||||||||||||
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:
where Iij sets the moment of inertia around the i -axis when the body is rotated around the j-axis.其中 Iij 设置当物体围绕 j 轴旋转时围绕 i 轴的转动惯量。 注意
To rotate the body evenly about the rotation axis, the matrix should be diagonal, i.e all values outside the main diagonal are set to 0. Otherwise, the body may start to rotate chaotically.要绕旋转轴均匀地旋转物体,矩阵应该是对角的,即主对角线之外的所有值都设置为 0。否则,物体可能会开始混乱地旋转。 As for values of the moment of inertia:至于转动惯量的值:
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:例如,下图显示了三个具有不同惯性张量的框。黄色框有很高的惯性:
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.正因为如此,它只有落在倾斜的平面上时才能向下滑动。相反,红色框的惯性最低,旋转得最急切。
Different inertia tensors that override shape-based parameters覆盖基于形状的参数的不同惯性张量
|
||||||||||||||||||
CMass |
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.可以将任意点设置为质心的物体。可能需要校正对象的运动以提供理想的外观。例如,一个球形的不倒翁需要不均匀的质量分布:它的质心应该位于更靠近底部的位置,所以它在倾斜时总是站起来。 注意
Center of mass is set as coordinates of the point in local space of the body.质心设置为该点在物体局部空间中的坐标。 |
本页面上的信息适用于 UNIGINE 2.20 SDK.