Skip to main content

Class: InstancedEntity

InstancedMesh2.InstancedEntity

Represents an individual instance within an InstancedMesh2, similar to an Object3D.

Constructors​

constructor​

• new InstancedEntity(parent, index, color?)

Parameters​

NameTypeDescription
parentInstancedMesh2<{}, BufferGeometry<NormalBufferAttributes>, Material>The parent InstancedMesh2 that contains this instance.
indexnumberThe index of this instance within the parent InstancedMesh2.
color?ColorRepresentationThe initial color representation for this instance (optional).

Defined in​

packages/InstancedMesh2/src/InstancedEntity.ts:49

Properties​

id​

• Readonly id: number

An identifier for this individual instance within an InstancedMesh2.

Defined in​

packages/InstancedMesh2/src/InstancedEntity.ts:13


isInstanceEntity​

• isInstanceEntity: boolean = true

A flag indicating that this is an instance of InstancedMeshEntity.

Defined in​

packages/InstancedMesh2/src/InstancedEntity.ts:9


parent​

• Readonly parent: InstancedMesh2<{}, BufferGeometry<NormalBufferAttributes>, Material>

The parent InstancedMesh2 that contains this instance.

Defined in​

packages/InstancedMesh2/src/InstancedEntity.ts:11


position​

• Readonly position: Vector3

Object's local position.

Defined in​

packages/InstancedMesh2/src/InstancedEntity.ts:15


quaternion​

• Readonly quaternion: Quaternion

Object's local rotation as a Quaternion.

Defined in​

packages/InstancedMesh2/src/InstancedEntity.ts:19


scale​

• Readonly scale: Vector3

Object's local scale.

Defined in​

packages/InstancedMesh2/src/InstancedEntity.ts:17

Accessors​

internalId​

• get internalId(): number

Index in the array of InstanceMatrix.

Returns​

number

Defined in​

packages/InstancedMesh2/src/InstancedEntity.ts:26


matrix​

• get matrix(): Matrix4

The local transform matrix.

Returns​

Matrix4

Defined in​

packages/InstancedMesh2/src/InstancedEntity.ts:38


visible​

• get visible(): boolean

Object gets rendered if true.

Returns​

boolean

Defined in​

packages/InstancedMesh2/src/InstancedEntity.ts:29

Methods​

applyMatrix4​

▸ applyMatrix4(m): InstancedEntity

Applies the matrix transform to the object and updates the object's position, rotation, and scale.

Parameters​

NameTypeDescription
mMatrix4Matrix to apply.

Returns​

InstancedEntity

The instance of the object.

Defined in​

packages/InstancedMesh2/src/InstancedEntity.ts:104


applyQuaternion​

▸ applyQuaternion(q): InstancedEntity

Applies the rotation represented by the quaternion to the object.

Parameters​

NameTypeDescription
qQuaternionQuaternion to apply.

Returns​

InstancedEntity

The instance of the object.

Defined in​

packages/InstancedMesh2/src/InstancedEntity.ts:114


forceUpdateMatrix​

▸ forceUpdateMatrix(): void

Force local transformation update.

Returns​

void

Defined in​

packages/InstancedMesh2/src/InstancedEntity.ts:76


getColor​

▸ getColor(color?): Color

Gets the color of this instance.

Parameters​

NameTypeDefault valueDescription
colorColor_cAn optional target Color object to store the result (optional).

Returns​

Color

The color representation of this instance.

Defined in​

packages/InstancedMesh2/src/InstancedEntity.ts:94


rotateOnAxis​

▸ rotateOnAxis(axis, angle): InstancedEntity

Rotate an object along an axis in object space.

Parameters​

NameTypeDescription
axisVector3A normalized vector in object space.
anglenumberThe angle in radians.

Returns​

InstancedEntity

The instance of the object.

Remarks

The axis is assumed to be normalized.

Defined in​

packages/InstancedMesh2/src/InstancedEntity.ts:126


rotateOnWorldAxis​

▸ rotateOnWorldAxis(axis, angle): InstancedEntity

Rotate an object along an axis in world space.

Parameters​

NameTypeDescription
axisVector3A normalized vector in world space.
anglenumberThe angle in radians.

Returns​

InstancedEntity

The instance of the object.

Remarks

The axis is assumed to be normalized

Defined in​

packages/InstancedMesh2/src/InstancedEntity.ts:140


rotateX​

▸ rotateX(angle): InstancedEntity

Rotates the object around x axis in local space.

Parameters​

NameType
anglenumber

Returns​

InstancedEntity

The instance of the object.

Defined in​

packages/InstancedMesh2/src/InstancedEntity.ts:151


rotateY​

▸ rotateY(angle): InstancedEntity

Rotates the object around y axis in local space.

Parameters​

NameType
anglenumber

Returns​

InstancedEntity

The instance of the object.

Defined in​

packages/InstancedMesh2/src/InstancedEntity.ts:160


rotateZ​

▸ rotateZ(angle): InstancedEntity

Rotates the object around z axis in local space.

Parameters​

NameType
anglenumber

Returns​

InstancedEntity

The instance of the object.

Defined in​

packages/InstancedMesh2/src/InstancedEntity.ts:169


setColor​

▸ setColor(color): void

Sets the color of this instance.

Parameters​

NameTypeDescription
colorColorRepresentationThe color representation to set.

Returns​

void

Defined in​

packages/InstancedMesh2/src/InstancedEntity.ts:85


translateOnAxis​

▸ translateOnAxis(axis, distance): InstancedEntity

Translate an object by distance along an axis in object space

Parameters​

NameTypeDescription
axisVector3A normalized vector in object space.
distancenumberThe distance to translate. Expects a Float

Returns​

InstancedEntity

The instance of the object.

Remarks

The axis is assumed to be normalized.

Defined in​

packages/InstancedMesh2/src/InstancedEntity.ts:180


translateX​

▸ translateX(distance): InstancedEntity

Translates object along x axis in object space by distance units.

Parameters​

NameTypeDescription
distancenumberExpects a Float.

Returns​

InstancedEntity

The instance of the object.

Defined in​

packages/InstancedMesh2/src/InstancedEntity.ts:191


translateY​

▸ translateY(distance): InstancedEntity

Translates object along y axis in object space by distance units.

Parameters​

NameTypeDescription
distancenumberExpects a Float.

Returns​

InstancedEntity

The instance of the object.

Defined in​

packages/InstancedMesh2/src/InstancedEntity.ts:200


translateZ​

▸ translateZ(distance): InstancedEntity

Translates object along z axis in object space by distance units.

Parameters​

NameTypeDescription
distancenumberExpects a Float.

Returns​

InstancedEntity

The instance of the object.

Defined in​

packages/InstancedMesh2/src/InstancedEntity.ts:209


updateMatrix​

▸ updateMatrix(): void

Updates the local transform. If CullingDynamic will update only when it is in the frustum camera.

Returns​

void

Defined in​

packages/InstancedMesh2/src/InstancedEntity.ts:65