Mirror Engine
V5
How To
Mirror Engine Logo

Mirror Engine API


Mirror Engine API / CapsuleGeometry

Class: CapsuleGeometry

A procedural capsule-shaped geometry.

The size, shape and tesselation properties of the capsule can be controlled via constructor parameters. By default, the function will create a capsule standing vertically centered on the XZ-plane with a radius of 0.3, a height of 1.0, 1 height segment and 20 cap segments.

Note that the capsule is created with UVs in the range of 0 to 1.

Extends

  • ConeBaseGeometry

Constructors

new CapsuleGeometry()

new CapsuleGeometry(opts?: {
  calculateTangents: boolean;
  height: number;
  heightSegments: number;
  radius: number;
  sides: number;
 }): CapsuleGeometry

Create a new CapsuleGeometry instance.

Parameters

opts?

An object that specifies optional inputs for the function as follows:

calculateTangents?

boolean

Generate tangent information (defaults to false).

height?

number

The length of the body of the capsule from tip to tip (defaults to 1.0).

heightSegments?

number

The number of divisions along the tubular length of the capsule (defaults to 1).

radius?

number

The radius of the tube forming the body of the capsule (defaults to 0.3).

sides?

number

The number of divisions around the tubular body of the capsule (defaults to 20).

Returns

CapsuleGeometry

Overrides

ConeBaseGeometry.constructor

Properties

blendIndices

blendIndices: undefined | number[];

Blend indices.

Inherited from

ConeBaseGeometry.blendIndices

blendWeights

blendWeights: undefined | number[];

Blend weights.

Inherited from

ConeBaseGeometry.blendWeights

colors

colors: undefined | number[];

Colors.

Inherited from

ConeBaseGeometry.colors

Methods

calculateNormals()

calculateNormals(): void

Generates normal information from the positions and triangle indices.

Returns

void

Inherited from

ConeBaseGeometry.calculateNormals

calculateTangents()

calculateTangents(): void

Generates tangent information from the positions, normals, texture coordinates and triangle indices.

Returns

void

Inherited from

ConeBaseGeometry.calculateTangents
Mirror Engine Logo