CollisionPolygon3D
A node that provides a thickened polygon shape (a prism) to a CollisionObject3D parent.
A node that provides a thickened polygon shape (a prism) to a CollisionObject3D parent.
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.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Constructors1
CollisionPolygon3DConstructor
public CollisionPolygon3D();Properties6
DebugColorProperty
public Color DebugColor { get; set; }The collision shape color that is displayed in the editor, or in the running project if Debug > Visible Collision Shapes is checked at the top of the editor.
Note: The default value is ProjectSettings.debug/shapes/collision/shape_color. The Color(0, 0, 0, 0) value documented here is a placeholder, and not the actual default debug color.
DebugFillProperty
public bool DebugFill { get; set; }If true, when the shape is displayed, it will show a solid fill color in addition to its wireframe.
DepthProperty
public float Depth { get; set; }Length that the resulting collision extends in either direction perpendicular to its 2D polygon.
DisabledProperty
public bool Disabled { get; set; }If true, no collision will be produced. This property should be changed with ReckfellObject.SetDeferred.
MarginProperty
public float Margin { get; set; }The collision margin for the generated Shape3D. See Shape3D.Margin for more details.
PolygonProperty
public Vector2[] Polygon { get; set; }Array of vertices which define the 2D polygon in the local XY plane.
Methods13
GetDebugColorColor
public Color GetDebugColor();ColorGetDepthfloat
public float GetDepth();floatGetEnableDebugFillbool
public bool GetEnableDebugFill();boolGetMarginfloat
public float GetMargin();floatGetPolygonVector2[]
public Vector2[] GetPolygon();Vector2[]IsDisabledbool
public bool IsDisabled();boolSetDebugColorvoid
public void SetDebugColor(Color color);| Name | Type | Default |
|---|---|---|
color | Color | — |
SetDepthvoid
public void SetDepth(float depth);| Name | Type | Default |
|---|---|---|
depth | float | — |
SetDisabledvoid
public void SetDisabled(bool disabled);| Name | Type | Default |
|---|---|---|
disabled | bool | — |
SetEnableDebugFillvoid
public void SetEnableDebugFill(bool enable);| Name | Type | Default |
|---|---|---|
enable | bool | — |
SetMarginvoid
public void SetMargin(float margin);| Name | Type | Default |
|---|---|---|
margin | float | — |
SetPolygon2 overloads
public void SetPolygon(Vector2[] polygon);| Name | Type | Default |
|---|---|---|
polygon | Vector2[] | — |
public void SetPolygon(ReadOnlySpan<Vector2> polygon);| Name | Type | Default |
|---|---|---|
polygon | ReadOnlySpan<Vector2> | — |