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.

CSGCylinder3D

繼承: CSGPrimitive3D < CSGShape3D < GeometryInstance3D < VisualInstance3D < Node3D < Node < Object

CSG 圓柱形狀。

說明

此節點允許你建立與 CSG 系均勻起使用的圓柱體(或圓錐體)。

注意:CSG 節點旨在用於關卡原型設計。與使用 PrimitiveMesh 建立 MeshInstance3D 相比,建立 CSG 節點具有顯著的 CPU 成本。在另一個 CSG 節點中,移動一個 CSG 節點,也會大量消耗 CPU,因此在遊戲過程中,應該避免這種情況。

教學

屬性

bool

cone

false

float

height

2.0

Material

material

float

radius

0.5

int

sides

8

bool

smooth_faces

true


屬性說明

bool cone = false 🔗

  • void set_cone(value: bool)

  • bool is_cone()

如果為 true,則建立圓錐,僅在一側套用 radius


float height = 2.0 🔗

  • void set_height(value: float)

  • float get_height()

圓柱體的高度。


Material material 🔗

用於算繪圓柱體的材質。


float radius = 0.5 🔗

  • void set_radius(value: float)

  • float get_radius()

圓柱體的半徑。


int sides = 8 🔗

  • void set_sides(value: int)

  • int get_sides()

圓柱體的邊數越多,圓柱體的細節越多。


bool smooth_faces = true 🔗

  • void set_smooth_faces(value: bool)

  • bool get_smooth_faces()

如果為 true,則將圓柱體的法線設定為具有平滑效果,使圓柱體看起來是圓形的。如果為 false,則圓柱體將具有平坦的陰影表現。