Skip to content

@fibbojs / core / FScene

Class: abstract FScene

A scene which contains the components and the camera. Also contains the Rapier world if physics is enabled.

Constructors

new FScene()

new FScene(options?): FScene

Parameters

options?: FSceneOptions

Returns

FScene

Defined in

core/src/FScene.ts:75

Methods

addComponent()

addComponent(component): void

Add a component to the scene.

Parameters

component: FComponent

Returns

void

Defined in

core/src/FScene.ts:128


addLight()

addLight(light): void

Add a light to the scene.

Parameters

light: FLight

Returns

void

Defined in

core/src/FScene.ts:147


onComponentAdded()

onComponentAdded(callback): void

Add a callback to be called when a component is added to the scene.

Parameters

callback

Returns

void

Defined in

core/src/FScene.ts:173


onComponentRemoved()

onComponentRemoved(callback): void

Add a callback to be called when a component is removed from the scene.

Parameters

callback

Returns

void

Defined in

core/src/FScene.ts:180


onFrame()

onFrame(callback): void

Add a callback to be called when a frame is rendered.

Parameters

callback

Returns

void

Defined in

core/src/FScene.ts:166


onLightAdded()

onLightAdded(callback): void

Add a callback to be called when a light is added to the scene.

Parameters

callback

Returns

void

Defined in

core/src/FScene.ts:195


onLightRemoved()

onLightRemoved(callback): void

Add a callback to be called when a light is removed from the scene.

Parameters

callback

Returns

void

Defined in

core/src/FScene.ts:202


onReady()

onReady(callback): void

Add a callback to be called when the scene is ready. The scene is ready when the init method has finished.

Parameters

callback

Returns

void

Defined in

core/src/FScene.ts:188


removeComponent()

removeComponent(component): void

Remove a component from the scene.

Parameters

component: FComponent

Returns

void

Defined in

core/src/FScene.ts:136


removeLight()

removeLight(light): void

Remove a light from the scene.

Parameters

light: FLight

Returns

void

Defined in

core/src/FScene.ts:155

Properties

__CALLBACKS_ON_COMPONENT_ADDED__

__CALLBACKS_ON_COMPONENT_ADDED__: (component) => void[] = []

Callbacks for when a component is added to the scene. It is an array of functions that take the component as an argument.

Defined in

core/src/FScene.ts:54


__CALLBACKS_ON_COMPONENT_REMOVED__

__CALLBACKS_ON_COMPONENT_REMOVED__: (component) => void[] = []

Callbacks for when a component is remove from the scene. It is an array of functions that take the component as an argument.

Defined in

core/src/FScene.ts:59


__CALLBACKS_ON_FRAME__

__CALLBACKS_ON_FRAME__: (delta) => void[] = []

Callbacks for when a frame is rendered. It is an array of functions that take the delta time as an argument.

Defined in

core/src/FScene.ts:49


__CALLBACKS_ON_LIGHT_ADDED__

__CALLBACKS_ON_LIGHT_ADDED__: (light) => void[] = []

Callbacks for when a light is added to the scene. It is an array of functions that take the light as an argument.

Defined in

core/src/FScene.ts:68


__CALLBACKS_ON_LIGHT_REMOVED__

__CALLBACKS_ON_LIGHT_REMOVED__: (light) => void[] = []

Callbacks for when a light is added to the scene. It is an array of functions that take the light as an argument.

Defined in

core/src/FScene.ts:73


__CALLBACKS_ON_READY__

__CALLBACKS_ON_READY__: () => void[] = []

Callbacks for when the scene is ready.

Defined in

core/src/FScene.ts:63


__DOM_NODE__

__DOM_NODE__: HTMLElement

DOM element that the renderer will be appended to

Defined in

core/src/FScene.ts:26


__IS_2D__

__IS_2D__: boolean = false

Defined in

core/src/FScene.ts:21


__IS_3D__

__IS_3D__: boolean = false

Internal flags

Defined in

core/src/FScene.ts:20


__RAPIER_TO_COMPONENT__

__RAPIER_TO_COMPONENT__: Map<number, FComponent>

Defined in

core/src/FScene.ts:42


components

components: FComponent[]

The components in the scene.

Defined in

core/src/FScene.ts:31


eventQueue

eventQueue: EventQueue | EventQueue

Defined in

core/src/FScene.ts:41


gravity

gravity: object | object

Defined in

core/src/FScene.ts:39


lights

lights: FLight[] = []

The lights in the scene.

Defined in

core/src/FScene.ts:36


world

world: World | World

Defined in

core/src/FScene.ts:40