CSGPolygon

Inherits: CSGPrimitive < CSGShape < GeometryInstance < VisualInstance < CullInstance < Spatial < Node < Object

拉伸2D多边形形状以创建3D网格。

描述

挤出一组 2D 点以快速创建各种 3D 网格。

属性

float

depth

1.0

Material

material

Mode

mode

0

bool

path_continuous_u

float

path_interval

PathIntervalType

path_interval_type

bool

path_joined

bool

path_local

NodePath

path_node

PathRotation

path_rotation

float

path_simplify_angle

float

path_u_distance

PoolVector2Array

polygon

PoolVector2Array( 0, 0, 0, 1, 1, 1, 1, 0 )

bool

smooth_faces

false

float

spin_degrees

int

spin_sides

枚举

enum Mode:

  • MODE_DEPTH = 0 —- polygon 形状沿负 Z 轴挤出。

  • MODE_SPIN = 1 —- polygon形状通过围绕Y轴旋转来挤出。

  • MODE_PATH = 2 —- polygon 形状沿 path_node 中指定的 Path 挤出。


enum PathRotation:

  • PATH_ROTATION_POLYGON = 0 —- polygon 多边形的形状不会被旋转。

注意:要求路径的Z坐标不断减少,以确保可行的形状。

  • PATH_ROTATION_PATH = 1 —- polygon 多边形的形状沿路径旋转,但不绕路径轴旋转。

注意: 需要路径的 Z 坐标不断减小以确保可行的形状。

  • PATH_ROTATION_PATH_FOLLOW = 2 —- polygon 多边形的形状跟随路径及其围绕路径轴的旋转。

enum PathIntervalType:

  • PATH_INTERVAL_DISTANCE = 0 —- 当 mode 被设置为路径MODE_PATH 时,path_interval 将决定路径的每个间隔将被挤出的距离,单位为米。

  • PATH_INTERVAL_SUBDIVIDE = 1 —- 当 mode 被设置为路径 MODE_PATH时,path_interval 将沿着路径细分多边形。

属性说明

Default

1.0

Setter

set_depth(value)

Getter

get_depth()

modeMODE_DEPTH时,挤出的深度。


Setter

set_material(value)

Getter

get_material()

用于生成的网格的材质。UV将材质的上半部分映射到挤出的形状,即U沿挤出物的长度,V围绕 polygon的轮廓,左下角的四分之一映射到前端面,右下角的四分之一映射到后端面。


Default

0

Setter

set_mode(value)

Getter

get_mode()

用于挤出 polygonmode


  • bool path_continuous_u

Setter

set_path_continuous_u(value)

Getter

is_path_continuous_u()

modeMODE_PATH时,默认情况下, material的上半部分会沿着挤出形状的整个长度被拉伸。如果false,挤出的每一步都会重复材质的上半部分。


Setter

set_path_interval(value)

Getter

get_path_interval()

modeMODE_PATH时,路径间隔或路径点比例挤出。


Setter

set_path_interval_type(value)

Getter

get_path_interval_type()

modeMODE_PATH 时,这将确定间隔是按距离(PATH_INTERVAL_DISTANCE)还是细分分数(PATH_INTERVAL_SUBDIVIDE)。


Setter

set_path_joined(value)

Getter

is_path_joined()

modeMODE_PATH 时,如果 true 路径的两端会被连接起来,在路径的最后一个点和第一个点之间添加挤出。


Setter

set_path_local(value)

Getter

is_path_local()

modeMODE_PATH时,如果true,则使用CSGPolygonTransform作为挤出的起点,而不是path_nodeTransform


Setter

set_path_node(value)

Getter

get_path_node()

modeMODE_PATH时,用于挤出 polygonPath 对象的坐标。


Setter

set_path_rotation(value)

Getter

get_path_rotation()

modeMODE_PATH 时,PathRotation 方法用于在挤出时旋转polygon


  • float path_simplify_angle

Setter

set_path_simplify_angle(value)

Getter

get_path_simplify_angle()

modeMODE_PATH 时,小于此角度的挤出将合并在一起以减少多边形数量。


Setter

set_path_u_distance(value)

Getter

get_path_u_distance()

modeMODE_PATH 时,这是纹理坐标沿着路径的距离,以米为单位,将进行平铺。当设置为0时,纹理坐标将与几何图形完全匹配,没有平铺。


Default

PoolVector2Array( 0, 0, 0, 1, 1, 1, 1, 0 )

Setter

set_polygon(value)

Getter

get_polygon()

定义挤出的二维多边形的点数组。


Default

false

Setter

set_smooth_faces(value)

Getter

get_smooth_faces()

如果true,则对挤出应用平滑着色。


Setter

set_spin_degrees(value)

Getter

get_spin_degrees()

modeMODE_SPINpolygon在挤出时旋转的总度数。


  • int spin_sides

Setter

set_spin_sides(value)

Getter

get_spin_sides()

modeMODE_SPIN 时,挤出的次数。