Up to date

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

CSGTorus3D

继承: CSGPrimitive3D < CSGShape3D < GeometryInstance3D < VisualInstance3D < Node3D < Node < Object

CSG 圆环形状。

描述

该节点允许创建与 CSG 系统一起使用的环面。

注意:CSG 节点旨在用于关卡原型设计。与使用 PrimitiveMesh 创建 MeshInstance3D 相比,创建 CSG 节点具有显著的 CPU 成本。在另一个 CSG 节点中,移动一个 CSG 节点,也会大量消耗 CPU,因此在游戏过程中,应该避免这种情况。

教程

属性

float

inner_radius

0.5

Material

material

float

outer_radius

1.0

int

ring_sides

6

int

sides

8

bool

smooth_faces

true


属性说明

float inner_radius = 0.5

  • void set_inner_radius ( float value )

  • float get_inner_radius ( )

圆环的内半径。


Material material

用于渲染圆环的材质。


float outer_radius = 1.0

  • void set_outer_radius ( float value )

  • float get_outer_radius ( )

圆环的外半径。


int ring_sides = 6

  • void set_ring_sides ( int value )

  • int get_ring_sides ( )

构造每个圆环的边缘的数量。


int sides = 8

  • void set_sides ( int value )

  • int get_sides ( )

构成圆环的切片数。


bool smooth_faces = true

  • void set_smooth_faces ( bool value )

  • bool get_smooth_faces ( )

如果 true 设置圆环的法线以提供平滑效果,则使圆环看起来是圆形的。如果为 false,则圆环将具有平坦的阴影表现。