Skip to content

@orillusion/core


Class: CylinderGeometry ​

Defined in: src/shape/CylinderGeometry.ts:11

Cylinder geometry

Extends ​

Constructors ​

Constructor ​

new CylinderGeometry(radiusTop?, radiusBottom?, height?, radialSegments?, heightSegments?, openEnded?, thetaStart?, thetaLength?): CylinderGeometry

Defined in: src/shape/CylinderGeometry.ts:57

Parameters ​

radiusTop? ​

number = 1

radiusBottom? ​

number = 1

height? ​

number = 1

radialSegments? ​

number = 8

heightSegments? ​

number = 8

openEnded? ​

boolean = false

thetaStart? ​

number = 0

thetaLength? ​

number = ...

Returns ​

CylinderGeometry

Overrides ​

GeometryBase.constructor

Properties ​

instanceID ​

instanceID: string

Defined in: src/core/geometry/GeometryBase.ts:43

Unique identifier of this geometry instance.

Inherited from ​

GeometryBase.instanceID


name ​

name: string

Defined in: src/core/geometry/GeometryBase.ts:45

Human-readable name of this geometry.

Inherited from ​

GeometryBase.name


subGeometries ​

subGeometries: SubGeometry[] = []

Defined in: src/core/geometry/GeometryBase.ts:47

Sub-geometries with their per-LOD draw descriptors.

Inherited from ​

GeometryBase.subGeometries


morphTargetsRelative ​

morphTargetsRelative: boolean

Defined in: src/core/geometry/GeometryBase.ts:49

Whether morph targets are stored as relative offsets.

Inherited from ​

GeometryBase.morphTargetsRelative


morphTargetDictionary ​

morphTargetDictionary: object

Defined in: src/core/geometry/GeometryBase.ts:51

Maps morph-target names to their attribute indices.

Index Signature ​

[blenderName: string]: number

Inherited from ​

GeometryBase.morphTargetDictionary


skinNames ​

skinNames: string[]

Defined in: src/core/geometry/GeometryBase.ts:53

Names of the skin joints used by this geometry.

Inherited from ​

GeometryBase.skinNames


bindPose ​

bindPose: Matrix4[]

Defined in: src/core/geometry/GeometryBase.ts:55

Inverse bind-pose matrices for skinning.

Inherited from ​

GeometryBase.bindPose


blendShapeData ​

blendShapeData: BlendShapeData

Defined in: src/core/geometry/GeometryBase.ts:57

Blend-shape (morph target) data for this geometry.

Inherited from ​

GeometryBase.blendShapeData


vertexDim ​

vertexDim: number

Defined in: src/core/geometry/GeometryBase.ts:59

Number of floats per vertex for interleaved buffers.

Inherited from ​

GeometryBase.vertexDim


vertexCount ​

vertexCount: number = 0

Defined in: src/core/geometry/GeometryBase.ts:61

Number of vertices in this geometry.

Inherited from ​

GeometryBase.vertexCount


radiusTop ​

radiusTop: number

Defined in: src/shape/CylinderGeometry.ts:15

The radius of the top of the cylinder


radiusBottom ​

radiusBottom: number

Defined in: src/shape/CylinderGeometry.ts:19

The radius of the bottom of the cylinder


height ​

height: number

Defined in: src/shape/CylinderGeometry.ts:23

The height of the cylinder


radialSegments ​

radialSegments: number

Defined in: src/shape/CylinderGeometry.ts:27

Number of segments around the side of the cylinder


heightSegments ​

heightSegments: number

Defined in: src/shape/CylinderGeometry.ts:31

The number of segments along the height of the cylindrical side


openEnded ​

openEnded: boolean

Defined in: src/shape/CylinderGeometry.ts:35

Indicate whether the bottom surface of the cone is open or capped. The default value is false, which means that the bottom surface is capped by default.


thetaStart ​

thetaStart: number

Defined in: src/shape/CylinderGeometry.ts:39

Starting angle of the first segment


thetaLength ​

thetaLength: number

Defined in: src/shape/CylinderGeometry.ts:43

The center angle of the circular sector on the bottom of the cylinder, with a default value of 2 * PI, makes it a complete cylinder.

Accessors ​

indicesBuffer ​

Get Signature ​

get indicesBuffer(): GeometryIndicesBuffer

Defined in: src/core/geometry/GeometryBase.ts:79

Get the GPU index buffer of this geometry.

Returns ​

GeometryIndicesBuffer

Inherited from ​

GeometryBase.indicesBuffer


vertexBuffer ​

Get Signature ​

get vertexBuffer(): GeometryVertexBuffer

Defined in: src/core/geometry/GeometryBase.ts:84

Get the GPU vertex buffer of this geometry.

Returns ​

GeometryVertexBuffer

Inherited from ​

GeometryBase.vertexBuffer


vertexAttributes ​

Get Signature ​

get vertexAttributes(): string[]

Defined in: src/core/geometry/GeometryBase.ts:89

Get the list of vertex attribute names present on this geometry.

Returns ​

string[]

Inherited from ​

GeometryBase.vertexAttributes


vertexAttributeMap ​

Get Signature ​

get vertexAttributeMap(): Map<string, VertexAttributeData>

Defined in: src/core/geometry/GeometryBase.ts:94

Get the map from attribute name to its vertex attribute data.

Returns ​

Map<string, VertexAttributeData>

Inherited from ​

GeometryBase.vertexAttributeMap


geometryType ​

Get Signature ​

