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.

CSGTorus3D

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

CSG 圓環形狀。

說明

該節點允許建立與 CSG 系均勻起使用的環面。

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

教學

屬性

float

inner_radius

0.5

Material

material

float

outer_radius

1.0

int

ring_sides

6

int

sides

8

bool

smooth_faces

true


屬性說明

float inner_radius = 0.5 🔗

  • void set_inner_radius(value: float)

  • float get_inner_radius()

圓環的內半徑。


Material material 🔗

用於算繪圓環的材質。


float outer_radius = 1.0 🔗

  • void set_outer_radius(value: float)

  • float get_outer_radius()

圓環的外半徑。


int ring_sides = 6 🔗

  • void set_ring_sides(value: int)

  • int get_ring_sides()

建構每個圓環的邊緣的數量。


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,則圓環將具有平坦的陰影表現。