CollisionPolygon3D
向 CollisionObject3D 父级提供加厚多边形形状(角柱体)的节点。
描述
A node that provides a thickened polygon shape (a prism) to a CollisionObject3D parent and allows it to be edited. The polygon can be concave or convex. This can give a detection shape to an Area3D or turn a PhysicsBody3D into a solid object.
Warning: A non-uniformly scaled CollisionShape3D will likely not behave as expected. Make sure to keep its scale the same on all axes and adjust its shape resource instead.
属性
|
||
|
||
|
||
|
||
|
||
|
属性说明
Color debug_color = Color(0, 0, 0, 0) 🔗
碰撞形状的颜色,在编辑器中显示,勾选编辑器顶部的 调试 > 显示碰撞形状 时也会在运行项目时显示。
注意:默认值为 ProjectSettings.debug/shapes/collision/shape_color。这里记录的 Color(0, 0, 0, 0) 值是占位符,不是实际的默认调试颜色。
如果为 true,则显示形状时除了显示线框外还会显示填充颜色。
产生的碰撞沿着与 2D 多边形垂直的任意方向深入的长度。
如果为 true,则不会产生碰撞。该属性应使用 Object.set_deferred() 进行更改。
生成的 Shape3D 的碰撞边距。详见 Shape3D.margin。
PackedVector2Array polygon = PackedVector2Array() 🔗
void set_polygon(value: PackedVector2Array)
PackedVector2Array get_polygon()
在局部 XY 平面中定义 2D 多边形的顶点数组。
Note: The returned array is copied and any changes to it will not update the original property value. See PackedVector2Array for more details.