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.

CollisionPolygon3D

Eredita: Node3D < Node < Object

Un nodo che fornisce una forma poligonale ispessita (un prisma) a un CollisionObject3D genitore.

Descrizione

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.

Proprietà

Color

debug_color

Color(0, 0, 0, 0)

bool

debug_fill

true

float

depth

1.0

bool

disabled

false

float

margin

0.04

PackedVector2Array

polygon

PackedVector2Array()


Descrizioni delle proprietà

Color debug_color = Color(0, 0, 0, 0) 🔗

  • void set_debug_color(value: Color)

  • Color get_debug_color()

Il colore di debug della forma di collisione che è visualizzato nell'editor, o nel progetto in esecuzione se Debug > Forme di collisione visibili.

Nota: Il valore predefinito è ProjectSettings.debug/shapes/collision/shape_color. Il valore Color(0, 0, 0, 1) documentato qui è un segnaposto e non il colore di debug predefinito effettivo.


bool debug_fill = true 🔗

  • void set_enable_debug_fill(value: bool)

  • bool get_enable_debug_fill()

Se true, quando la forma è visualizzata, mostrerà un colore solido di riempimento oltre al suo wireframe.


float depth = 1.0 🔗

Lunghezza per cui la collisione risultante si estende in entrambe le direzioni perpendicolari al suo poligono 2D.


bool disabled = false 🔗

  • void set_disabled(value: bool)

  • bool is_disabled()

Se true, nessuna collisione sarà generata. Questa proprietà dovrebbe essere modificata con Object.set_deferred().


float margin = 0.04 🔗

  • void set_margin(value: float)

  • float get_margin()

Il margine di collisione per lo Shape3D generato. Vedi Shape3D.margin per ulteriori dettagli.


PackedVector2Array polygon = PackedVector2Array() 🔗

Lista di vertici che definiscono il poligono 2D nel piano XY locale.

Note: The returned array is copied and any changes to it will not update the original property value. See PackedVector2Array for more details.