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 🔗

Determines the radius of the tube along its length. The radius of a particular section ring is obtained by multiplying the baseline radius by the value of this curve at the given distance. For values smaller than 0, the faces will be inverted. Should be a unit 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()

管身分区总数。