get geometryType(): GeometryVertexType

Defined in: src/core/geometry/GeometryBase.ts:99

Get the vertex layout type of this geometry.

Returns ​

GeometryVertexType

Set Signature ​

set geometryType(value): void

Defined in: src/core/geometry/GeometryBase.ts:103

Set the vertex layout type of this geometry.

Parameters ​
value ​

GeometryVertexType

Returns ​

void

Inherited from ​

GeometryBase.geometryType


bounds ​

Get Signature ​

get bounds(): BoundingBox

Defined in: src/core/geometry/GeometryBase.ts:108

Get the bounding box of this geometry, computing it from positions on first access.

Returns ​

BoundingBox

Set Signature ​

set bounds(value): void

Defined in: src/core/geometry/GeometryBase.ts:152

Set the bounding box of this geometry.

Parameters ​
value ​

BoundingBox

Returns ​

void

Inherited from ​

GeometryBase.bounds

Methods ​

addSubGeometry() ​

addSubGeometry(...lodLevels): SubGeometry

Defined in: src/core/geometry/GeometryBase.ts:161

add subGeometry from lod level

Parameters ​

lodLevels ​

...LODDescriptor[]

Returns ​

SubGeometry

See ​

LODDescriptor

Inherited from ​

GeometryBase.addSubGeometry


generate() ​

generate(shaderReflection): void

Defined in: src/core/geometry/GeometryBase.ts:194

Build the GPU vertex buffer + buffer-layout array from this geometry's attribute data, driven by the consuming pass's ShaderReflection. The layout array is indexed by shader slot (attribute.location), so the LAYOUT contents depend on which attributes the shader actually declares.

Originally this was gated purely on _onChange — i.e. ran once after the geometry's attribute data was set. That broke multi-pass materials: when a single geometry is consumed by a color pass that declares N attributes (say position / normal / uv) AND a depth pass that declares N+1 (adding TEXCOORD_1 at slot 3 via VertexAttributes #include), the color pass ran first, populated slots 0..N-1, and cleared _onChange. The depth pass's generate call was then a no-op, so the pipeline built with vertexBufferLayouts was missing slot N — WebGPU rejects it with "Vertex attribute slot X used in shader is not present in VertexState".

The fix: rebuild also when the incoming reflection requires a slot the current layout array doesn't yet have. The data is already in _attributeMap; createVertexBuffer will pick up the missing slot. We keep the _onChange short-circuit for the normal "shader requirements unchanged" case so dynamic geometry updates don't pay a per-frame createVertexBuffer cost.

Parameters ​

shaderReflection ​

ShaderReflection

Returns ​

void

Inherited from ​

GeometryBase.generate


setIndices() ​

setIndices(data): void

Defined in: src/core/geometry/GeometryBase.ts:214

Set the index data of this geometry, creating its index buffer.

Parameters ​

data ​

ArrayBufferData

the index buffer data

Returns ​

void

Inherited from ​

GeometryBase.setIndices


setVertexs() ​

setVertexs(data): void

Defined in: src/core/geometry/GeometryBase.ts:230

Set the position (vertex) data of this geometry.

Parameters ​

data ​

ArrayBufferData

the position buffer data

Returns ​

void

Inherited from ​

GeometryBase.setVertexs


setAttribute() ​

setAttribute(attribute, data): void

Defined in: src/core/geometry/GeometryBase.ts:244

Set the data of a named vertex attribute (or indices/position).

Parameters ​

attribute ​

string

the attribute name

data ​

ArrayBufferData

the attribute buffer data

Returns ​

void

Inherited from ​

GeometryBase.setAttribute


getAttribute() ​

getAttribute(attribute): VertexAttributeData

Defined in: src/core/geometry/GeometryBase.ts:263

Get the data of a named vertex attribute.

Parameters ​

attribute ​

string

the attribute name

Returns ​

VertexAttributeData

Inherited from ​

GeometryBase.getAttribute


hasAttribute() ​

hasAttribute(attribute): boolean

Defined in: src/core/geometry/GeometryBase.ts:271

Whether this geometry has the given named attribute.

Parameters ​

attribute ​

string

the attribute name

Returns ​

boolean

Inherited from ​

GeometryBase.hasAttribute


genWireframe() ​

genWireframe(): Vector3[]

Defined in: src/core/geometry/GeometryBase.ts:279

Generate (and cache) the line list describing this geometry's wireframe.

Returns ​

Vector3[]

the wireframe line vertices, or null if not available

Inherited from ​

GeometryBase.genWireframe


compute() ​

compute(): void

Defined in: src/core/geometry/GeometryBase.ts:335

Run the compute step on this geometry's index and vertex buffers.

Returns ​

void

Inherited from ​

GeometryBase.compute


computeNormals() ​

computeNormals(): this

Defined in: src/core/geometry/GeometryBase.ts:357

Compute per-vertex normals from the position and index data and upload them.

Returns ​

this

this geometry for chaining

Inherited from ​

GeometryBase.computeNormals


isPrimitive() ​

isPrimitive(): boolean

Defined in: src/core/geometry/GeometryBase.ts:403

Whether this geometry is a built-in primitive.

Returns ​

boolean

Inherited from ​

GeometryBase.isPrimitive


destroy() ​

destroy(force?): void

Defined in: src/core/geometry/GeometryBase.ts:411

Release the buffers and data held by this geometry.

Parameters ​

force? ​

boolean

whether to force-destroy

Returns ​

void

Inherited from ​

GeometryBase.destroy