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.

RibbonTrailMesh

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

代表豎直絲帶形狀的 PrimitiveMesh,絲帶的寬度可變。

說明

RibbonTrailMesh 代表豎直條帶形狀的網格,條帶的寬度可變。條帶由若干扁平或十字形的分節構成,每一節的長度 section_length 和分段數 section_segments 都相同。條帶會沿著總長度對 curve 進行取樣,這樣這條曲線就決定了條帶沿長度的大小。

該基本網格常用於粒子拖尾。

教學

屬性

Curve

curve

float

section_length

0.2

int

section_segments

3

int

sections

5

Shape

shape

1

float

size

1.0


列舉

enum Shape: 🔗

Shape SHAPE_FLAT = 0

將網格指定為單個扁平的面。

Shape SHAPE_CROSS = 1

將網格指定為兩個互相垂直的面,形成十字形。


屬性說明

Curve curve 🔗

決定條帶沿長度的大小。通過將基礎大小 size 乘以這條曲線上給定位置對應的值,就可以得到分節上某一段的大小。如果得到的值小於 0,則對應的面會被翻轉。應當為單位 Curve。


float section_length = 0.2 🔗

  • void set_section_length(value: float)

  • float get_section_length()

條帶中一節的長度。


int section_segments = 3 🔗

  • void set_section_segments(value: int)

  • int get_section_segments()

條帶中一節的段數。每一段的大小是根據對 curve 的取樣確定的。更高的值會生成更細緻的條帶,但以效能為代價。


int sections = 5 🔗

  • void set_sections(value: int)

  • int get_sections()

條帶中分節的數量。


Shape shape = 1 🔗

決定條帶的形狀。


float size = 1.0 🔗

條帶的基礎大小。通過將這個大小乘以 curve 上給定位置對應的值,就可以得到分節上某一段的大小。