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
Defined in
Methods
addComponent()
addComponent(
component
):void
Add a component to the scene.
Parameters
• component: FComponent
Returns
void
Defined in
addLight()
addLight(
light
):void
Add a light to the scene.
Parameters
• light: FLight
Returns
void
Defined in
frame()
frame(
delta
):void
Compute a frame with the given delta time. By default, it is called every frame, but this behavior can be changed by giving the autoLoop
option as false
when creating the scene.
Parameters
• delta: number
The time in seconds since the last frame.
Returns
void
Defined in
onComponentAdded()
onComponentAdded(
callback
):void
Add a callback to be called when a component is added to the scene.
Parameters
• callback
Returns
void
Defined in
onComponentRemoved()
onComponentRemoved(
callback
):void
Add a callback to be called when a component is removed from the scene.
Parameters
• callback
Returns
void
Defined in
onFrame()
onFrame(
callback
):void
Add a callback to be called when a frame is rendered.
Parameters
• callback
Returns
void
Defined in
onLightAdded()
onLightAdded(
callback
):void
Add a callback to be called when a light is added to the scene.
Parameters
• callback
Returns
void
Defined in
onLightRemoved()
onLightRemoved(
callback
):void
Add a callback to be called when a light is removed from the scene.
Parameters
• callback
Returns
void
Defined in
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
removeComponent()
removeComponent(
component
):void
Remove a component from the scene.
Parameters
• component: FComponent
Returns
void
Defined in
removeLight()
removeLight(
light
):void
Remove a light from the scene.
Parameters
• light: FLight
Returns
void
Defined in
Properties
__CALLBACKS_ON_COMPONENT_ADDED__
__CALLBACKS_ON_COMPONENT_ADDED__: (
component
) =>void
[] =[]
Callbacks for when a component is added to the scene.
Defined in
__CALLBACKS_ON_COMPONENT_REMOVED__
__CALLBACKS_ON_COMPONENT_REMOVED__: (
component
) =>void
[] =[]
Callbacks for when a component is remove from the scene.
Defined in
__CALLBACKS_ON_FRAME__
__CALLBACKS_ON_FRAME__: (
delta
) =>void
[] =[]
Callbacks for when a frame is rendered.
Defined in
__CALLBACKS_ON_LIGHT_ADDED__
__CALLBACKS_ON_LIGHT_ADDED__: (
light
) =>void
[] =[]
Callbacks for when a light is added to the scene.
Defined in
__CALLBACKS_ON_LIGHT_REMOVED__
__CALLBACKS_ON_LIGHT_REMOVED__: (
light
) =>void
[] =[]
Callbacks for when a light is added to the scene.
Defined in
__CALLBACKS_ON_READY__
__CALLBACKS_ON_READY__: () =>
void
[] =[]
Callbacks for when the scene is ready.
Defined in
__DOM_NODE__
__DOM_NODE__:
HTMLElement
DOM element that the renderer will be appended to
Defined in
__IS_2D__
__IS_2D__:
boolean
=false
Defined in
__IS_3D__
__IS_3D__:
boolean
=false
Internal flags
Defined in
__RAPIER_TO_COMPONENT__
__RAPIER_TO_COMPONENT__:
Map
<number
,FComponent
>
Defined in
components
components:
FComponent
[]
The components in the scene.
Defined in
eventQueue
eventQueue:
EventQueue
|EventQueue
Defined in
gravity
gravity:
object
|object
Defined in
lights
lights:
FLight
[] =[]
The lights in the scene.
Defined in
world
world:
World
|World