HingeJoint 将两个刚体组合在一起,使其移动时受铰链连接的约束。
这种关节非常适合门,但也可用于模拟链条等对象。
HingeJoint 有一个电机,可用于使铰链围绕关节轴旋转。
弹簧试图通过围绕关节轴旋转来到达目标角度。
此外,还有一个用于限制关节角度的限位器。
| angle | 关节相对于其停靠位置的当前角度(以度为单位)。(只读) |
| limits | 铰链关节旋转角度限制(以度为单位)。 |
| motor | 电机将施加不超过最大值的力,以达到目标速度(以度/秒为单位)。 |
| spring | 弹簧尝试通过增加弹簧力和阻尼力来达到目标角度。 |
| useLimits | 启用关节的 limits。默认禁用。 |
| useMotor | 启用关节的 motor。默认禁用。 |
| useSpring | 启用关节的 spring。默认禁用。 |
| velocity | 关节的角速率(以度/秒为单位)。(只读) |
| gameObject | 此组件附加到的游戏对象。始终将组件附加到游戏对象。 |
| tag | 此游戏对象的标签。 |
| transform | 附加到此 GameObject 的 Transform。 |
| anchor | 约束关节运动的锚点的位置。 |
| autoConfigureConnectedAnchor | 是否应自动计算 /connectedAnchor/? |
| axis | 约束身体的轴的方向。 |
| breakForce | 为使此关节断开而需要施加的力。 |
| breakTorque | 为破坏此关节而需要施加的扭矩。为了能够断开,必须将关节_锁定_或_限制_到施加扭矩的旋转轴上。这意味着一些关节不能断开,例如无约束的可配置关节 (Configurable Joint)。 |
| connectedAnchor | 相对于连接刚体的锚点位置。 |
| connectedArticulationBody | A reference to an articulation body this joint connects to. |
| connectedBody | 对此关节连接到的其他刚体的引用。 |
| connectedMassScale | 要在解算约束之前应用于连接身体的反向质量和惯性张量的缩放比例。 |
| currentForce | 解算器为满足所有约束而施加的力。 |
| currentTorque | 解算器为满足所有约束而施加的扭矩。 |
| enableCollision | 启用与关节连接的身体之间的碰撞。 |
| enablePreprocessing | 切换此关节的预处理。 |
| massScale | 要在解算约束之前应用于身体的反向质量和惯性张量的缩放比例。 |
| hideFlags | 该对象应该隐藏、随场景一起保存还是由用户修改? |
| name | 对象的名称。 |
| BroadcastMessage | 调用此游戏对象或其任何子项中的每个 MonoBehaviour 上名为 methodName 的方法。 |
| CompareTag | Checks the GameObject's tag against the defined tag. |
| GetComponent | Returns the component of type if the GameObject has one attached. |
| GetComponentInChildren | Returns the Component of type in the GameObject or any of its children using depth first search. |
| GetComponentInParent | Returns the Component of type in the GameObject or any of its parents. |
| GetComponents | 返回 GameObject 中类型为 type 的所有组件。 |
| GetComponentsInChildren | Returns all components of Type type in the GameObject or any of its children using depth first search. Works recursively. |
| GetComponentsInParent | 返回 GameObject 或其任何父项中类型为 type 的所有组件。 |
| SendMessage | 调用此游戏对象中的每个 MonoBehaviour 上名为 methodName 的方法。 |
| SendMessageUpwards | 调用此游戏对象中的每个 MonoBehaviour 上或此行为的每个父级上名为 methodName 的方法。 |
| TryGetComponent | 获取指定类型的组件(如果存在)。 |
| GetInstanceID | Gets the instance ID of the object. |
| ToString | 返回对象的名称。 |
| Destroy | 移除 GameObject、组件或资源。 |
| DestroyImmediate | 立即销毁对象 /obj/。强烈建议您改用 Destroy。 |
| DontDestroyOnLoad | 在加载新的 Scene 时,请勿销毁 Object。 |
| FindObjectOfType | 返回第一个类型为 type 的已加载的激活对象。 |
| FindObjectsOfType | Gets a list of all loaded objects of Type type. |
| Instantiate | 克隆 original 对象并返回克隆对象。 |
| bool | 该对象是否存在? |
| operator != | 比较两个对象是否引用不同的对象。 |
| operator == | 比较两个对象引用,判断它们是否引用同一个对象。 |
| OnJointBreak | 在附加到相同游戏对象的关节断开时调用。 |