Attention: Here be dragons
This is the latest
(unstable) version of this documentation, which may document features
not available in or compatible with released stable versions of Godot.
Checking the stable version of the documentation...
CapsuleShape2D
继承: Shape2D < Resource < RefCounted < Object
用于物理碰撞的 2D 胶囊形状。
描述
2D 胶囊形状,旨在用于物理学。通常用于为 CollisionShape2D 提供形状。
性能:CapsuleShape2D 可以快速检查碰撞,但比 RectangleShape2D 和 CircleShape2D 慢。
属性
|
||
|
属性说明
胶囊的总高度,包括半圆。
注意:胶囊的 height 必须至少为其 radius 的两倍。否则,胶囊将变为圆形。如果 height 小于 radius 的两倍,则属性将调整为有效值。
胶囊的高度,不包括两个半圆。这是胶囊中间矩形部分的高度,即两个半圆圆心之间的距离。这是对 height 的封装。
胶囊的半径。
注意:胶囊的 radius 不能大于其 height 的一半。否则,胶囊将变成圆形。如果 radius 大于 height 的一半,则属性将调整为有效值。