Up to date

This page is up to date for Godot 4.2. If you still find outdated information, please open an issue.

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

  • void set_curve ( Curve value )

  • Curve get_curve ( )

决定条带沿长度的大小。通过将基础大小 size 乘以这条曲线上给定位置对应的值,就可以得到分节上某一段的大小。如果得到的值小于 0,则对应的面会被翻转。


float section_length = 0.2

  • void set_section_length ( float value )

  • float get_section_length ( )

条带中一节的长度。


int section_segments = 3

  • void set_section_segments ( int value )

  • int get_section_segments ( )

条带中一节的段数。每一段的大小是根据对 curve 的采样确定的。更高的值会生成更细致的条带,但以性能为代价。


int sections = 5

  • void set_sections ( int value )

  • int get_sections ( )

条带中分节的数量。


Shape shape = 1

  • void set_shape ( Shape value )

  • Shape get_shape ( )

决定条带的形状。


float size = 1.0

  • void set_size ( float value )

  • float get_size ( )

条带的基础大小。通过将这个大小乘以 curve 上给定位置对应的值,就可以得到分节上某一段的大小。