Skip to main content

Object3D

Since version 4.0.0

Base class for 3D objects

class Object3D extends Component<{
update: {
camera: Camera
}
}>

Extends

Properties

Local matrix of the object

Position of the object

Rotation quaternion

A scale vector of the object

Methods

Update local matrix of the object.

Constructor

Create new instance.
new Object3D(): Object3D

Properties

matrix

>=4.0.0
matrix

mat4

Local matrix of the object

position

>=4.0.0
position

vec3

Position of the object

rotation

>=4.0.0
rotation

quat

Rotation quaternion

scale

>=4.0.0
scale

vec3

A scale vector of the object

Methods

hasOn

inherited
hasOn

boolean

hasOn<K>(eventName: K): boolean

Parameters

eventName

K

off

inherited
off

Object3D

off<K>(eventName: K, handlerToDetach: EventCallback<{ update: { camera: Camera } }, K, Object3D>): Object3D

Parameters

eventName

K

handlerToDetach

EventCallback<{ update: { camera: Camera } }, K, Object3D>

on

inherited
on

Object3D

on(eventHash: Partial<{ update: ((event: { camera: Camera }) => any) }>): Object3D

Parameters

eventHash

Partial<{ update: ((event: { camera: Camera }) => any) }>

once

inherited
once

Object3D

once(eventHash: Partial<{ update: ((event: { camera: Camera }) => any) }>): Object3D

Parameters

eventHash

Partial<{ update: ((event: { camera: Camera }) => any) }>

trigger

inherited
trigger

Object3D

trigger<K>(event: K, ...params: EventTriggerParams<{ update: { camera: Camera } }, K>): Object3D

Parameters

event

K

params

EventTriggerParams<{ update: { camera: Camera } }, K>

update

update

void

update(ctx: ObjectUpdateContext): void

Parameters

ctx

ObjectUpdateContext

updateMatrix

>=4.0.0
updateMatrix

void

updateMatrix(): void

Update local matrix of the object.