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.

TubeTrailMesh

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

代表直管狀的 PrimitiveMesh,寬度可變。

說明

TubeTrailMesh 代表直管狀的網格,寬度可變。管身由若干圓柱形分區構成,每個分區的長度 section_length 和環數 section_rings 都是一致的。會沿著管身的總長度對 curve 取樣,這樣該曲線就確定了管子半徑沿長度的變化方式。

這個基本網格通常用於粒子拖尾。

教學

屬性

bool

cap_bottom

true

bool

cap_top

true

Curve

curve

int

radial_steps

8

float

radius

0.5

float

section_length

0.2

int

section_rings

3

int

sections

5


屬性說明

bool cap_bottom = true 🔗

  • void set_cap_bottom(value: bool)

  • bool is_cap_bottom()

如果為 true ,則在管子的底部生成蓋子。如果相機永遠不可能見到蓋子,那麼設定為 false 可以加快生成和渲染的速度。


bool cap_top = true 🔗

  • void set_cap_top(value: bool)

  • bool is_cap_top()

如果為 true ,則在管子的頂部生成蓋子。如果相機永遠不可能見到蓋子,那麼設定為 false 可以加快生成和渲染的速度。


Curve curve 🔗

確定管身半徑沿長度的變化方式。將基礎 radius 與給定距離下該曲線的取值相乘,就得到了某個分區中某個環的半徑。小於 0 的值會讓面進行正反翻轉。應當為單位 Curve。


int radial_steps = 8 🔗

  • void set_radial_steps(value: int)

  • int get_radial_steps()

管身的面數。例如,取值 5 表示管身為五邊形。值越高,管身細節越高,代價是犧牲效能。


float radius = 0.5 🔗

  • void set_radius(value: float)

  • float get_radius()

管身的基礎半徑。將該半徑與給定距離下 curve 的取值相乘,就得到了某個分區中某個環的半徑。


float section_length = 0.2 🔗

  • void set_section_length(value: float)

  • float get_section_length()

管身分區的長度。


int section_rings = 3 🔗

  • void set_section_rings(value: int)

  • int get_section_rings()

分區中環的數量。每個環都會對 curve 進行取樣,從而決定其半徑。值越高,管身細節越高,代價是犧牲效能。


int sections = 5 🔗

  • void set_sections(value: int)

  • int get_sections()

管身分區總數。