Scene

Represents a scene to be rendered by the engine.

see

http://doc.babylonjs.com/features/scene

Hierarchy

Implements

Index

Constructors

Properties

Methods

Constructors

constructor

Find examples in Playground
  • Creates a new Scene

    Parameters

    • engine: Engine

      defines the engine to use to render this scene

    • Optional options: SceneOptions

    Returns Scene

Properties

actionManager

Find examples in Playground
actionManager: ActionManager

Gets or sets the action manager associated with the scene

see

http://doc.babylonjs.com/how_to/how_to_use_actions

actionManagers

Find examples in Playground
actionManagers: ActionManager[]

ActionManagers available on the scene.

activeBonesPerfCounter

Find examples in Playground
activeBonesPerfCounter: PerfCounter

Gets the performance counter for active bones

see

http://doc.babylonjs.com/how_to/optimizing_your_scene#instrumentation

activeCamera

Find examples in Playground
activeCamera: Nullable<Camera>

Gets or sets the current active camera

activeCameras

Find examples in Playground
activeCameras: Camera[]

All of the active cameras added to this scene.

activeParticlesPerfCounter

Find examples in Playground
activeParticlesPerfCounter: PerfCounter

Gets the performance counter for active particles

see

http://doc.babylonjs.com/how_to/optimizing_your_scene#instrumentation

afterCameraRender

Find examples in Playground
afterCameraRender: function

Sets a function to be executed after rendering a camera

Type declaration

    • (): void
    • Returns void

afterRender

Find examples in Playground
afterRender: Nullable<function>

Sets a function to be executed after rendering this scene

ambientColor

Find examples in Playground
ambientColor: Color3

Defines the color used to simulate the ambient color (Default is (0, 0, 0))

animatables

Find examples in Playground
animatables: Animatable[]

Gets all animatable attached to the scene

animationGroups

Find examples in Playground
animationGroups: AnimationGroup[]

All of the animation groups added to this scene

see

http://doc.babylonjs.com/how_to/group

animationPropertiesOverride

Find examples in Playground
animationPropertiesOverride: Nullable<AnimationPropertiesOverride>

Gets or sets the animation properties override

animationTimeScale

Find examples in Playground
animationTimeScale: number

Gets or sets a general scale for animation speed

see

https://www.babylonjs-playground.com/#IBU2W7#3

animations

Find examples in Playground
animations: Animation[]

Gets a list of Animations associated with the scene

animationsEnabled

Find examples in Playground
animationsEnabled: boolean

Gets or sets a boolean indicating if animations are enabled

audioEnabled

Find examples in Playground
audioEnabled: boolean

Gets or sets if audio support is enabled

see

http://doc.babylonjs.com/how_to/playing_sounds_and_music

autoClear

Find examples in Playground
autoClear: boolean

Gets or sets a boolean that indicates if the scene must clear the render buffer before rendering a frame

autoClearDepthAndStencil

Find examples in Playground
autoClearDepthAndStencil: boolean

Gets or sets a boolean that indicates if the scene must clear the depth and stencil buffers before rendering a frame

beforeCameraRender

Find examples in Playground
beforeCameraRender: function

Sets a function to be executed before rendering a camera

Type declaration

    • (): void
    • Returns void

beforeRender

Find examples in Playground
beforeRender: Nullable<function>

Sets a function to be executed before rendering this scene

blockMaterialDirtyMechanism

Find examples in Playground
blockMaterialDirtyMechanism: boolean

