CylinderMesh

继承: PrimitiveMesh < Mesh < Resource < RefCounted < Object

表示圆柱形PrimitiveMesh的类。

描述

表示圆柱形PrimitiveMesh的类。该类可用于通过将top_radiusbottom_radius属性设置为0.0来创建锥体。

属性


属性说明

float bottom_radius = 0.5 🔗

  • void set_bottom_radius(value: float)

  • float get_bottom_radius()

圆柱体的底部半径。如果设置为0.0,则不会生成底面,从而形成圆锥形。另请参见cap_bottom


bool cap_bottom = true 🔗

  • void set_cap_bottom(value: bool)

  • bool is_cap_bottom()

如果true,则在圆柱体底部生成一个帽。这可以设置为false,以在摄像机从未看到帽时加快生成和渲染速度。另见bottom_radius

注意:如果bottom_radius0.0,即使cap_bottomtrue,上限生成总是被跳过。


bool cap_top = true 🔗

  • void set_cap_top(value: bool)

  • bool is_cap_top()

如果true,则在圆柱体顶部生成一个帽。这可以设置为false,以在摄像机从未看到帽时加快生成和渲染速度。另见top_radius

注意:如果top_radius0.0,即使cap_toptrue,上限生成总是被跳过。


float height = 2.0 🔗

  • void set_height(value: float)

  • float get_height()

气缸的全高度。


int radial_segments = 64 🔗

  • void set_radial_segments(value: int)

  • int get_radial_segments()

气缸上的径向段数。更高的值会导致更详细的气缸/锥体,但会以性能为代价。


int rings = 4 🔗

  • void set_rings(value: int)

  • int get_rings()

沿圆柱体高度的边环数量。除非使用着色器或程序网格工具来更改顶点数据,否则更改rings不会产生任何视觉影响。更高的值会导致更多的细分,这可用于使用着色器或程序网格工具创建看起来更平滑的效果(以牺牲性能为代价)。当不使用着色器或程序网格工具更改顶点数据时,rings应保持其默认值。


float top_radius = 0.5 🔗

  • void set_top_radius(value: float)

  • float get_top_radius()

圆柱体的顶部半径。如果设置为0.0,则不会生成顶面,从而产生圆锥形。另请参见cap_top