Skip to content

Class: ComponentBase

Components are used to attach functionality to object3D, it has an owner object3D. The component can receive update events at each frame.

Hierarchy

Implements

Constructors

Properties

Accessors

Methods

Constructors

constructor

new ComponentBase(): ComponentBase

Returns

ComponentBase

Properties

object3D

object3D: Object3D = null

owner object3D

Implementation of

IComponent.object3D

Defined in

src/components/ComponentBase.ts:17


isDestroyed

Optional isDestroyed: boolean

Implementation of

IComponent.isDestroyed

Defined in

src/components/ComponentBase.ts:38

Accessors

eventDispatcher

get eventDispatcher(): CEventDispatcher

Returns

CEventDispatcher

Implementation of

IComponent.eventDispatcher

Defined in

src/components/ComponentBase.ts:23

set eventDispatcher(value): void

Parameters

NameType
valueCEventDispatcher

Returns

void

Implementation of

IComponent.eventDispatcher

Defined in

src/components/ComponentBase.ts:28


isStart

get isStart(): boolean

Returns

boolean

Defined in

src/components/ComponentBase.ts:40


transform

get transform(): Transform

Return the Transform component attached to the Object3D.

Returns

Transform

Implementation of

IComponent.transform

Defined in

src/components/ComponentBase.ts:47


enable

get enable(): boolean

Enable/disable components. The enabled components can be updated, while the disabled components cannot be updated.

Returns

boolean

Implementation of

IComponent.enable

Defined in

src/components/ComponentBase.ts:68

set enable(value): void

Enable/disable components. The enabled components can be updated, while the disabled components cannot be updated.

Parameters

NameType
valueboolean

Returns

void

Implementation of

IComponent.enable

Defined in

src/components/ComponentBase.ts:54

Methods

init

init(param?): void

Parameters

NameType
param?any

Returns

void

Implementation of

IComponent.init

Defined in

src/components/ComponentBase.ts:112


start

start(): void

Returns

void

Implementation of

IComponent.start

Defined in

src/components/ComponentBase.ts:113


stop

stop(): void

Returns

void

Implementation of

IComponent.stop

Defined in

src/components/ComponentBase.ts:114


onEnable

onEnable(view?): any

Parameters

NameType
view?View3D

Returns

any

Implementation of

IComponent.onEnable

Defined in

src/components/ComponentBase.ts:115


onDisable

onDisable(view?): any

Parameters

NameType
view?View3D

Returns

any

Implementation of

IComponent.onDisable

Defined in

src/components/ComponentBase.ts:116


onUpdate

onUpdate(view?): any

Parameters

NameType
view?View3D

Returns

any

Implementation of

IComponent.onUpdate

Defined in

src/components/ComponentBase.ts:117


onLateUpdate

onLateUpdate(view?): any

Parameters

NameType
view?View3D

Returns

any

Implementation of

IComponent.onLateUpdate

Defined in

src/components/ComponentBase.ts:118


onBeforeUpdate

onBeforeUpdate(view?): any

Parameters

NameType
view?View3D

Returns

any

Implementation of

IComponent.onBeforeUpdate

Defined in

src/components/ComponentBase.ts:119


onCompute

onCompute(view?, command?): any

Parameters

NameType
view?View3D
command?GPUCommandEncoder

Returns

any

Implementation of

IComponent.onCompute

Defined in

src/components/ComponentBase.ts:120


onGraphic

onGraphic(view?): any

Parameters

NameType
view?View3D

Returns

any

Implementation of

IComponent.onGraphic

Defined in

src/components/ComponentBase.ts:121


onParentChange

onParentChange(lastParent?, currentParent?): any

Parameters

NameType
lastParent?Object3D
currentParent?Object3D

Returns

any

Implementation of

IComponent.onParentChange

Defined in

src/components/ComponentBase.ts:122


onAddChild

onAddChild(child): any

Parameters

NameType
childObject3D

Returns

any

Implementation of

IComponent.onAddChild

Defined in

src/components/ComponentBase.ts:123


onRemoveChild

onRemoveChild(child): any

Parameters

NameType
childObject3D

Returns

any

Implementation of

IComponent.onRemoveChild

Defined in

src/components/ComponentBase.ts:124


cloneTo

cloneTo(obj): void

clone component data to target object3D

Parameters

NameTypeDescription
objObject3Dtarget object3D

Returns

void

Implementation of

IComponent.cloneTo

Defined in

src/components/ComponentBase.ts:131


copyComponent

copyComponent(from): this

Parameters

NameType
fromthis

Returns

this

Defined in

src/components/ComponentBase.ts:133


beforeDestroy

beforeDestroy(force?): void

before release this component, object refrences are not be set null now.

Parameters

NameType
force?boolean

Returns

void

Implementation of

IComponent.beforeDestroy

Defined in

src/components/ComponentBase.ts:200


destroy

destroy(force?): void

release this component

Parameters

NameType
force?boolean

Returns

void

Implementation of

IComponent.destroy

Defined in

src/components/ComponentBase.ts:207

Released under the MIT License