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.

CylinderMesh

繼承: PrimitiveMesh < Mesh < Resource < RefCounted < Object

表示圓柱形 PrimitiveMesh 的類。

說明

表示圓柱形 PrimitiveMesh 的類。通過將 top_radiusbottom_radius 屬性設定為 0.0,這個類可以用來建立圓錐體。

屬性

float

bottom_radius

0.5

bool

cap_bottom

true

bool

cap_top

true

float

height

2.0

int

radial_segments

64

int

rings

4

float

top_radius

0.5


屬性說明

float bottom_radius = 0.5 🔗

  • void set_bottom_radius(value: float)

  • float get_bottom_radius()

圓柱體的底部半徑。如果設定為 0.0,則不會生成底面,呈圓錐狀。另見 cap_bottom


bool cap_bottom = true 🔗

  • void set_cap_bottom(value: bool)

  • bool is_cap_bottom()

如果為 true,則在圓柱體底部生成一個蓋子。這可以設定為 false 以在相機從未看到蓋子時加速生成和算繪。另見 bottom_radius

注意:如果 bottom_radius0.0,即使 cap_bottomtrue,蓋子生成也會始終被跳過。


bool cap_top = true 🔗

  • void set_cap_top(value: bool)

  • bool is_cap_top()

如果為 true,則在圓柱體頂部生成一個蓋子。這可以設定為 false 以在相機從未看到蓋子時加速生成和算繪。另見 top_radius

注意:如果 top_radius0.0,即使 cap_toptrue,蓋子生成也會始終被跳過。


float height = 2.0 🔗

  • void set_height(value: float)

  • float get_height()

圓柱體的全高。


int radial_segments = 64 🔗

  • void set_radial_segments(value: int)

  • int get_radial_segments()

圓柱體上的徑向段數。更高的值會生成更細緻的圓柱體或圓錐體,但以性能為代價。


int rings = 4 🔗

  • void set_rings(value: int)

  • int get_rings()

沿圓柱體的高度的邊緣環的數量。除非使用著色器或程式網格工具來更改頂點資料,否則更改 rings 不會影響顯示,rings 應保持其預設值。較高的值會產生更多的細分,這可用於使用著色器或程式式網格工具建立更平滑的顯示效果,但以性能為代價。


float top_radius = 0.5 🔗

  • void set_top_radius(value: float)

  • float get_top_radius()

圓柱體的頂部半徑。如果設定為 0.0,則不會生成頂面,呈圓錐狀。另見 cap_top