Up to date

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

CSGSphere3D

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

CSG 球形形状。

描述

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

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

教程

属性

Material

material

int

radial_segments

12

float

radius

0.5

int

rings

6

bool

smooth_faces

true


属性说明

Material material

用于渲染球体的材质。


int radial_segments = 12

  • void set_radial_segments ( int value )

  • int get_radial_segments ( )

球体的垂直切片数。


float radius = 0.5

  • void set_radius ( float value )

  • float get_radius ( )

球体的半径。


int rings = 6

  • void set_rings ( int value )

  • int get_rings ( )

球体的水平切片数。


bool smooth_faces = true

  • void set_smooth_faces ( bool value )

  • bool get_smooth_faces ( )

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