Skip to main content

Class: InstancedMeshEntity

InstancedMesh.InstancedMeshEntity

Represents an individual instance within an InstancedMesh2, providing properties and methods for interaction and transformation.

Hierarchy

  • EventDispatcher

    InstancedMeshEntity

Constructors

constructor

new InstancedMeshEntity(parent, index, color?)

Parameters

NameTypeDescription
parentInstancedMesh2The parent InstancedMesh2 that contains this instance.
indexnumberThe index of this instance within the parent InstancedMesh2.
color?ColorRepresentationThe initial color representation for this instance (optional).

Overrides

EventDispatcher.constructor

Defined in

src/instancedMesh/InstancedMeshEntity.ts:74

Properties

cursor

cursor: Cursor

Cursor style when interacting with the object.

Defined in

src/instancedMesh/InstancedMeshEntity.ts:37


cursorDrag

cursorDrag: Cursor

Cursor style when dragging the object.

Defined in

src/instancedMesh/InstancedMeshEntity.ts:39


cursorDrop

cursorDrop: Cursor

Cursor style when dropping an object onto this one.

Defined in

src/instancedMesh/InstancedMeshEntity.ts:41


draggable

draggable: boolean = false

Indicates whether the object is draggable (default: false).

Defined in

src/instancedMesh/InstancedMeshEntity.ts:33


enabled

enabled: boolean = true

Determines if the object is enabled. (default: true). If set to true, it allows triggering all InteractionEvents; otherwise, events are disabled.

Defined in

src/instancedMesh/InstancedMeshEntity.ts:29


findDropTarget

findDropTarget: boolean = false

Determines when the object is dragged, whether it will have to search for any drop targets (default: false).

Defined in

src/instancedMesh/InstancedMeshEntity.ts:35


focusable

focusable: boolean = true

Indicates whether the object can receive focus (default: true).

Defined in

src/instancedMesh/InstancedMeshEntity.ts:31


instanceId

instanceId: number

An identifier for this individual instance within an InstancedMesh2.

Defined in

src/instancedMesh/InstancedMeshEntity.ts:18


isInstancedMeshEntity

isInstancedMeshEntity: boolean = true

A flag indicating that this is an instance of InstancedMeshEntity.

Defined in

src/instancedMesh/InstancedMeshEntity.ts:14


parent

parent: InstancedMesh2

The parent InstancedMesh2 that contains this instance.

Defined in

src/instancedMesh/InstancedMeshEntity.ts:16


position

Readonly position: Vector3

A Vector3 representing the object's local position. Default is (0, 0, 0).

Defined in

src/instancedMesh/InstancedMeshEntity.ts:20


quaternion

Readonly quaternion: Quaternion

Object's local rotation as a Quaternion.

Defined in

src/instancedMesh/InstancedMeshEntity.ts:24


scale

Readonly scale: Vector3

The object's local scale. Default is Vector3(1, 1, 1).

Defined in

src/instancedMesh/InstancedMeshEntity.ts:22

Accessors

clicking

get clicking(): boolean

Indicates if the object is currently being clicked.

Returns

boolean

Defined in

src/instancedMesh/InstancedMeshEntity.ts:53


dragging

get dragging(): boolean

Indicates if the object is currently being dragged.

Returns

boolean

Defined in

src/instancedMesh/InstancedMeshEntity.ts:55


enabledState

get enabledState(): boolean

Retrieves the combined enabled state considering parent objects.

Returns

boolean

Defined in

src/instancedMesh/InstancedMeshEntity.ts:57


focused

get focused(): boolean

Indicates if the object is currently focused.

Returns

boolean

Defined in

src/instancedMesh/InstancedMeshEntity.ts:51


hovered

get hovered(): boolean

Indicates if the primary pointer is over this object.

Returns

boolean

Defined in

src/instancedMesh/InstancedMeshEntity.ts:49


matrixWorld

get matrixWorld(): Matrix4

The global transform of the object.

Returns

Matrix4

Defined in

src/instancedMesh/InstancedMeshEntity.ts:62

Methods

applyBlur

applyBlur(): void

Applies blur (removes focus) from the object.

Returns

void

Defined in

src/instancedMesh/InstancedMeshEntity.ts:175


applyFocus

applyFocus(): void

Applies focus to the object.

Returns

void

Defined in

src/instancedMesh/InstancedMeshEntity.ts:168


applyMatrix4

applyMatrix4(m): InstancedMeshEntity

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

Parameters

NameTypeDescription
mMatrix4Matrix to apply.

Returns

InstancedMeshEntity

The instance of the object.

Defined in

src/instancedMesh/InstancedMeshEntity.ts:120


applyQuaternion