Gets or sets a boolean blocking all the calls to markAllMaterialsAsDirty (ie. the materials won't be updated if they are out of sync)

blockfreeActiveMeshesAndRenderingGroups

Find examples in Playground
blockfreeActiveMeshesAndRenderingGroups: boolean

Gets or sets a boolean blocking all the calls to freeActiveMeshes and freeRenderingGroups It can be used in order to prevent going through methods freeRenderingGroups and freeActiveMeshes several times to improve performance when disposing several meshes in a row or a hierarchy of meshes. When used, it is the responsability of the user to blockfreeActiveMeshesAndRenderingGroups back to false.

cameraToUseForPointers

Find examples in Playground
cameraToUseForPointers: Nullable<Camera>

Define this parameter if you are using multiple cameras and you want to specify which one should be used for pointer position

cameras

Find examples in Playground
cameras: Camera[]

All of the cameras added to this scene

see

http://doc.babylonjs.com/babylon101/cameras

clearColor

Find examples in Playground
clearColor: Color4

Defines the color used to clear the render buffer (Default is (0.2, 0.2, 0.3, 1.0))

clipPlane

Find examples in Playground
clipPlane: Nullable<Plane>

Gets or sets the active clipplane 1

clipPlane2

Find examples in Playground
clipPlane2: Nullable<Plane>

Gets or sets the active clipplane 2

clipPlane3

Find examples in Playground
clipPlane3: Nullable<Plane>

Gets or sets the active clipplane 3

clipPlane4

Find examples in Playground
clipPlane4: Nullable<Plane>

Gets or sets the active clipplane 4

collisionsEnabled

Find examples in Playground
collisionsEnabled: boolean

Gets or sets a boolean indicating if collisions are enabled on this scene

see

http://doc.babylonjs.com/babylon101/cameras,_mesh_collisions_and_gravity

constantlyUpdateMeshUnderPointer

Find examples in Playground
constantlyUpdateMeshUnderPointer: boolean

Gets or sets a boolean indicating if the scene must keep the meshUnderPointer property updated Please note that it requires to run a ray cast through the scene on every frame

customRenderTargets

Find examples in Playground
customRenderTargets: RenderTargetTexture[]

The list of user defined render targets added to the scene

debugLayer

Find examples in Playground
debugLayer: DebugLayer

Gets the debug layer (aka Inspector) associated with the scene

see

http://doc.babylonjs.com/features/playground_debuglayer

defaultCursor

Find examples in Playground
defaultCursor: string

Defines the HTML default cursor to use (empty by default)

defaultMaterial

Find examples in Playground
defaultMaterial: Material

The default material used on meshes when no material is affected

disableOfflineSupportExceptionRules

Find examples in Playground
disableOfflineSupportExceptionRules: RegExp[]

Use this array to add regular expressions used to disable offline support for specific urls

dispatchAllSubMeshesOfActiveMeshes

Find examples in Playground
dispatchAllSubMeshesOfActiveMeshes: boolean

Gets or sets a boolean indicating that all submeshes of active meshes must be rendered Use this boolean to avoid computing frustum clipping on submeshes (This could help when you are CPU bound)

dumpNextRenderTargets

Find examples in Playground
dumpNextRenderTargets: boolean

Gets or sets a boolean indicating if next render targets must be dumped as image for debugging purposes We recommend not using it and instead rely on Spector.js: http://spector.babylonjs.com

effectLayers

Find examples in Playground
effectLayers: Array<EffectLayer>

The list of effect layers (highlights/glow) added to the scene

see

http://doc.babylonjs.com/how_to/highlight_layer

see

http://doc.babylonjs.com/how_to/glow_layer

environmentTexture

Find examples in Playground
environmentTexture: Nullable<BaseTexture>

Texture used in all pbr material as the reflection texture. As in the majority of the scene they are the same (exception for multi room and so on), this is easier to set here than in all the materials.

fogColor

Find examples in Playground
fogColor: Color3

Gets or sets the fog color to use

see

http://doc.babylonjs.com/babylon101/environment#fog (Default is Color3(0.2, 0.2, 0.3))

fogDensity

Find examples in Playground
fogDensity: number

Gets or sets the fog density to use

see

http://doc.babylonjs.com/babylon101/environment#fog (Default is 0.1)

fogEnabled

Find examples in Playground
fogEnabled: boolean

Gets or sets a boolean indicating if fog is enabled on this scene

see

http://doc.babylonjs.com/babylon101/environment#fog (Default is true)

fogEnd

Find examples in Playground
fogEnd: number

Gets or sets the fog end distance to use

see

http://doc.babylonjs.com/babylon101/environment#fog (Default is 1000)

fogMode

Find examples in Playground
fogMode: number

Gets or sets the fog mode to use

see

http://doc.babylonjs.com/babylon101/environment#fog | mode | value | | --- | --- | | FOGMODE_NONE | 0 | | FOGMODE_EXP | 1 | | FOGMODE_EXP2 | 2 | | FOGMODE_LINEAR | 3 |

fogStart

Find examples in Playground
fogStart: number

Gets or sets the fog start distance to use

see

http://doc.babylonjs.com/babylon101/environment#fog (Default is 0)

forcePointsCloud

Find examples in Playground
forcePointsCloud: boolean

Gets or sets a boolean indicating if all rendering must be done in point cloud

forceShowBoundingBoxes

Find examples in Playground
forceShowBoundingBoxes: boolean

Gets or sets a boolean indicating if all bounding boxes must be rendered

forceWireframe

Find examples in Playground
forceWireframe: boolean

Gets or sets a boolean indicating if all rendering must be done in wireframe

frustumPlanes

Find examples in Playground
frustumPlanes: Plane[]

Gets the list of frustum planes (built from the active camera)

gamepadManager

Find examples in Playground
gamepadManager: GamepadManager

Gets the gamepad manager associated with the scene

see

http://doc.babylonjs.com/how_to/how_to_use_gamepads

geometries

Find examples in Playground
geometries: Geometry[]

The list of geometries used in the scene.

geometryBufferRenderer

Find examples in Playground
geometryBufferRenderer: Nullable<GeometryBufferRenderer>

Gets or Sets the current geometry buffer associated to the scene.

getActiveMeshCandidates

Find examples in Playground
getActiveMeshCandidates: function

Lambda returning the list of potentially active meshes.

Type declaration

getActiveSubMeshCandidates

Find examples in Playground
getActiveSubMeshCandidates: function

Lambda returning the list of potentially active sub meshes.

Type declaration

getCollidingSubMeshCandidates

Find examples in Playground
getCollidingSubMeshCandidates: function

Lambda returning the list of potentially colliding sub meshes.

Type declaration

getDeterministicFrameTime

Find examples in Playground
getDeterministicFrameTime: function

User updatable function that will return a deterministic frame time when engine is in deterministic lock step mode

Type declaration

    • (): number
    • Returns number

getIntersectingSubMeshCandidates

Find examples in Playground
getIntersectingSubMeshCandidates: function

Lambda returning the list of potentially intersecting sub meshes.

Type declaration

gravity

Find examples in Playground
gravity: Vector3

Defines the gravity applied to this scene (used only for collisions)

see

http://doc.babylonjs.com/babylon101/cameras,_mesh_collisions_and_gravity

headphone

Find examples in Playground
headphone: boolean

Gets or sets if audio will be output to headphones

see

http://doc.babylonjs.com/how_to/playing_sounds_and_music

hoverCursor

Find examples in Playground
hoverCursor: string

Defines the HTML cursor to use when hovering over interactive elements

imageProcessingConfiguration

Find examples in Playground
imageProcessingConfiguration: ImageProcessingConfiguration

Default image processing configuration used either in the rendering Forward main pass or through the imageProcessingPostProcess if present. As in the majority of the scene they are the same (exception for multi camera), this is easier to reference from here than from all the materials and post process.

No setter as we it is a shared configuration, you can set the values instead.

importedMeshesFiles

Find examples in Playground
importedMeshesFiles: String[]

Gets the list of meshes imported to the scene through SceneLoader

isDisposed

Find examples in Playground
isDisposed: boolean

Gets if the scene is already disposed

isLoading

Find examples in Playground
isLoading: boolean

Returns a boolean indicating if the scene is still loading data

layers

Find examples in Playground
layers: Array<Layer>

The list of layers (background and foreground) of the scene

lensFlareSystems

Find examples in Playground
lensFlareSystems: Array<LensFlareSystem>

The list of lens flare system added to the scene

see

http://doc.babylonjs.com/how_to/how_to_use_lens_flares

lensFlaresEnabled

Find examples in Playground
lensFlaresEnabled: boolean

Gets or sets a boolean indicating if lens flares are enabled on this scene

lights

Find examples in Playground
lights: Light[]

All of the lights added to this scene

see

http://doc.babylonjs.com/babylon101/lights

lightsEnabled

Find examples in Playground
lightsEnabled: boolean

Gets or sets a boolean indicating if lights are enabled on this scene

loadingPluginName

Find examples in Playground
loadingPluginName: string

Gets the name of the plugin used to load this scene (null by default)

mainSoundTrack

Find examples in Playground
mainSoundTrack: SoundTrack

The main sound track played by the scene. It cotains your primary collection of sounds.

materials

Find examples in Playground
materials: Material[]

All of the materials added to this scene In the context of a Scene, it is not supposed to be modified manually. Any addition or removal should be done using the addMaterial and removeMAterial Scene methods. Note also that the order of the Material wihin the array is not significant and might change.

see

http://doc.babylonjs.com/babylon101/materials

meshUnderPointer

Find examples in Playground
meshUnderPointer: Nullable<AbstractMesh>

Gets the mesh that is currently under the pointer

meshes

Find examples in Playground
meshes: AbstractMesh[]

All of the (abstract) meshes added to this scene

metadata

Find examples in Playground
metadata: any

Gets or sets user defined metadata

morphTargetManagers

Find examples in Playground
morphTargetManagers: MorphTargetManager[]

The list of morph target managers added to the scene

see

http://doc.babylonjs.com/how_to/how_to_dynamically_morph_a_mesh

multiMaterials

Find examples in Playground
multiMaterials: MultiMaterial[]

All of the multi-materials added to this scene

see

http://doc.babylonjs.com/how_to/multi_materials

offlineProvider

Find examples in Playground
offlineProvider: IOfflineProvider

Gets or sets the current offline provider to use to store scene data

see

http://doc.babylonjs.com/how_to/caching_resources_in_indexeddb

onActiveCameraChanged

Find examples in Playground
onActiveCameraChanged: Observable<Scene>

An event triggered when the activeCamera property is updated

onAfterActiveMeshesEvaluationObservable

Find examples in Playground
onAfterActiveMeshesEvaluationObservable: Observable<Scene>

An event triggered when active meshes evaluation is done

onAfterAnimationsObservable

Find examples in Playground
onAfterAnimationsObservable: Observable<Scene>

An event triggered after animations processing

onAfterCameraRenderObservable

Find examples in Playground
onAfterCameraRenderObservable: Observable<Camera>

An event triggered after rendering a camera

onAfterDrawPhaseObservable

Find examples in Playground
onAfterDrawPhaseObservable: Observable<Scene>

An event triggered after draw calls have been sent

onAfterParticlesRenderingObservable

Find examples in Playground
onAfterParticlesRenderingObservable: Observable<Scene>

An event triggered when particles rendering is done Note: This event can be trigger more than once per frame (because particles can be rendered by render target textures as well)

onAfterPhysicsObservable

Find examples in Playground
onAfterPhysicsObservable: Observable<Scene>

An event triggered when physic simulation has been done

onAfterRenderObservable

Find examples in Playground
onAfterRenderObservable: Observable<Scene>

An event triggered after rendering the scene

onAfterRenderTargetsRenderObservable

Find examples in Playground
onAfterRenderTargetsRenderObservable: Observable<Scene>

An event triggered when render targets were rendered. Can happen multiple times per frame.

onAfterRenderingGroupObservable

Find examples in Playground
onAfterRenderingGroupObservable: Observable<RenderingGroupInfo>

This Observable will be triggered after rendering each renderingGroup of each rendered camera. The RenderinGroupInfo class contains all the information about the context in which the observable is called If you wish to register an Observer only for a given set of renderingGroup, use the mask with a combination of the renderingGroup index elevated to the power of two (1 for renderingGroup 0, 2 for renderingrOup1, 4 for 2 and 8 for 3)

onAfterSpritesRenderingObservable

Find examples in Playground
onAfterSpritesRenderingObservable: Observable<Scene>

An event triggered when sprites rendering is done Note: This event can be trigger more than once per frame (because sprites can be rendered by render target textures as well)

onAfterStepObservable

Find examples in Playground
onAfterStepObservable: Observable<Scene>

An event triggered after calculating deterministic simulation step

onBeforeActiveMeshesEvaluationObservable

Find examples in Playground
onBeforeActiveMeshesEvaluationObservable: Observable<Scene>

An event triggered when active meshes evaluation is about to start

onBeforeAnimationsObservable

Find examples in Playground
onBeforeAnimationsObservable: Observable<Scene>

An event triggered before animating the scene

onBeforeCameraRenderObservable

Find examples in Playground
onBeforeCameraRenderObservable: Observable<Camera>

An event triggered before rendering a camera

onBeforeDrawPhaseObservable

Find examples in Playground
onBeforeDrawPhaseObservable: Observable<Scene>

An event triggered before draw calls are ready to be sent

onBeforeParticlesRenderingObservable

Find examples in Playground
onBeforeParticlesRenderingObservable: Observable<Scene>

An event triggered when particles rendering is about to start Note: This event can be trigger more than once per frame (because particles can be rendered by render target textures as well)

onBeforePhysicsObservable

Find examples in Playground
onBeforePhysicsObservable: Observable<Scene>

An event triggered when physic simulation is about to be run

onBeforeRenderObservable

Find examples in Playground
onBeforeRenderObservable: Observable<Scene>

An event triggered before rendering the scene (right after animations and physics)

onBeforeRenderTargetsRenderObservable

Find examples in Playground
onBeforeRenderTargetsRenderObservable: Observable<Scene>

An event triggered when render targets are about to be rendered Can happen multiple times per frame.

onBeforeRenderingGroupObservable

Find examples in Playground
onBeforeRenderingGroupObservable: Observable<RenderingGroupInfo>

This Observable will be triggered before rendering each renderingGroup of each rendered camera. The RenderinGroupInfo class contains all the information about the context in which the observable is called If you wish to register an Observer only for a given set of renderingGroup, use the mask with a combination of the renderingGroup index elevated to the power of two (1 for renderingGroup 0, 2 for renderingrOup1, 4 for 2 and 8 for 3)

onBeforeSpritesRenderingObservable

Find examples in Playground
onBeforeSpritesRenderingObservable: Observable<Scene>

An event triggered when sprites rendering is about to start Note: This event can be trigger more than once per frame (because sprites can be rendered by render target textures as well)

onBeforeStepObservable

Find examples in Playground
onBeforeStepObservable: Observable<Scene>

An event triggered before calculating deterministic simulation step

onCameraRemovedObservable

Find examples in Playground
onCameraRemovedObservable: Observable<Camera>

An event triggered when a camera is removed

onDataLoadedObservable

Find examples in Playground
onDataLoadedObservable: Observable<Scene>

An event triggered when SceneLoader.Append or SceneLoader.Load or SceneLoader.ImportMesh were successfully executed

onDispose

Find examples in Playground
onDispose: function

Sets a function to be executed when this scene is disposed.

Type declaration

    • (): void
    • Returns void

onDisposeObservable

Find examples in Playground
onDisposeObservable: Observable<Scene>

An event triggered when the scene is disposed.

onGeometryRemovedObservable

Find examples in Playground
onGeometryRemovedObservable: Observable<Geometry>

An event triggered when a geometry is removed

onKeyboardObservable

Find examples in Playground
onKeyboardObservable: Observable<KeyboardInfo>

Observable event triggered each time an keyboard event is received from the hosting window

onLightRemovedObservable

Find examples in Playground
onLightRemovedObservable: Observable<Light>

An event triggered when a light is removed

onMaterialRemovedObservable

Find examples in Playground
onMaterialRemovedObservable: Observable<Material>

An event triggered when a material is removed

onMeshImportedObservable

Find examples in Playground
onMeshImportedObservable: Observable<AbstractMesh>

This Observable will when a mesh has been imported into the scene.

onMeshRemovedObservable

Find examples in Playground
onMeshRemovedObservable: Observable<AbstractMesh>

An event triggered when a mesh is removed

onNewCameraAddedObservable

Find examples in Playground
onNewCameraAddedObservable: Observable<Camera>

An event triggered when a camera is created

onNewGeometryAddedObservable

Find examples in Playground
onNewGeometryAddedObservable: Observable<Geometry>

An event triggered when a geometry is created

onNewLightAddedObservable

Find examples in Playground
onNewLightAddedObservable: Observable<Light>

An event triggered when a light is created

onNewMaterialAddedObservable

Find examples in Playground
onNewMaterialAddedObservable: Observable<Material>

An event triggered when a material is created

onNewMeshAddedObservable

Find examples in Playground
onNewMeshAddedObservable: Observable<AbstractMesh>

An event triggered when a mesh is created

onNewTextureAddedObservable

Find examples in Playground
onNewTextureAddedObservable: Observable<BaseTexture>

An event triggered when a texture is created

onNewTransformNodeAddedObservable

Find examples in Playground
onNewTransformNodeAddedObservable: Observable<TransformNode>

An event triggered when a transform node is created

onPointerDown

Find examples in Playground
onPointerDown: function

Callback called when a pointer down is detected

Type declaration

onPointerMove

Find examples in Playground
onPointerMove: function

Callback called when a pointer move is detected

Type declaration

onPointerObservable

Find examples in Playground
onPointerObservable: Observable<PointerInfo>

Observable event triggered each time an input event is received from the rendering canvas

onPointerPick

Find examples in Playground
onPointerPick: function

Callback called when a pointer pick is detected

Type declaration

    • Parameters

      Returns void

onPointerUp

Find examples in Playground
onPointerUp: function

Callback called when a pointer up is detected

Type declaration

onPreKeyboardObservable

Find examples in Playground
onPreKeyboardObservable: Observable<KeyboardInfoPre>

This observable event is triggered when any keyboard event si raised and registered during Scene.attachControl() You have the possibility to skip the process and the call to onKeyboardObservable by setting KeyboardInfoPre.skipOnPointerObservable to true

onPrePointerObservable

Find examples in Playground
onPrePointerObservable: Observable<PointerInfoPre>

This observable event is triggered when any ponter event is triggered. It is registered during Scene.attachControl() and it is called BEFORE the 3D engine process anything (mesh/sprite picking for instance). You have the possibility to skip the process and the call to onPointerObservable by setting PointerInfoPre.skipOnPointerObservable to true

onReadyObservable

Find examples in Playground
onReadyObservable: Observable<Scene>

An event triggered when the scene is ready

onTextureRemovedObservable

Find examples in Playground
onTextureRemovedObservable: Observable<BaseTexture>

An event triggered when a texture is removed

onTransformNodeRemovedObservable

Find examples in Playground
onTransformNodeRemovedObservable: Observable<TransformNode>

An event triggered when a transform node is removed

particleSystems

Find examples in Playground
particleSystems: IParticleSystem[]

All of the particle systems added to this scene

see

http://doc.babylonjs.com/babylon101/particles

particlesEnabled

Find examples in Playground
particlesEnabled: boolean

Gets or sets a boolean indicating if particles are enabled on this scene

pointerDownPredicate

Find examples in Playground
pointerDownPredicate: function

Gets or sets a predicate used to select candidate meshes for a pointer down event

Type declaration

pointerMovePredicate

Find examples in Playground
pointerMovePredicate: function

Gets or sets a predicate used to select candidate meshes for a pointer move event

Type declaration

pointerUpPredicate

Find examples in Playground
pointerUpPredicate: function

Gets or sets a predicate used to select candidate meshes for a pointer up event

Type declaration

pointerX

Find examples in Playground
pointerX: number

Gets the current on-screen X position of the pointer

pointerY

Find examples in Playground
pointerY: number

Gets the current on-screen Y position of the pointer

postProcessManager

Find examples in Playground
postProcessManager: PostProcessManager

Gets the current postprocess manager

postProcessRenderPipelineManager

Find examples in Playground
postProcessRenderPipelineManager: PostProcessRenderPipelineManager

postProcesses

Find examples in Playground
postProcesses: PostProcess[]

The list of postprocesses added to the scene

postProcessesEnabled

Find examples in Playground
postProcessesEnabled: boolean

Gets or sets a boolean indicating if postprocesses are enabled on this scene

preventDefaultOnPointerDown

Find examples in Playground
preventDefaultOnPointerDown: boolean

This is used to call preventDefault() on pointer down in order to block unwanted artifacts like system double clicks

preventDefaultOnPointerUp

Find examples in Playground
preventDefaultOnPointerUp: boolean

This is used to call preventDefault() on pointer up in order to block unwanted artifacts like system double clicks

probesEnabled

Find examples in Playground
probesEnabled: boolean

Gets or sets a boolean indicating if probes are enabled on this scene

proceduralTextures

Find examples in Playground
proceduralTextures: Array<ProceduralTexture>

The list of procedural textures added to the scene

see

http://doc.babylonjs.com/how_to/how_to_use_procedural_textures

proceduralTexturesEnabled

Find examples in Playground
proceduralTexturesEnabled: boolean

Gets or sets a boolean indicating if procedural textures are enabled on this scene

reflectionProbes

Find examples in Playground
reflectionProbes: Array<ReflectionProbe>

The list of reflection probes added to the scene

see

http://doc.babylonjs.com/how_to/how_to_use_reflection_probes

renderTargetsEnabled

Find examples in Playground
renderTargetsEnabled: boolean

Gets or sets a boolean indicating if render targets are enabled on this scene

requireLightSorting

Find examples in Playground
requireLightSorting: boolean

Gets or sets a boolean indicating if lights must be sorted by priority (off by default) This is useful if there are more lights that the maximum simulteanous authorized

reservedDataStore

Find examples in Playground
reservedDataStore: any

For internal use only. Please do not use.

rootNodes

Find examples in Playground
rootNodes: Node[]

Gets the list of root nodes (ie. nodes with no parent)

selectionOctree

Find examples in Playground
selectionOctree: Octree<AbstractMesh>

Gets the octree used to boost mesh selection (picking)

see

http://doc.babylonjs.com/how_to/optimizing_your_scene_with_octrees

shadowsEnabled

Find examples in Playground
shadowsEnabled: boolean

Gets or sets a boolean indicating if shadows are enabled on this scene

simplificationQueue

Find examples in Playground
simplificationQueue: SimplificationQueue

Gets or sets the simplification queue attached to the scene

see

http://doc.babylonjs.com/how_to/in-browser_mesh_simplification

skeletons

Find examples in Playground
skeletons: Skeleton[]

The list of skeletons added to the scene

see

http://doc.babylonjs.com/how_to/how_to_use_bones_and_skeletons

skeletonsEnabled

Find examples in Playground
skeletonsEnabled: boolean

Gets or sets a boolean indicating if skeletons are enabled on this scene

soundTracks

Find examples in Playground
soundTracks: Nullable<Array<SoundTrack>>

The list of sound tracks added to the scene

see

http://doc.babylonjs.com/how_to/playing_sounds_and_music

sounds

Find examples in Playground
sounds: Nullable<Array<Sound>>

The list of sounds used in the scene.

spriteManagers

Find examples in Playground
spriteManagers: Array<ISpriteManager>

All of the sprite managers added to this scene

see

http://doc.babylonjs.com/babylon101/sprites

spritesEnabled

Find examples in Playground
spritesEnabled: boolean

Gets or sets a boolean indicating if sprites are enabled on this scene

textures

Find examples in Playground
textures: BaseTexture[]

Textures to keep.

texturesEnabled

Find examples in Playground
texturesEnabled: boolean

Gets or sets a boolean indicating if textures are enabled on this scene

totalActiveIndicesPerfCounter

Find examples in Playground
totalActiveIndicesPerfCounter: PerfCounter

Gets the performance counter for active indices

see

http://doc.babylonjs.com/how_to/optimizing_your_scene#instrumentation

totalVerticesPerfCounter

Find examples in Playground
totalVerticesPerfCounter: PerfCounter

Gets the performance counter for total vertices

see

http://doc.babylonjs.com/how_to/optimizing_your_scene#instrumentation

transformNodes

Find examples in Playground
transformNodes: TransformNode[]

All of the tranform nodes added to this scene In the context of a Scene, it is not supposed to be modified manually. Any addition or removal should be done using the addTransformNode and removeTransformNode Scene methods. Note also that the order of the TransformNode wihin the array is not significant and might change.

see

http://doc.babylonjs.com/how_to/transformnode

uid

Find examples in Playground
uid: string

Return a unique id as a string which can serve as an identifier for the scene

unTranslatedPointer

Find examples in Playground
unTranslatedPointer: Vector2

Gets the pointer coordinates without any translation (ie. straight out of the pointer event)

useConstantAnimationDeltaTime

Find examples in Playground
useConstantAnimationDeltaTime: boolean

Gets or sets a boolean indicating if a constant deltatime has to be used This is mostly useful for testing purposes when you do not want the animations to scale with the framerate

useDelayedTextureLoading

Find examples in Playground
useDelayedTextureLoading: boolean

Defines if texture loading must be delayed If true, textures will only be loaded when they need to be rendered

useRightHandedSystem

Find examples in Playground
useRightHandedSystem: boolean

Gets or sets a boolean indicating if the scene must use right-handed coordinates system

workerCollisions

Find examples in Playground
workerCollisions: boolean

Static DoubleClickDelay

Find examples in Playground
DoubleClickDelay: number

Time in milliseconds with two consecutive clicks will be considered as a double click

Static DragMovementThreshold

Find examples in Playground
DragMovementThreshold: number

The distance in pixel that you have to move to prevent some events

Static ExclusiveDoubleClickMode

Find examples in Playground
ExclusiveDoubleClickMode: boolean

If you need to check double click without raising a single click at first click, enable this flag

Static FOGMODE_EXP

Find examples in Playground
FOGMODE_EXP: number

The fog density is following an exponential function

Static FOGMODE_EXP2

Find examples in Playground
FOGMODE_EXP2: number

The fog density is following an exponential function faster than FOGMODE_EXP

Static FOGMODE_LINEAR

Find examples in Playground
FOGMODE_LINEAR: number

The fog density is following a linear function.

Static FOGMODE_NONE

Find examples in Playground
FOGMODE_NONE: number

The fog is deactivated

Static LongPressDelay

Find examples in Playground
LongPressDelay: number

Time in milliseconds to wait to raise long press events if button is still pressed

Static MaxDeltaTime

Find examples in Playground
MaxDeltaTime: number

Gets or sets the maximum deltatime when deterministic lock step is enabled

see

http://doc.babylonjs.com/babylon101/animations#deterministic-lockstep

Static MinDeltaTime

Find examples in Playground
MinDeltaTime: number

Gets or sets the minimum deltatime when deterministic lock step is enabled

see

http://doc.babylonjs.com/babylon101/animations#deterministic-lockstep

Methods

addActionManager

Find examples in Playground
  • Adds the given action manager to this scene

    Parameters

    Returns void

addAnimation

Find examples in Playground
  • addAnimation(newAnimation: Animation): void
  • Adds the given animation to this scene

    Parameters

    • newAnimation: Animation

      The animation to add

    Returns void

addAnimationGroup

Find examples in Playground
  • Adds the given animation group to this scene.

    Parameters

    Returns void

addCamera

Find examples in Playground
  • addCamera(newCamera: Camera): void
  • Adds the given camera to this scene

    Parameters

    • newCamera: Camera

      The camera to add

    Returns void

addEffectLayer

Find examples in Playground

addExternalData

Find examples in Playground
  • addExternalData<T>(key: string, data: T): boolean
  • Add an externaly attached data from its key. This method call will fail and return false, if such key already exists. If you don't care and just want to get the data no matter what, use the more convenient getOrAddExternalDataWithFactory() method.

    Type parameters

    • T

    Parameters

    • key: string

      the unique key that identifies the data

    • data: T

      the data object to associate to the key for this Engine instance

    Returns boolean

    true if no such key were already present and the data was added successfully, false otherwise

addGeometry

Find examples in Playground
  • addGeometry(newGeometry: Geometry): void
  • Adds the given geometry to this scene

    Parameters

    • newGeometry: Geometry

      The geometry to add

    Returns void

addLensFlareSystem

Find examples in Playground

addLight

Find examples in Playground
  • addLight(newLight: Light): void
  • Adds the given light to this scene

    Parameters

    • newLight: Light

      The light to add

    Returns void

addMaterial

Find examples in Playground
  • addMaterial(newMaterial: Material): void
  • Adds the given material to this scene

    Parameters

    • newMaterial: Material

      The material to add

    Returns void

addMesh

Find examples in Playground
  • Add a mesh to the list of scene's meshes

    Parameters

    • newMesh: AbstractMesh

      defines the mesh to add

    • Optional recursive: boolean

      if all child meshes should also be added to the scene

    Returns void

addMorphTargetManager

Find examples in Playground
  • Adds the given morph target to this scene

    Parameters

    Returns void

addMultiMaterial

Find examples in Playground
  • Adds the given multi-material to this scene

    Parameters

    Returns void

addParticleSystem

Find examples in Playground
  • Adds the given particle system to this scene

    Parameters

    Returns void

addReflectionProbe

Find examples in Playground

addSkeleton

Find examples in Playground
  • addSkeleton(newSkeleton: Skeleton): void
  • Adds the given skeleton to this scene

    Parameters

    • newSkeleton: Skeleton

      The skeleton to add

    Returns void

addTexture

Find examples in Playground
  • Adds the given texture to this scene.

    Parameters

    Returns void

addTransformNode

Find examples in Playground
  • Add a transform node to the list of scene's transform nodes

    Parameters

    • newTransformNode: TransformNode

      defines the transform node to add

    Returns void

attachControl

Find examples in Playground
  • attachControl(attachUp?: boolean, attachDown?: boolean, attachMove?: boolean): void
  • Attach events to the canvas (To handle actionManagers triggers and raise onPointerMove, onPointerDown and onPointerUp

    Parameters

    • Optional attachUp: boolean

      defines if you want to attach events to pointerup

    • Optional attachDown: boolean

      defines if you want to attach events to pointerdown

    • Optional attachMove: boolean

      defines if you want to attach events to pointermove

    Returns void

beginAnimation

Find examples in Playground
  • beginAnimation(target: any, from: number, to: number, loop?: boolean, speedRatio?: number, onAnimationEnd?: function, animatable?: Animatable, stopCurrent?: boolean, targetMask?: function): Animatable
  • Will start the animation sequence of a given target

    Parameters

    • target: any

      defines the target

    • from: number

      defines from which frame should animation start

    • to: number

      defines until which frame should animation run.

    • Optional loop: boolean

      defines if the animation loops

    • Optional speedRatio: number

      defines the speed in which to run the animation (1.0 by default)

    • Optional onAnimationEnd: function

      defines the function to be executed when the animation ends

        • (): void
        • Returns void

    • Optional animatable: Animatable

      defines an animatable object. If not provided a new one will be created from the given params

    • Optional stopCurrent: boolean

      defines if the current animations must be stopped first (true by default)

    • Optional targetMask: function

      defines if the target should be animated if animations are present (this is called recursively on descendant animatables regardless of return value)

        • (target: any): boolean
        • Parameters

          • target: any

          Returns boolean

    Returns Animatable

    the animatable object created for this animation

beginDirectAnimation

Find examples in Playground
  • beginDirectAnimation(target: any, animations: Animation[], from: number, to: number, loop?: boolean, speedRatio?: number, onAnimationEnd?: function): Animatable
  • Begin a new animation on a given node

    Parameters

    • target: any

      defines the target where the animation will take place

    • animations: Animation[]

      defines the list of animations to start

    • from: number

      defines the initial value

    • to: number

      defines the final value

    • Optional loop: boolean

      defines if you want animation to loop (off by default)

    • Optional speedRatio: number

      defines the speed ratio to apply to all animations

    • Optional onAnimationEnd: function

      defines the callback to call when an animation ends (will be called once per node)

        • (): void
        • Returns void

    Returns Animatable

    the list of created animatables

beginDirectHierarchyAnimation

Find examples in Playground
  • beginDirectHierarchyAnimation(target: Node, directDescendantsOnly: boolean, animations: Animation[], from: number, to: number, loop?: boolean, speedRatio?: number, onAnimationEnd?: function): Animatable[]
  • Begin a new animation on a given node and its hierarchy

    Parameters

    • target: Node

      defines the root node where the animation will take place

    • directDescendantsOnly: boolean

      if true only direct descendants will be used, if false direct and also indirect (children of children, an so on in a recursive manner) descendants will be used.

    • animations: Animation[]

      defines the list of animations to start

    • from: number

      defines the initial value

    • to: number

      defines the final value

    • Optional loop: boolean

      defines if you want animation to loop (off by default)

    • Optional speedRatio: number

      defines the speed ratio to apply to all animations

    • Optional onAnimationEnd: function

      defines the callback to call when an animation ends (will be called once per node)

        • (): void
        • Returns void

    Returns Animatable[]

    the list of animatables created for all nodes

beginHierarchyAnimation

Find examples in Playground
  • beginHierarchyAnimation(target: any, directDescendantsOnly: boolean, from: number, to: number, loop?: boolean, speedRatio?: number, onAnimationEnd?: function, animatable?: Animatable, stopCurrent?: boolean, targetMask?: function): Animatable[]
  • Will start the animation sequence of a given target and its hierarchy

    Parameters

    • target: any

      defines the target

    • directDescendantsOnly: boolean

      if true only direct descendants will be used, if false direct and also indirect (children of children, an so on in a recursive manner) descendants will be used.

    • from: number

      defines from which frame should animation start

    • to: number

      defines until which frame should animation run.

    • Optional loop: boolean

      defines if the animation loops

    • Optional speedRatio: number

      defines the speed in which to run the animation (1.0 by default)

    • Optional onAnimationEnd: function

      defines the function to be executed when the animation ends

        • (): void
        • Returns void

    • Optional animatable: Animatable

      defines an animatable object. If not provided a new one will be created from the given params

    • Optional stopCurrent: boolean

      defines if the current animations must be stopped first (true by default)

    • Optional targetMask: function

      defines if the target should be animated if animations are present (this is called recursively on descendant animatables regardless of return value)

        • (target: any): boolean
        • Parameters

          • target: any

          Returns boolean

    Returns Animatable[]

    the list of created animatables

beginWeightedAnimation

Find examples in Playground
  • beginWeightedAnimation(target: any, from: number, to: number, weight?: number, loop?: boolean, speedRatio?: number, onAnimationEnd?: function, animatable?: Animatable, targetMask?: function): Animatable
  • Will start the animation sequence of a given target

    Parameters

    • target: any

      defines the target

    • from: number

      defines from which frame should animation start

    • to: number

      defines until which frame should animation run.

    • Optional weight: number

      defines the weight to apply to the animation (1.0 by default)

    • Optional loop: boolean

      defines if the animation loops

    • Optional speedRatio: number

      defines the speed in which to run the animation (1.0 by default)

    • Optional onAnimationEnd: function

      defines the function to be executed when the animation ends

        • (): void
        • Returns void

    • Optional animatable: Animatable

      defines an animatable object. If not provided a new one will be created from the given params

    • Optional targetMask: function

      defines if the target should be animated if animations are present (this is called recursively on descendant animatables regardless of return value)

        • (target: any): boolean
        • Parameters

          • target: any

          Returns boolean

    Returns Animatable

    the animatable object created for this animation

cleanCachedTextureBuffer

Find examples in Playground
  • cleanCachedTextureBuffer(): void
  • This function will remove the local cached buffer data from texture. It will save memory but will prevent the texture from being rebuilt

    Returns void

clearCachedVertexData

Find examples in Playground
  • clearCachedVertexData(): void
  • Call this function to reduce memory footprint of the scene. Vertex buffers will not store CPU data anymore (this will prevent picking, collisions or physics to work correctly)

    Returns void

createDefaultCamera

Find examples in Playground
  • createDefaultCamera(createArcRotateCamera?: boolean, replace?: boolean, attachCameraControls?: boolean): void
  • Creates a default camera for the scene.

    see

    http://doc.babylonjs.com/How_To/Fast_Build#create-default-camera

    Parameters

    • Optional createArcRotateCamera: boolean

      has the default false which creates a free camera, when true creates an arc rotate camera

    • Optional replace: boolean

      has default false, when true replaces the active camera in the scene

    • Optional attachCameraControls: boolean

      has default false, when true attaches camera controls to the canvas.

    Returns void

createDefaultCameraOrLight

Find examples in Playground
  • createDefaultCameraOrLight(createArcRotateCamera?: boolean, replace?: boolean, attachCameraControls?: boolean): void
  • Creates a default camera and a default light.

    see

    http://doc.babylonjs.com/how_to/Fast_Build#create-default-camera-or-light

    Parameters

    • Optional createArcRotateCamera: boolean

      has the default false which creates a free camera, when true creates an arc rotate camera

    • Optional replace: boolean

      has the default false, when true replaces the active camera/light in the scene

    • Optional attachCameraControls: boolean

      has the default false, when true attaches camera controls to the canvas.

    Returns void

createDefaultEnvironment

Find examples in Playground

createDefaultLight

Find examples in Playground
  • createDefaultLight(replace?: boolean): void

createDefaultSkybox

Find examples in Playground
  • createDefaultSkybox(environmentTexture?: BaseTexture, pbr?: boolean, scale?: number, blur?: number, setGlobalEnvTexture?: boolean): Nullable<Mesh>
  • Parameters

    • Optional environmentTexture: BaseTexture

      defines the texture to use as environment texture

    • Optional pbr: boolean

      has default false which requires the StandardMaterial to be used, when true PBRMaterial must be used

    • Optional scale: number

      defines the overall scale of the skybox

    • Optional blur: number

      is only available when pbr is true, default is 0, no blur, maximum value is 1

    • Optional setGlobalEnvTexture: boolean

      has default true indicating that scene.environmentTexture must match the current skybox texture

    Returns Nullable<Mesh>

    a new mesh holding the sky box

createDefaultVRExperience

Find examples in Playground

createDefaultXRExperienceAsync

Find examples in Playground

createOrUpdateSelectionOctree

Find examples in Playground
  • createOrUpdateSelectionOctree(maxCapacity?: number, maxDepth?: number): Octree<AbstractMesh>

createPickingRay

Find examples in Playground
  • Creates a ray that can be used to pick in the scene

    Parameters

    • x: number

      defines the x coordinate of the origin (on-screen)

    • y: number

      defines the y coordinate of the origin (on-screen)

    • world: Matrix

      defines the world matrix to use if you want to pick in object space (instead of world space)

    • camera: Nullable<Camera>

      defines the camera to use for the picking

    • Optional cameraViewSpace: boolean

      defines if picking will be done in view space (false by default)

    Returns Ray

    a Ray

createPickingRayInCameraSpace

Find examples in Playground
  • createPickingRayInCameraSpace(x: number, y: number, camera?: Camera): Ray
  • Creates a ray that can be used to pick in the scene

    Parameters

    • x: number

      defines the x coordinate of the origin (on-screen)

    • y: number

      defines the y coordinate of the origin (on-screen)

    • Optional camera: Camera

      defines the camera to use for the picking

    Returns Ray

    a Ray

createPickingRayInCameraSpaceToRef

Find examples in Playground
  • createPickingRayInCameraSpaceToRef(x: number, y: number, result: Ray, camera?: Camera): Scene
  • Creates a ray that can be used to pick in the scene

    Parameters

    • x: number

      defines the x coordinate of the origin (on-screen)

    • y: number

      defines the y coordinate of the origin (on-screen)

    • result: Ray

      defines the ray where to store the picking ray

    • Optional camera: Camera

      defines the camera to use for the picking

    Returns Scene

    the current scene

createPickingRayToRef

Find examples in Playground
  • Creates a ray that can be used to pick in the scene

    Parameters

    • x: number

      defines the x coordinate of the origin (on-screen)

    • y: number

      defines the y coordinate of the origin (on-screen)

    • world: Matrix

      defines the world matrix to use if you want to pick in object space (instead of world space)

    • result: Ray

      defines the ray where to store the picking ray

    • camera: Nullable<Camera>

      defines the camera to use for the picking

    • Optional cameraViewSpace: boolean

      defines if picking will be done in view space (false by default)

    Returns Scene

    the current scene

deleteCompoundImpostor

Find examples in Playground
  • deleteCompoundImpostor(compound: any): void
  • Deletes a physics compound impostor

    Parameters

    • compound: any

      defines the compound to delete

    Returns void

detachControl

Find examples in Playground
  • detachControl(): void
  • Detaches all event handlers

    Returns void

disableDepthRenderer

Find examples in Playground
  • Disables a depth renderer for a given camera

    Parameters

    • Optional camera: Nullable<Camera>

      The camera to disable the depth renderer on (default: scene's active camera)

    Returns void

disableGeometryBufferRenderer

Find examples in Playground
  • disableGeometryBufferRenderer(): void
  • Disables the GeometryBufferRender associated with the scene

    Returns void

disablePhysicsEngine

Find examples in Playground
  • disablePhysicsEngine(): void
  • Disables and disposes the physics engine associated with the scene

    Returns void

dispose

Find examples in Playground
  • dispose(): void
  • Releases all held ressources

    Returns void

enableDepthRenderer

Find examples in Playground
  • Creates a depth renderer a given camera which contains a depth map which can be used for post processing.

    Parameters

    • Optional camera: Nullable<Camera>

      The camera to create the depth renderer on (default: scene's active camera)

    Returns DepthRenderer

    the created depth renderer

enableGeometryBufferRenderer

Find examples in Playground
  • Enables a GeometryBufferRender and associates it with the scene

    Parameters

    • Optional ratio: number

      defines the scaling ratio to apply to the renderer (1 by default which means same resolution)

    Returns Nullable<GeometryBufferRenderer>

    the GeometryBufferRenderer

enablePhysics

Find examples in Playground
  • enablePhysics(gravity: Nullable<Vector3>, plugin?: IPhysicsEnginePlugin): boolean
  • Enables physics to the current scene

    Parameters

    • gravity: Nullable<Vector3>

      defines the scene's gravity for the physics engine

    • Optional plugin: IPhysicsEnginePlugin

      defines the physics engine to be used. defaults to OimoJS.

    Returns boolean

    a boolean indicating if the physics engine was initialized

executeOnceBeforeRender

Find examples in Playground
  • executeOnceBeforeRender(func: function, timeout?: number): void
  • The provided function will run before render once and will be disposed afterwards. A timeout delay can be provided so that the function will be executed in N ms. The timeout is using the browser's native setTimeout so time percision cannot be guaranteed.

    Parameters

    • func: function

      The function to be executed.

        • (): void
        • Returns void

    • Optional timeout: number

      optional delay in ms

    Returns void

executeWhenReady

Find examples in Playground
  • executeWhenReady(func: function): void
  • Registers a function to be executed when the scene is ready

    Parameters

    • func: function

      the function to be executed

        • (): void
        • Returns void

    Returns void

freeActiveMeshes

Find examples in Playground
  • freeActiveMeshes(): void
  • Clear the active meshes smart array preventing retention point in mesh dispose.

    Returns void

freeProcessedMaterials

Find examples in Playground
  • freeProcessedMaterials(): void
  • Clear the processed materials smart array preventing retention point in material dispose.

    Returns void

freeRenderingGroups

Find examples in Playground
  • freeRenderingGroups(): void
  • Clear the info related to rendering groups preventing retention points during dispose.

    Returns void

freezeActiveMeshes

Find examples in Playground
  • freezeActiveMeshes(): Scene
  • Use this function to stop evaluating active meshes. The current list will be keep alive between frames

    Returns Scene

    the current scene

freezeMaterials

Find examples in Playground
  • freezeMaterials(): void
  • Freeze all materials A frozen material will not be updatable but should be faster to render

    Returns void

getActiveBones

Find examples in Playground
  • getActiveBones(): number
  • Gets the total number of active bones rendered per frame

    Returns number

    the total number of active bones rendered per frame

getActiveIndices

Find examples in Playground
  • getActiveIndices(): number
  • Gets the total number of active indices rendered per frame (You can deduce the number of rendered triangles by dividing this number by 3)

    Returns number

    the total number of active indices rendered per frame

getActiveMeshes

Find examples in Playground

getActiveParticles

Find examples in Playground
  • getActiveParticles(): number
  • Gets the total number of active particles rendered per frame

    Returns number

    the total number of active particles rendered per frame

getAllAnimatablesByTarget

Find examples in Playground
  • getAllAnimatablesByTarget(target: any): Array<Animatable>
  • Gets all animatables associated with a given target

    Parameters

    • target: any

      defines the target to look animatables for

    Returns Array<Animatable>

    an array of Animatables

getAnimatableByTarget

Find examples in Playground
  • Gets the animatable associated with a specific target

    Parameters

    • target: any

      defines the target of the animatable

    Returns Nullable<Animatable>

    the required animatable if found

getAnimationGroupByName

Find examples in Playground
  • get an animation group using its name

    Parameters

    • name: string

      defines the material's name

    Returns Nullable<AnimationGroup>

    the animation group or null if none found.

getAnimationRatio

Find examples in Playground
  • getAnimationRatio(): number
  • Gets the animation ratio (which is 1.0 is the scene renders at 60fps and 2 if the scene renders at 30fps, etc.)

    Returns number

    a number

getAutoClearDepthStencilSetup

Find examples in Playground
  • Gets the current auto clear configuration for one rendering group of the rendering manager.

    Parameters

    • index: number

      the rendering group index to get the information for

    Returns IRenderingManagerAutoClearSetup

    The auto clear setup for the requested rendering group

getBoneByID

Find examples in Playground
  • Gets a bone using its id

    Parameters

    • id: string

      defines the bone's id

    Returns Nullable<Bone>

    the bone or null if not found

getBoneByName

Find examples in Playground
  • Gets a bone using its id

    Parameters

    • name: string

      defines the bone's name

    Returns Nullable<Bone>

    the bone or null if not found

getBoundingBoxRenderer

Find examples in Playground
  • Gets the bounding box renderer associated with the scene

    Returns BoundingBoxRenderer

    a BoundingBoxRenderer

getCachedEffect

Find examples in Playground
  • Gets the cached effect (ie. the latest rendered one)

    Returns Nullable<Effect>

    the cached effect

getCachedMaterial

Find examples in Playground
  • Gets the cached material (ie. the latest rendered one)

    Returns Nullable<Material>

    the cached material

getCachedVisibility

Find examples in Playground
  • getCachedVisibility(): Nullable<number>
  • Gets the cached visibility state (ie. the latest rendered one)

    Returns Nullable<number>

    the cached visibility state

getCameraByID

Find examples in Playground
  • Gets a camera using its id

    Parameters

    • id: string

      defines the id to look for

    Returns Nullable<Camera>

    the camera or null if not found

getCameraByName

Find examples in Playground
  • Gets a camera using its name

    Parameters

    • name: string

      defines the camera's name

    Returns Nullable<Camera>

    the camera or null if none found.

getCameraByUniqueID

Find examples in Playground
  • Gets a camera using its unique id

    Parameters

    • uniqueId: number

      defines the unique id to look for

    Returns Nullable<Camera>

    the camera or null if not found

getCamerasByTags

Find examples in Playground
  • getCamerasByTags(tagsQuery: string, forEach?: function): Camera[]
  • Get a list of cameras by tags

    Parameters

    • tagsQuery: string

      defines the tags query to use

    • Optional forEach: function

      defines a predicate used to filter results

        • Parameters

          Returns void

    Returns Camera[]

    an array of Camera

getEngine

Find examples in Playground
  • Gets the engine associated with the scene

    Returns Engine

    an Engine

getExternalData

Find examples in Playground
  • getExternalData<T>(key: string): Nullable<T>
  • Get an externaly attached data from its key

    Type parameters

    • T

    Parameters

    • key: string

      the unique key that identifies the data

    Returns Nullable<T>

    the associated data, if present (can be null), or undefined if not present

getFrameId

Find examples in Playground
  • getFrameId(): number
  • Gets an unique Id for the current frame

    Returns number

    a number

getGeometries

Find examples in Playground
  • Gets the list of geometries attached to the scene

    Returns Geometry[]

    an array of Geometry

getGeometryByID

Find examples in Playground
  • Gets a geometry using its ID

    Parameters

    • id: string

      defines the geometry's id

    Returns Nullable<Geometry>

    the geometry or null if none found.

getGlowLayerByName

Find examples in Playground
  • Return a the first highlight layer of the scene with a given name.

    Parameters

    • name: string

      The name of the highlight layer to look for.

    Returns Nullable<GlowLayer>

    The highlight layer if found otherwise null.

getHighlightLayerByName

Find examples in Playground

getInternalStep

Find examples in Playground
  • getInternalStep(): number

getLastEntryByID

Find examples in Playground
  • Gets a the last added node (Mesh, Camera, Light) using a given id

    Parameters

    • id: string

      defines the id to search for

    Returns Nullable<Node>

    the found node or null if not found at all

getLastMeshByID

Find examples in Playground
  • Gets a the last added mesh using a given id

    Parameters

    • id: string

      defines the id to search for

    Returns Nullable<AbstractMesh>

    the found mesh or null if not found at all.

getLastSkeletonByID

Find examples in Playground
  • Gets a skeleton using a given id (if many are found, this function will pick the last one)

    Parameters

    • id: string

      defines the id to search for

    Returns Nullable<Skeleton>

    the found skeleton or null if not found at all.

getLensFlareSystemByID

Find examples in Playground

getLensFlareSystemByName

Find examples in Playground

getLightByID

Find examples in Playground
  • Gets a light node using its id

    Parameters

    • id: string

      defines the light's id

    Returns Nullable<Light>

    the light or null if none found.

getLightByName

Find examples in Playground
  • Gets a light node using its name

    Parameters

    • name: string

      defines the the light's name

    Returns Nullable<Light>

    the light or null if none found.

getLightByUniqueID

Find examples in Playground
  • Gets a light node using its scene-generated unique ID

    Parameters

    • uniqueId: number

      defines the light's unique id

    Returns Nullable<Light>

    the light or null if none found.

getLightsByTags

Find examples in Playground
  • getLightsByTags(tagsQuery: string, forEach?: function): Light[]
  • Get a list of lights by tags

    Parameters

    • tagsQuery: string

      defines the tags query to use

    • Optional forEach: function

      defines a predicate used to filter results

        • Parameters

          Returns void

    Returns Light[]

    an array of Light

getMaterialByID

Find examples in Playground
  • get a material using its id

    Parameters

    • id: string

      defines the material's ID

    Returns Nullable<Material>

    the material or null if none found.

getMaterialByName

Find examples in Playground
  • Gets a material using its name

    Parameters

    • name: string

      defines the material's name

    Returns Nullable<Material>

    the material or null if none found.

getMaterialByTags

Find examples in Playground
  • getMaterialByTags(tagsQuery: string, forEach?: function): Material[]
  • Get a list of materials by tags

    Parameters

    • tagsQuery: string

      defines the tags query to use

    • Optional forEach: function

      defines a predicate used to filter results

    Returns Material[]

    an array of Material

getMeshByID

Find examples in Playground
  • Gets the first added mesh found of a given ID

    Parameters

    • id: string

      defines the id to search for

    Returns Nullable<AbstractMesh>

    the mesh found or null if not found at all

getMeshByName

Find examples in Playground
  • Gets a mesh using a given name

    Parameters

    • name: string

      defines the name to search for

    Returns Nullable<AbstractMesh>

    the found mesh or null if not found at all.

getMeshByUniqueID

Find examples in Playground
  • Gets a mesh with its auto-generated unique id

    Parameters

    • uniqueId: number

      defines the unique id to search for

    Returns Nullable<AbstractMesh>

    the found mesh or null if not found at all.

getMeshesByID

Find examples in Playground
  • Gets a list of meshes using their id

    Parameters

    • id: string

      defines the id to search for

    Returns Array<AbstractMesh>

    a list of meshes

getMeshesByTags

Find examples in Playground
  • getMeshesByTags(tagsQuery: string, forEach?: function): Mesh[]
  • Get a list of meshes by tags

    Parameters

    • tagsQuery: string

      defines the tags query to use

    • Optional forEach: function

      defines a predicate used to filter results

    Returns Mesh[]

    an array of Mesh

getMorphTargetById

Find examples in Playground
  • Gets a morph target using a given id (if many are found, this function will pick the first one)

    Parameters

    • id: string

      defines the id to search for

    Returns Nullable<MorphTarget>

    the found morph target or null if not found at all.

getMorphTargetManagerById

Find examples in Playground
  • Gets a morph target manager using a given id (if many are found, this function will pick the last one)

    Parameters

    • id: number

      defines the id to search for

    Returns Nullable<MorphTargetManager>

    the found morph target manager or null if not found at all.

getNodeByID

Find examples in Playground
  • Gets a node (Mesh, Camera, Light) using a given id

    Parameters

    • id: string

      defines the id to search for

    Returns Nullable<Node>

    the found node or null if not found at all

getNodeByName

Find examples in Playground
  • Gets a node (Mesh, Camera, Light) using a given name

    Parameters

    • name: string

      defines the name to search for

    Returns Nullable<Node>

    the found node or null if not found at all.

getOrAddExternalDataWithFactory

Find examples in Playground
  • getOrAddExternalDataWithFactory<T>(key: string, factory: function): T
  • Get an externaly attached data from its key, create it using a factory if it's not already present

    Type parameters

    • T

    Parameters

    • key: string

      the unique key that identifies the data

    • factory: function

      the factory that will be called to create the instance if and only if it doesn't exists

        • (k: string): T
        • Parameters

          • k: string

          Returns T

    Returns T

    the associated data, can be null if the factory returned null.

getOutlineRenderer

Find examples in Playground
  • Gets the outline renderer associated with the scene

    Returns OutlineRenderer

    a OutlineRenderer

getParticleSystemByID

Find examples in Playground
  • Gets a particle system by id

    Parameters

    • id: string

      defines the particle system id

    Returns Nullable<IParticleSystem>

    the corresponding system or null if none found

getPhysicsEngine

Find examples in Playground

getPointerOverMesh

Find examples in Playground
  • Gets the mesh under the pointer

    Returns Nullable<AbstractMesh>

    a Mesh or null if no mesh is under the pointer

getPointerOverSprite

Find examples in Playground
  • Gets the sprite under the pointer

    Returns Nullable<Sprite>

    a Sprite or null if no sprite is under the pointer

getProjectionMatrix

Find examples in Playground
  • getProjectionMatrix(): Matrix
  • Gets the current projection matrix

    Returns Matrix

    a Matrix

getRenderId

Find examples in Playground
  • getRenderId(): number
  • Gets an unique Id for the current render phase

    Returns number

    a number

getSceneUniformBuffer

Find examples in Playground
  • Gets the uniform buffer used to store scene data

    Returns UniformBuffer

    a UniformBuffer

getSkeletonById

Find examples in Playground
  • Gets a skeleton using a given id (if many are found, this function will pick the first one)

    Parameters

    • id: string

      defines the id to search for

    Returns Nullable<Skeleton>

    the found skeleton or null if not found at all.

getSkeletonByName

Find examples in Playground
  • Gets a skeleton using a given name

    Parameters

    • name: string

      defines the name to search for

    Returns Nullable<Skeleton>

    the found skeleton or null if not found at all.

getSoundByName

Find examples in Playground
  • Gets a sound using a given name

    Parameters

    • name: string

      defines the name to search for

    Returns Nullable<Sound>

    the found sound or null if not found at all.

getStepId

Find examples in Playground
  • getStepId(): number

getTotalVertices

Find examples in Playground
  • getTotalVertices(): number
  • Gets the total number of vertices rendered per frame

    Returns number

    the total number of vertices rendered per frame

getTransformMatrix

Find examples in Playground
  • getTransformMatrix(): Matrix
  • Gets the current transform matrix

    Returns Matrix

    a Matrix made of View * Projection

getTransformNodeByID

Find examples in Playground
  • Gets the first added transform node found of a given ID

    Parameters

    • id: string

      defines the id to search for

    Returns Nullable<TransformNode>

    the found transform node or null if not found at all.

getTransformNodeByName

Find examples in Playground
  • Gets a transform node using a given name

    Parameters

    • name: string

      defines the name to search for

    Returns Nullable<TransformNode>

    the found transform node or null if not found at all.

getTransformNodesByID

Find examples in Playground
  • Gets a list of transform nodes using their id

    Parameters

    • id: string

      defines the id to search for

    Returns Array<TransformNode>

    a list of transform nodes

getUniqueId

Find examples in Playground
  • getUniqueId(): number
  • Gets an unique (relatively to the current scene) Id

    Returns number

    an unique number for the scene

getViewMatrix

Find examples in Playground
  • Gets the current view matrix

    Returns Matrix

    a Matrix

getWaitingItemsCount

Find examples in Playground
  • getWaitingItemsCount(): number
  • Returns the number of items waiting to be loaded

    Returns number

    the number of items waiting to be loaded

getWorldExtends

Find examples in Playground
  • getWorldExtends(filterPredicate?: function): object
  • Get the world extend vectors with an optional filter

    Parameters

    • Optional filterPredicate: function

      the predicate - which meshes should be included when calculating the world size

    Returns object

    min and max vectors

incrementRenderId

Find examples in Playground
  • incrementRenderId(): void
  • Call this function if you want to manually increment the render Id

    Returns void

isActiveMesh

Find examples in Playground
  • Gets a boolean indicating if the given mesh is active

    Parameters

    Returns boolean

    true if the mesh is in the active list

isCachedMaterialInvalid

Find examples in Playground
  • isCachedMaterialInvalid(material: Material, effect: Effect, visibility?: number): boolean
  • Gets a boolean indicating if the current material / effect / visibility must be bind again

    Parameters

    • material: Material

      defines the current material

    • effect: Effect

      defines the current effect

    • Optional visibility: number

      defines the current visibility state

    Returns boolean

    true if one parameter is not cached

isPhysicsEnabled

Find examples in Playground
  • isPhysicsEnabled(): boolean
  • Gets a boolean indicating if there is an active physics engine

    Returns boolean

    a boolean indicating if there is an active physics engine

isPointerCaptured

Find examples in Playground
  • isPointerCaptured(pointerId?: number): boolean
  • Gets a boolean indicating if the current pointer event is captured (meaning that the scene has already handled the pointer down)

    Parameters

    • Optional pointerId: number

      defines the pointer id to use in a multi-touch scenario (0 by default)

    Returns boolean

    true if the pointer was captured

isReady

Find examples in Playground
  • isReady(): boolean
  • This function will check if the scene can be rendered (textures are loaded, shaders are compiled) Delay loaded resources are not taking in account

    Returns boolean

    true if all required resources are ready

markAllMaterialsAsDirty

Find examples in Playground
  • markAllMaterialsAsDirty(flag: number, predicate?: function): void
  • Will flag all materials as dirty to trigger new shader compilation

    Parameters

    • flag: number

      defines the flag used to specify which material part must be marked as dirty

    • Optional predicate: function

      If not null, it will be used to specifiy if a material has to be marked as dirty

    Returns void

multiPick

Find examples in Playground
  • Launch a ray to try to pick a mesh in the scene

    Parameters

    • x: number

      X position on screen

    • y: number

      Y position on screen

    • Optional predicate: function

      Predicate function used to determine eligible meshes. Can be set to null. In this case, a mesh must be enabled, visible and with isPickable set to true

    • Optional camera: Camera

      camera to use for computing the picking ray. Can be set to null. In this case, the scene.activeCamera will be used

    Returns Nullable<PickingInfo[]>

    an array of PickingInfo

multiPickWithRay

Find examples in Playground
  • Launch a ray to try to pick a mesh in the scene

    Parameters

    • ray: Ray

      Ray to use

    • predicate: function

      Predicate function used to determine eligible meshes. Can be set to null. In this case, a mesh must be enabled, visible and with isPickable set to true

    Returns Nullable<PickingInfo[]>

    an array of PickingInfo

pick

Find examples in Playground
  • Launch a ray to try to pick a mesh in the scene

    Parameters

    • x: number

      position on screen

    • y: number

      position on screen

    • Optional predicate: function

      Predicate function used to determine eligible meshes. Can be set to null. In this case, a mesh must be enabled, visible and with isPickable set to true

    • Optional fastCheck: boolean

      Launch a fast check only using the bounding boxes. Can be set to null.

    • Optional camera: Nullable<Camera>

      to use for computing the picking ray. Can be set to null. In this case, the scene.activeCamera will be used

    Returns Nullable<PickingInfo>

    a PickingInfo

pickSprite

Find examples in Playground
  • Launch a ray to try to pick a sprite in the scene

    Parameters

    • x: number

      position on screen

    • y: number

      position on screen

    • Optional predicate: function

      Predicate function used to determine eligible sprites. Can be set to null. In this case, a sprite must have isPickable set to true

        • Parameters

          Returns boolean

    • Optional fastCheck: boolean

      Launch a fast check only using the bounding boxes. Can be set to null.

    • Optional camera: Camera

      camera to use for computing the picking ray. Can be set to null. In this case, the scene.activeCamera will be used

    Returns Nullable<PickingInfo>

    a PickingInfo

pickSpriteWithRay

Find examples in Playground
  • Use the given ray to pick a sprite in the scene

    Parameters

    • ray: Ray

      The ray (in world space) to use to pick meshes

    • Optional predicate: function

      Predicate function used to determine eligible sprites. Can be set to null. In this case, a sprite must have isPickable set to true

        • Parameters

          Returns boolean

    • Optional fastCheck: boolean

      Launch a fast check only using the bounding boxes. Can be set to null.

    • Optional camera: Camera

      camera to use. Can be set to null. In this case, the scene.activeCamera will be used

    Returns Nullable<PickingInfo>

    a PickingInfo

pickWithRay

Find examples in Playground
  • Use the given ray to pick a mesh in the scene

    Parameters

    • ray: Ray

      The ray to use to pick meshes

    • Optional predicate: function

      Predicate function used to determine eligible meshes. Can be set to null. In this case, a mesh must have isPickable set to true

    • Optional fastCheck: boolean

      Launch a fast check only using the bounding boxes. Can be set to null

    Returns Nullable<PickingInfo>

    a PickingInfo

pushGeometry

Find examples in Playground
  • pushGeometry(geometry: Geometry, force?: boolean): boolean
  • Add a new geometry to this scene

    Parameters

    • geometry: Geometry

      defines the geometry to be added to the scene.

    • Optional force: boolean

      defines if the geometry must be pushed even if a geometry with this id already exists

    Returns boolean

    a boolean defining if the geometry was added or not

registerAfterRender

Find examples in Playground
  • registerAfterRender(func: function): void
  • Registers a function to be called after every frame render

    Parameters

    • func: function

      defines the function to register

        • (): void
        • Returns void

    Returns void

registerBeforeRender

Find examples in Playground
  • registerBeforeRender(func: function): void
  • Registers a function to be called before every frame render

    Parameters

    • func: function

      defines the function to register

        • (): void
        • Returns void

    Returns void

removeActionManager

Find examples in Playground
  • Removes the given action manager from this scene.

    Parameters

    Returns number

    The index of the removed action manager

removeAnimation

Find examples in Playground
  • removeAnimation(toRemove: Animation): number
  • Remove a animation for the list of scene's animations

    Parameters

    • toRemove: Animation

      defines the animation to remove

    Returns number

    the index where the animation was in the animation list

removeAnimationGroup

Find examples in Playground
  • Removes the given animation group from this scene.

    Parameters

    Returns number

    The index of the removed animation group

removeCamera

Find examples in Playground
  • removeCamera(toRemove: Camera): number
  • Remove a camera for the list of scene's cameras

    Parameters

    • toRemove: Camera

      defines the camera to remove

    Returns number

    the index where the camera was in the camera list

removeEffectLayer

Find examples in Playground
  • Removes the given effect layer from this scene.

    Parameters

    • toRemove: EffectLayer

      defines the effect layer to remove

    Returns number

    the index of the removed effect layer

removeExternalData

Find examples in Playground
  • removeExternalData(key: string): boolean
  • Remove an externaly attached data from the Engine instance

    Parameters

    • key: string

      the unique key that identifies the data

    Returns boolean

    true if the data was successfully removed, false if it doesn't exist

removeGeometry

Find examples in Playground
  • removeGeometry(geometry: Geometry): boolean
  • Removes an existing geometry

    Parameters

    • geometry: Geometry

      defines the geometry to be removed from the scene

    Returns boolean

    a boolean defining if the geometry was removed or not

removeLensFlareSystem

Find examples in Playground

removeLight

Find examples in Playground
  • removeLight(toRemove: Light): number
  • Remove a light for the list of scene's lights

    Parameters

    • toRemove: Light

      defines the light to remove

    Returns number

    the index where the light was in the light list

removeMaterial

Find examples in Playground
  • removeMaterial(toRemove: Material): number
  • Removes the given material from this scene.

    Parameters

    • toRemove: Material

      The material to remove

    Returns number

    The index of the removed material

removeMesh

Find examples in Playground
  • removeMesh(toRemove: AbstractMesh, recursive?: boolean): number
  • Remove a mesh for the list of scene's meshes

    Parameters

    • toRemove: AbstractMesh

      defines the mesh to remove

    • Optional recursive: boolean

      if all child meshes should also be removed from the scene

    Returns number

    the index where the mesh was in the mesh list

removeMorphTargetManager

Find examples in Playground
  • Remove a morph target for the list of scene's morph targets

    Parameters

    Returns number

    the index where the morph target was in the morph target list

removeMultiMaterial

Find examples in Playground
  • Removes the given multi-material from this scene.

    Parameters

    Returns number

    The index of the removed multi-material

removeParticleSystem

Find examples in Playground
  • Remove a particle system for the list of scene's particle systems

    Parameters

    Returns number

    the index where the particle system was in the particle system list

removeReflectionProbe

Find examples in Playground

removeSkeleton

Find examples in Playground
  • removeSkeleton(toRemove: Skeleton): number
  • Remove a skeleton for the list of scene's skeletons

    Parameters

    • toRemove: Skeleton

      defines the skeleton to remove

    Returns number

    the index where the skeleton was in the skeleton list

removeTexture

Find examples in Playground
  • Removes the given texture from this scene.

    Parameters

    Returns number

    The index of the removed texture

removeTransformNode

Find examples in Playground
  • Remove a transform node for the list of scene's transform nodes

    Parameters

    Returns number

    the index where the transform node was in the transform node list

render

Find examples in Playground
  • render(updateCameras?: boolean): void
  • Render the scene

    Parameters

    • Optional updateCameras: boolean

      defines a boolean indicating if cameras must update according to their inputs (true by default)

    Returns void

resetCachedMaterial

Find examples in Playground
  • resetCachedMaterial(): void
  • Resets all cached information relative to material (including effect and visibility)

    Returns void

setActiveCameraByID

Find examples in Playground
  • sets the active camera of the scene using its ID

    Parameters

    • id: string

      defines the camera's ID

    Returns Nullable<Camera>

    the new active camera or null if none found.

setActiveCameraByName

Find examples in Playground
  • sets the active camera of the scene using its name

    Parameters

    • name: string

      defines the camera's name

    Returns Nullable<Camera>

    the new active camera or null if none found.

setDefaultCandidateProviders

Find examples in Playground
  • setDefaultCandidateProviders(): void
  • Sets the default candidate providers for the scene. This sets the getActiveMeshCandidates, getActiveSubMeshCandidates, getIntersectingSubMeshCandidates and getCollidingSubMeshCandidates to their default function

    Returns void

setPointerOverMesh

Find examples in Playground
  • Force the value of meshUnderPointer

    Parameters

    Returns void

setPointerOverSprite

Find examples in Playground
  • Force the sprite under the pointer

    Parameters

    Returns void

setRenderingAutoClearDepthStencil

Find examples in Playground
  • setRenderingAutoClearDepthStencil(renderingGroupId: number, autoClearDepthStencil: boolean, depth?: boolean, stencil?: boolean): void
  • Specifies whether or not the stencil and depth buffer are cleared between two rendering groups.

    Parameters

    • renderingGroupId: number

      The rendering group id corresponding to its index

    • autoClearDepthStencil: boolean

      Automatically clears depth and stencil between groups if true.

    • Optional depth: boolean

      Automatically clears depth between groups if true and autoClear is true.

    • Optional stencil: boolean

      Automatically clears stencil between groups if true and autoClear is true.

    Returns void

setRenderingOrder

Find examples in Playground
  • setRenderingOrder(renderingGroupId: number, opaqueSortCompareFn?: Nullable<function>, alphaTestSortCompareFn?: Nullable<function>, transparentSortCompareFn?: Nullable<function>): void
  • Overrides the default sort function applied in the renderging group to prepare the meshes. This allowed control for front to back rendering or reversly depending of the special needs.

    Parameters

    • renderingGroupId: number

      The rendering group id corresponding to its index

    • Optional opaqueSortCompareFn: Nullable<function>

      The opaque queue comparison function use to sort.

    • Optional alphaTestSortCompareFn: Nullable<function>

      The alpha test queue comparison function use to sort.

    • Optional transparentSortCompareFn: Nullable<function>

      The transparent queue comparison function use to sort.

    Returns void

setStepId

Find examples in Playground
  • setStepId(newStepId: number): void

setTransformMatrix

Find examples in Playground
  • setTransformMatrix(view: Matrix, projection: Matrix): void
  • Sets the current transform matrix

    Parameters

    • view: Matrix

      defines the View matrix to use

    • projection: Matrix

      defines the Projection matrix to use

    Returns void

simulatePointerDown

Find examples in Playground
  • simulatePointerDown(pickResult: PickingInfo, pointerEventInit?: PointerEventInit): Scene
  • Use this method to simulate a pointer down on a mesh The pickResult parameter can be obtained from a scene.pick or scene.pickWithRay

    Parameters

    • pickResult: PickingInfo

      pickingInfo of the object wished to simulate pointer event on

    • Optional pointerEventInit: PointerEventInit

      pointer event state to be used when simulating the pointer event (eg. pointer id for multitouch)

    Returns Scene

    the current scene

simulatePointerMove

Find examples in Playground
  • simulatePointerMove(pickResult: PickingInfo, pointerEventInit?: PointerEventInit): Scene
  • Use this method to simulate a pointer move on a mesh The pickResult parameter can be obtained from a scene.pick or scene.pickWithRay

    Parameters

    • pickResult: PickingInfo

      pickingInfo of the object wished to simulate pointer event on

    • Optional pointerEventInit: PointerEventInit

      pointer event state to be used when simulating the pointer event (eg. pointer id for multitouch)

    Returns Scene

    the current scene

simulatePointerUp

Find examples in Playground
  • simulatePointerUp(pickResult: PickingInfo, pointerEventInit?: PointerEventInit, doubleTap?: boolean): Scene
  • Use this method to simulate a pointer up on a mesh The pickResult parameter can be obtained from a scene.pick or scene.pickWithRay

    Parameters

    • pickResult: PickingInfo

      pickingInfo of the object wished to simulate pointer event on

    • Optional pointerEventInit: PointerEventInit

      pointer event state to be used when simulating the pointer event (eg. pointer id for multitouch)

    • Optional doubleTap: boolean

      indicates that the pointer up event should be considered as part of a double click (false by default)

    Returns Scene

    the current scene

sortLightsByPriority

Find examples in Playground
  • sortLightsByPriority(): void
  • Sorts the list list based on light priorities

    Returns void

stopAllAnimations

Find examples in Playground
  • stopAllAnimations(): void
  • Stops and removes all animations that have been applied to the scene

    Returns void

stopAnimation

Find examples in Playground
  • stopAnimation(target: any, animationName?: string, targetMask?: function): void
  • Will stop the animation of the given target

    Parameters

    • target: any

      the target

    • Optional animationName: string

      the name of the animation to stop (all animations will be stopped if both this and targetMask are empty)

    • Optional targetMask: function

      a function that determines if the animation should be stopped based on its target (all animations will be stopped if both this and animationName are empty)

        • (target: any): boolean
        • Parameters

          • target: any

          Returns boolean

    Returns void

switchActiveCamera

Find examples in Playground
  • switchActiveCamera(newCamera: Camera, attachControl?: boolean): void
  • Switch active camera

    Parameters

    • newCamera: Camera

      defines the new active camera

    • Optional attachControl: boolean

      defines if attachControl must be called for the new active camera (default: true)

    Returns void

unfreezeActiveMeshes

Find examples in Playground
  • unfreezeActiveMeshes(): Scene
  • Use this function to restart evaluating active meshes on every frame

    Returns Scene

    the current scene

unfreezeMaterials

Find examples in Playground
  • unfreezeMaterials(): void
  • Unfreeze all materials A frozen material will not be updatable but should be faster to render

    Returns void

unregisterAfterRender

Find examples in Playground
  • unregisterAfterRender(func: function): void
  • Unregisters a function called after every frame render

    Parameters

    • func: function

      defines the function to unregister

        • (): void
        • Returns void

    Returns void

unregisterBeforeRender

Find examples in Playground
  • unregisterBeforeRender(func: function): void
  • Unregisters a function called before every frame render

    Parameters

    • func: function

      defines the function to unregister

        • (): void
        • Returns void

    Returns void

updateAlternateTransformMatrix

Find examples in Playground
  • updateAlternateTransformMatrix(alternateCamera: Camera): void
  • Defines an alternate camera (used mostly in VR-like scenario where two cameras can render the same scene from a slightly different point of view)

    Parameters

    • alternateCamera: Camera

      defines the camera to use

    Returns void

updateTransformMatrix

Find examples in Playground
  • updateTransformMatrix(force?: boolean): void
  • Update the transform matrix to update from the current active camera

    Parameters

    • Optional force: boolean

      defines a boolean used to force the update even if cache is up to date

    Returns void

whenReadyAsync

Find examples in Playground
  • whenReadyAsync(): Promise<void>
  • Returns a promise that resolves when the scene is ready

    Returns Promise<void>

    A promise that resolves when the scene is ready

Static AddIndividualParser

Find examples in Playground

Static AddParser

Find examples in Playground
  • Adds a parser in the list of available ones

    Parameters

    • name: string

      Defines the name of the parser

    • parser: BabylonFileParser

      Defines the parser to add

    Returns void

Static GetIndividualParser

Find examples in Playground

Static GetParser

Find examples in Playground

Static Parse

Find examples in Playground
  • Parser json data and populate both a scene and its associated container object

    Parameters

    • jsonData: any

      Defines the data to parse

    • scene: Scene

      Defines the scene to parse the data for

    • container: AssetContainer

      Defines the container attached to the parsing sequence

    • rootUrl: string

      Defines the root url of the data

    Returns void

Generated using TypeDoc