Class: InstancedEntity
InstancedMesh2.InstancedEntity
Represents an individual instance within an InstancedMesh2, similar to an Object3D.
Constructors
constructor
• new InstancedEntity(parent, index, color?)
Parameters
| Name | Type | Description |
|---|---|---|
parent | InstancedMesh2<{}, BufferGeometry<NormalBufferAttributes>, Material> | The parent InstancedMesh2 that contains this instance. |
index | number | The index of this instance within the parent InstancedMesh2. |
color? | ColorRepresentation | The 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
| Name | Type | Description |
|---|---|---|
m | Matrix4 | Matrix to apply. |
Returns
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
| Name | Type | Description |
|---|---|---|
q | Quaternion | Quaternion to apply. |
Returns
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
| Name | Type | Default value | Description |
|---|---|---|---|
color | Color | _c | An 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
| Name | Type | Description |
|---|---|---|
axis | Vector3 | A normalized vector in object space. |
angle | number | The angle in radians. |
Returns
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
| Name | Type | Description |
|---|---|---|
axis | Vector3 | A normalized vector in world space. |
angle | number | The angle in radians. |
Returns
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
| Name | Type |
|---|---|
angle | number |
Returns
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
| Name | Type |
|---|---|
angle | number |
Returns
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
| Name | Type |
|---|---|
angle | number |
Returns
The instance of the object.
Defined in
packages/InstancedMesh2/src/InstancedEntity.ts:169
setColor
▸ setColor(color): void
Sets the color of this instance.
Parameters
| Name | Type | Description |
|---|---|---|
color | ColorRepresentation | The 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
| Name | Type | Description |
|---|---|---|
axis | Vector3 | A normalized vector in object space. |
distance | number | The distance to translate. Expects a Float |
Returns
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
| Name | Type | Description |
|---|---|---|
distance | number | Expects a Float. |
Returns
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
| Name | Type | Description |
|---|---|---|
distance | number | Expects a Float. |
Returns
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
| Name | Type | Description |
|---|---|---|
distance | number | Expects a Float. |
Returns
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