applyQuaternion(q): InstancedMeshEntity

Applies the rotation represented by the quaternion to the object.

Parameters

NameTypeDescription
qQuaternionQuaternion to apply.

Returns

InstancedMeshEntity

The instance of the object.

Defined in

src/instancedMesh/InstancedMeshEntity.ts:136


getColor

getColor(color?): Color

Gets the color of this instance.

Parameters

NameTypeDescription
colorColorAn optional target Color object to store the result (optional).

Returns

Color

The color representation of this instance.

Defined in

src/instancedMesh/InstancedMeshEntity.ts:99


hasEvent

hasEvent<K>(type, listener): boolean

Checks if the object has a specific event listener.

Type parameters

NameType
Kextends "animate" | "blur" | "click" | "dblclick" | "drag" | "dragend" | "dragstart" | "focus" | "keydown" | "keyup" | "pointerdown" | "pointermove" | "pointerout" | "pointerover" | "pointerup" | "wheel" | "pointerintersection" | "dragcancel"

Parameters

NameTypeDescription
typeKThe type of event to check for.
listener(event?: InstancedEvents[K]) => voidThe callback function to check.

Returns

boolean

true if the event listener is attached; otherwise, false.

Defined in

src/instancedMesh/InstancedMeshEntity.ts:203


off

off<K>(type, listener): void

Removes an event listener from the object.

Type parameters

NameType
Kextends "animate" | "blur" | "click" | "dblclick" | "drag" | "dragend" | "dragstart" | "focus" | "keydown" | "keyup" | "pointerdown" | "pointermove" | "pointerout" | "pointerover" | "pointerup" | "wheel" | "pointerintersection" | "dragcancel"

Parameters

NameTypeDescription
typeKThe type of event to remove the listener from.
listener(event?: InstancedEvents[K]) => voidThe callback function to remove.

Returns

void

Defined in

src/instancedMesh/InstancedMeshEntity.ts:212


on

on<K>(types, listener): (event?: InstancedEvents[K]) => void

Attaches an event listener to the object.

Type parameters

NameType
Kextends "animate" | "blur" | "click" | "dblclick" | "drag" | "dragend" | "dragstart" | "focus" | "keydown" | "keyup" | "pointerdown" | "pointermove" | "pointerout" | "pointerover" | "pointerup" | "wheel" | "pointerintersection" | "dragcancel"

Parameters

NameTypeDescription
typesK | K[]-
listener(event?: InstancedEvents[K]) => voidThe callback function to execute when the event occurs.

Returns

fn

A function to remove the event listener.

▸ (event?): void

Attaches an event listener to the object.

Parameters
NameType
event?InstancedEvents[K]
Returns

void

A function to remove the event listener.

Defined in

src/instancedMesh/InstancedMeshEntity.ts:187


rotateOnAxis

rotateOnAxis(axis, angle): InstancedMeshEntity

Rotate an object along an axis in object space. The axis is assumed to be normalized.

Parameters

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

Returns

InstancedMeshEntity

The instance of the object.

Defined in

src/instancedMesh/InstancedMeshEntity.ts:147


rotateOnWorldAxis

rotateOnWorldAxis(axis, angle): InstancedMeshEntity

Rotate an object along an axis in world space. The axis is assumed to be normalized. Method Assumes no rotated parent.

Parameters

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

Returns

InstancedMeshEntity

The instance of the object.

Defined in

src/instancedMesh/InstancedMeshEntity.ts:159


setColor

setColor(color): void

Sets the color of this instance.

Parameters

NameTypeDescription
colorColorRepresentationThe color representation to set.

Returns

void

Defined in

src/instancedMesh/InstancedMeshEntity.ts:88


trigger

trigger<K>(type, event?): void

Triggers a specific event on the object.

Type parameters

NameType
Kextends "animate" | "blur" | "click" | "dblclick" | "drag" | "dragend" | "dragstart" | "focus" | "keydown" | "keyup" | "pointerdown" | "pointermove" | "pointerout" | "pointerover" | "pointerup" | "wheel" | "pointerintersection" | "dragcancel"

Parameters

NameTypeDescription
typeKThe type of event to trigger.
event?InstancedEvents[K]Optional event data to pass to the listeners.

Returns

void

Defined in

src/instancedMesh/InstancedMeshEntity.ts:221


tween

tween(): Tween<InstancedMeshEntity>

Initiates a Tween animation for the object.

Returns

Tween<InstancedMeshEntity>

A Tween instance for further configuration.

Defined in

src/instancedMesh/InstancedMeshEntity.ts:229


updateMatrix

updateMatrix(): void

Updates the local transform.

Returns

void

Defined in

src/instancedMesh/InstancedMeshEntity.ts:107