Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Scene

Represents a scene to be rendered by the engine.

see

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

Hierarchy

Implements

Index

Constructors

Properties

Accessors

Methods

Constructors

constructor

  • Creates a new Scene

    Parameters

    • engine: Engine

      defines the engine to use to render this scene

    • Optional options: SceneOptions

      defines the scene options

    Returns Scene

Properties

actionManagerSearch playground for actionManager

actionManager: AbstractActionManager

Gets or sets the action manager associated with the scene

see

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

actionManagersSearch playground for actionManagers

actionManagers: AbstractActionManager[]

ActionManagers available on the scene.

activeCamerasSearch playground for activeCameras

activeCameras: Nullable<Camera[]>

All of the active cameras added to this scene.

ambientColorSearch playground for ambientColor

ambientColor: Color3

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

animationGroupsSearch playground for animationGroups

animationGroups: AnimationGroup[]

All of the animation groups added to this scene

see

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

animationTimeScaleSearch playground for animationTimeScale

animationTimeScale: number

Gets or sets a general scale for animation speed

see

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

animationsSearch playground for animations

animations: Animation[]

Gets a list of Animations associated with the scene

animationsEnabledSearch playground for animationsEnabled

animationsEnabled: boolean

Gets or sets a boolean indicating if animations are enabled

audioEnabledSearch playground for audioEnabled

audioEnabled: boolean

Gets or sets if audio support is enabled

see

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

audioListenerPositionProviderSearch playground for audioListenerPositionProvider

audioListenerPositionProvider: Nullable<() => Vector3>

Gets or sets custom audio listener position provider

see

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

audioPositioningRefreshRateSearch playground for audioPositioningRefreshRate

audioPositioningRefreshRate: number

Gets or sets a refresh rate when using 3D audio positioning

autoClearSearch playground for autoClear

autoClear: boolean

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

autoClearDepthAndStencilSearch playground for autoClearDepthAndStencil

autoClearDepthAndStencil: boolean

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

cameraToUseForPointersSearch playground for cameraToUseForPointers

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

camerasSearch playground for cameras

cameras: Camera[]

All of the cameras added to this scene

see

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

clearColorSearch playground for clearColor

clearColor: Color4

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

clipPlaneSearch playground for clipPlane

clipPlane: Nullable<Plane>

Gets or sets the active clipplane 1

clipPlane2Search playground for clipPlane2

clipPlane2: Nullable<Plane>

Gets or sets the active clipplane 2

clipPlane3Search playground for clipPlane3

clipPlane3: Nullable<Plane>

Gets or sets the active clipplane 3

clipPlane4Search playground for clipPlane4

clipPlane4: Nullable<Plane>

Gets or sets the active clipplane 4

clipPlane5Search playground for clipPlane5

clipPlane5: Nullable<Plane>

Gets or sets the active clipplane 5

clipPlane6Search playground for clipPlane6

clipPlane6: Nullable<Plane>

Gets or sets the active clipplane 6

collisionsEnabledSearch playground for collisionsEnabled

collisionsEnabled: boolean

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

see

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

constantlyUpdateMeshUnderPointerSearch playground for constantlyUpdateMeshUnderPointer

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

customLODSelectorSearch playground for customLODSelector

customLODSelector: (mesh: AbstractMesh, camera: Camera) => Nullable<AbstractMesh>

Gets or sets a user defined funtion to select LOD from a mesh and a camera. By default this function is undefined and Babylon.js will select LOD based on distance to camera

Type declaration

customRenderTargetsSearch playground for customRenderTargets

customRenderTargets: RenderTargetTexture[]

The list of user defined render targets added to the scene

debugLayerSearch playground for debugLayer

debugLayer: DebugLayer

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

see

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

defaultCursorSearch playground for defaultCursor

defaultCursor: string

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

deltaTimeSearch playground for deltaTime

deltaTime: number

Gets the current delta time used by animation engine

disableOfflineSupportExceptionRulesSearch playground for disableOfflineSupportExceptionRules

disableOfflineSupportExceptionRules: RegExp[]

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

dispatchAllSubMeshesOfActiveMeshesSearch playground for dispatchAllSubMeshesOfActiveMeshes

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)

doNotHandleCursorsSearch playground for doNotHandleCursors

doNotHandleCursors: boolean

Defines whether cursors are handled by the scene.

dumpNextRenderTargetsSearch playground for dumpNextRenderTargets

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

effectLayersSearch playground for effectLayers

effectLayers: Array<EffectLayer>

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

see

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

see

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

environmentBRDFTextureSearch playground for environmentBRDFTexture

environmentBRDFTexture: BaseTexture

This is use to store the default BRDF lookup for PBR materials in your scene. It should only be one of the following (if not the default embedded one):

fogColorSearch playground for fogColor

fogColor: Color3

Gets or sets the fog color to use

see

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

fogDensitySearch playground for fogDensity

fogDensity: number

Gets or sets the fog density to use

see

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

fogEndSearch playground for fogEnd

fogEnd: number

Gets or sets the fog end distance to use

see

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

fogStartSearch playground for fogStart

fogStart: number

Gets or sets the fog start distance to use

see

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

forceShowBoundingBoxesSearch playground for forceShowBoundingBoxes

forceShowBoundingBoxes: boolean

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

gamepadManagerSearch playground for gamepadManager

gamepadManager: GamepadManager

Gets the gamepad manager associated with the scene

see

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

geometriesSearch playground for geometries

geometries: Geometry[]

The list of geometries used in the scene.

geometryBufferRendererSearch playground for geometryBufferRenderer

geometryBufferRenderer: Nullable<GeometryBufferRenderer>

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

getActiveMeshCandidatesSearch playground for getActiveMeshCandidates

getActiveMeshCandidates: () => ISmartArrayLike<AbstractMesh>

Lambda returning the list of potentially active meshes.

Type declaration

getActiveSubMeshCandidatesSearch playground for getActiveSubMeshCandidates

getActiveSubMeshCandidates: (mesh: AbstractMesh) => ISmartArrayLike<SubMesh>

Lambda returning the list of potentially active sub meshes.

Type declaration

getCollidingSubMeshCandidatesSearch playground for getCollidingSubMeshCandidates

getCollidingSubMeshCandidates: (mesh: AbstractMesh, collider: Collider) => ISmartArrayLike<SubMesh>

Lambda returning the list of potentially colliding sub meshes.

Type declaration

getDeterministicFrameTimeSearch playground for getDeterministicFrameTime

getDeterministicFrameTime: () => number

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

Type declaration

    • (): number
    • Returns number

getIntersectingSubMeshCandidatesSearch playground for getIntersectingSubMeshCandidates

getIntersectingSubMeshCandidates: (mesh: AbstractMesh, localRay: Ray) => ISmartArrayLike<SubMesh>

Lambda returning the list of potentially intersecting sub meshes.

Type declaration

gravitySearch playground for gravity

gravity: Vector3

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

see

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

headphoneSearch playground for headphone

headphone: boolean

Gets or sets if audio will be output to headphones

see

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

hoverCursorSearch playground for hoverCursor

hoverCursor: string

Defines the HTML cursor to use when hovering over interactive elements

importedMeshesFilesSearch playground for importedMeshesFiles

importedMeshesFiles: String[]

Gets the list of meshes imported to the scene through SceneLoader

layersSearch playground for layers

layers: Array<Layer>

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

lensFlareSystemsSearch playground for lensFlareSystems

lensFlareSystems: Array<LensFlareSystem>

The list of lens flare system added to the scene

see

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

lensFlaresEnabledSearch playground for lensFlaresEnabled

lensFlaresEnabled: boolean

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

lightsSearch playground for lights

lights: Light[]

All of the lights added to this scene

see

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

loadingPluginNameSearch playground for loadingPluginName

loadingPluginName: string

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

mainSoundTrackSearch playground for mainSoundTrack

mainSoundTrack: SoundTrack

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

materialsSearch playground for materials

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 within the array is not significant and might change.

see

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

meshesSearch playground for meshes

meshes: AbstractMesh[]

All of the (abstract) meshes added to this scene

metadataSearch playground for metadata

metadata: any

Gets or sets user defined metadata

morphTargetManagersSearch playground for morphTargetManagers

morphTargetManagers: MorphTargetManager[]

The list of morph target managers added to the scene

see

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

multiMaterialsSearch playground for multiMaterials

multiMaterials: MultiMaterial[]

All of the multi-materials added to this scene

see

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

offlineProviderSearch playground for offlineProvider

offlineProvider: IOfflineProvider

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

see

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

onActiveCameraChangedSearch playground for onActiveCameraChanged

onActiveCameraChanged: Observable<Scene>

An event triggered when the activeCamera property is updated

onAfterActiveMeshesEvaluationObservableSearch playground for onAfterActiveMeshesEvaluationObservable

onAfterActiveMeshesEvaluationObservable: Observable<Scene>

An event triggered when active meshes evaluation is done

onAfterAnimationsObservableSearch playground for onAfterAnimationsObservable

onAfterAnimationsObservable: Observable<Scene>

An event triggered after animations processing

onAfterCameraRenderObservableSearch playground for onAfterCameraRenderObservable

onAfterCameraRenderObservable: Observable<Camera>

An event triggered after rendering a camera

onAfterDrawPhaseObservableSearch playground for onAfterDrawPhaseObservable

onAfterDrawPhaseObservable: Observable<Scene>

An event triggered after draw calls have been sent

onAfterParticlesRenderingObservableSearch playground for onAfterParticlesRenderingObservable

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)

onAfterPhysicsObservableSearch playground for onAfterPhysicsObservable

onAfterPhysicsObservable: Observable<Scene>

An event triggered when physic simulation has been done

onAfterRenderCameraObservableSearch playground for onAfterRenderCameraObservable

onAfterRenderCameraObservable: Observable<Camera>

An event triggered after rendering the scene for an active camera (When scene.render is called this will be called after each camera)

onAfterRenderObservableSearch playground for onAfterRenderObservable

onAfterRenderObservable: Observable<Scene>

An event triggered after rendering the scene

onAfterRenderTargetsRenderObservableSearch playground for onAfterRenderTargetsRenderObservable

onAfterRenderTargetsRenderObservable: Observable<Scene>

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

onAfterRenderingGroupObservableSearch playground for onAfterRenderingGroupObservable

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)

onAfterSpritesRenderingObservableSearch playground for onAfterSpritesRenderingObservable

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)

onAfterStepObservableSearch playground for onAfterStepObservable

onAfterStepObservable: Observable<Scene>

An event triggered after calculating deterministic simulation step

onAnimationFileImportedObservableSearch playground for onAnimationFileImportedObservable

onAnimationFileImportedObservable: Observable<Scene>

This Observable will when an animation file has been imported into the scene.

onBeforeActiveMeshesEvaluationObservableSearch playground for onBeforeActiveMeshesEvaluationObservable

onBeforeActiveMeshesEvaluationObservable: Observable<Scene>

An event triggered when active meshes evaluation is about to start

onBeforeAnimationsObservableSearch playground for onBeforeAnimationsObservable

onBeforeAnimationsObservable: Observable<Scene>

An event triggered before animating the scene

onBeforeCameraRenderObservableSearch playground for onBeforeCameraRenderObservable

onBeforeCameraRenderObservable: Observable<Camera>

An event triggered before rendering a camera

onBeforeDrawPhaseObservableSearch playground for onBeforeDrawPhaseObservable

onBeforeDrawPhaseObservable: Observable<Scene>

An event triggered before draw calls are ready to be sent

onBeforeParticlesRenderingObservableSearch playground for onBeforeParticlesRenderingObservable

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)

onBeforePhysicsObservableSearch playground for onBeforePhysicsObservable

onBeforePhysicsObservable: Observable<Scene>

An event triggered when physic simulation is about to be run

onBeforeRenderObservableSearch playground for onBeforeRenderObservable

onBeforeRenderObservable: Observable<Scene>

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

onBeforeRenderTargetsRenderObservableSearch playground for onBeforeRenderTargetsRenderObservable

onBeforeRenderTargetsRenderObservable: Observable<Scene>

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

onBeforeRenderingGroupObservableSearch playground for onBeforeRenderingGroupObservable

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)

onBeforeSpritesRenderingObservableSearch playground for onBeforeSpritesRenderingObservable

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)

onBeforeStepObservableSearch playground for onBeforeStepObservable

onBeforeStepObservable: Observable<Scene>

An event triggered before calculating deterministic simulation step

onCameraRemovedObservableSearch playground for onCameraRemovedObservable

onCameraRemovedObservable: Observable<Camera>

An event triggered when a camera is removed

onDataLoadedObservableSearch playground for onDataLoadedObservable

onDataLoadedObservable: Observable<Scene>

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

onDisposeObservableSearch playground for onDisposeObservable

onDisposeObservable: Observable<Scene>

An event triggered when the scene is disposed.

onGeometryRemovedObservableSearch playground for onGeometryRemovedObservable

onGeometryRemovedObservable: Observable<Geometry>

An event triggered when a geometry is removed

onKeyboardObservableSearch playground for onKeyboardObservable

onKeyboardObservable: Observable<KeyboardInfo>

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

onLightRemovedObservableSearch playground for onLightRemovedObservable

onLightRemovedObservable: Observable<Light>

An event triggered when a light is removed

onMaterialRemovedObservableSearch playground for onMaterialRemovedObservable

onMaterialRemovedObservable: Observable<Material>

An event triggered when a material is removed

onMeshImportedObservableSearch playground for onMeshImportedObservable

onMeshImportedObservable: Observable<AbstractMesh>

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

onMeshRemovedObservableSearch playground for onMeshRemovedObservable

onMeshRemovedObservable: Observable<AbstractMesh>

An event triggered when a mesh is removed

onMultiMaterialRemovedObservableSearch playground for onMultiMaterialRemovedObservable

onMultiMaterialRemovedObservable: Observable<MultiMaterial>

An event triggered when a multi material is removed

onNewCameraAddedObservableSearch playground for onNewCameraAddedObservable

onNewCameraAddedObservable: Observable<Camera>

An event triggered when a camera is created

onNewGeometryAddedObservableSearch playground for onNewGeometryAddedObservable

onNewGeometryAddedObservable: Observable<Geometry>

An event triggered when a geometry is created

onNewLightAddedObservableSearch playground for onNewLightAddedObservable

onNewLightAddedObservable: Observable<Light>

An event triggered when a light is created

onNewMaterialAddedObservableSearch playground for onNewMaterialAddedObservable

onNewMaterialAddedObservable: Observable<Material>

An event triggered when a material is created

onNewMeshAddedObservableSearch playground for onNewMeshAddedObservable

onNewMeshAddedObservable: Observable<AbstractMesh>

An event triggered when a mesh is created

onNewMultiMaterialAddedObservableSearch playground for onNewMultiMaterialAddedObservable

onNewMultiMaterialAddedObservable: Observable<MultiMaterial>

An event triggered when a multi material is created

onNewSkeletonAddedObservableSearch playground for onNewSkeletonAddedObservable

onNewSkeletonAddedObservable: Observable<Skeleton>

An event triggered when a skeleton is created

onNewTextureAddedObservableSearch playground for onNewTextureAddedObservable

onNewTextureAddedObservable: Observable<BaseTexture>

An event triggered when a texture is created

onNewTransformNodeAddedObservableSearch playground for onNewTransformNodeAddedObservable

onNewTransformNodeAddedObservable: Observable<TransformNode>

An event triggered when a transform node is created

onPointerDownSearch playground for onPointerDown

onPointerDown: (evt: IPointerEvent, pickInfo: PickingInfo, type: PointerEventTypes) => void

Callback called when a pointer down is detected

Type declaration

onPointerMoveSearch playground for onPointerMove

onPointerMove: (evt: IPointerEvent, pickInfo: PickingInfo, type: PointerEventTypes) => void

Callback called when a pointer move is detected

Type declaration

onPointerObservableSearch playground for onPointerObservable

onPointerObservable: Observable<PointerInfo>

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

onPointerPickSearch playground for onPointerPick

onPointerPick: (evt: IPointerEvent, pickInfo: PickingInfo) => void

Callback called when a pointer pick is detected

Type declaration

onPointerUpSearch playground for onPointerUp

onPointerUp: (evt: IPointerEvent, pickInfo: Nullable<PickingInfo>, type: PointerEventTypes) => void

Callback called when a pointer up is detected

Type declaration

onPreKeyboardObservableSearch playground for onPreKeyboardObservable

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

onPrePointerObservableSearch playground for onPrePointerObservable

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

onReadyObservableSearch playground for onReadyObservable

onReadyObservable: Observable<Scene>

An event triggered when the scene is ready

onSkeletonRemovedObservableSearch playground for onSkeletonRemovedObservable

onSkeletonRemovedObservable: Observable<Skeleton>

An event triggered when a skeleton is removed

onTextureRemovedObservableSearch playground for onTextureRemovedObservable

onTextureRemovedObservable: Observable<BaseTexture>

An event triggered when a texture is removed

onTransformNodeRemovedObservableSearch playground for onTransformNodeRemovedObservable

onTransformNodeRemovedObservable: Observable<TransformNode>

An event triggered when a transform node is removed

particleSystemsSearch playground for particleSystems

particleSystems: IParticleSystem[]

All of the particle systems added to this scene

see

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

particlesEnabledSearch playground for particlesEnabled

particlesEnabled: boolean

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

physicsEnabledSearch playground for physicsEnabled

physicsEnabled: boolean

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

pointerDownPredicateSearch playground for pointerDownPredicate

pointerDownPredicate: (Mesh: AbstractMesh) => boolean

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

Type declaration

pointerMovePredicateSearch playground for pointerMovePredicate

pointerMovePredicate: (Mesh: AbstractMesh) => boolean

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

Type declaration

pointerUpPredicateSearch playground for pointerUpPredicate

pointerUpPredicate: (Mesh: AbstractMesh) => boolean

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

Type declaration

postProcessManagerSearch playground for postProcessManager

postProcessManager: PostProcessManager

Gets the current postprocess manager

Readonly postProcessRenderPipelineManagerSearch playground for postProcessRenderPipelineManager

postProcessRenderPipelineManager: PostProcessRenderPipelineManager

postProcessesSearch playground for postProcesses

postProcesses: PostProcess[]

The list of postprocesses added to the scene

postProcessesEnabledSearch playground for postProcessesEnabled

postProcessesEnabled: boolean

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

prePassRendererSearch playground for prePassRenderer

prePassRenderer: Nullable<PrePassRenderer>

Gets or Sets the current prepass renderer associated to the scene.

preventDefaultOnPointerDownSearch playground for preventDefaultOnPointerDown

preventDefaultOnPointerDown: boolean

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

preventDefaultOnPointerUpSearch playground for preventDefaultOnPointerUp

preventDefaultOnPointerUp: boolean

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

probesEnabledSearch playground for probesEnabled

probesEnabled: boolean

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

proceduralTexturesSearch playground for proceduralTextures

proceduralTextures: Array<ProceduralTexture>

The list of procedural textures added to the scene

see

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

proceduralTexturesEnabledSearch playground for proceduralTexturesEnabled

proceduralTexturesEnabled: boolean

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

reflectionProbesSearch playground for reflectionProbes

reflectionProbes: Array<ReflectionProbe>

The list of reflection probes added to the scene

see

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

renderTargetsEnabledSearch playground for renderTargetsEnabled

renderTargetsEnabled: boolean

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

requireLightSortingSearch playground for requireLightSorting

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

reservedDataStoreSearch playground for reservedDataStore

reservedDataStore: any

For internal use only. Please do not use.

rootNodesSearch playground for rootNodes

rootNodes: Node[]

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

selectionOctreeSearch playground for selectionOctree

selectionOctree: Octree<AbstractMesh>

Gets the octree used to boost mesh selection (picking)

see

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

simplificationQueueSearch playground for simplificationQueue

simplificationQueue: SimplificationQueue

Gets or sets the simplification queue attached to the scene

see

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

skeletonsSearch playground for skeletons

skeletons: Skeleton[]

The list of skeletons added to the scene

see

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

soundTracksSearch playground for soundTracks

soundTracks: Nullable<Array<SoundTrack>>

The list of sound tracks added to the scene

see

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

soundsSearch playground for sounds

sounds: Nullable<Array<Sound>>

The list of sounds used in the scene.

spriteManagersSearch playground for spriteManagers

spriteManagers: Array<ISpriteManager>

All of the sprite managers added to this scene

see

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

spritesEnabledSearch playground for spritesEnabled

spritesEnabled: boolean

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

subSurfaceConfigurationSearch playground for subSurfaceConfiguration

subSurfaceConfiguration: Nullable<SubSurfaceConfiguration>

Gets or Sets the current prepass renderer associated to the scene.

texturesSearch playground for textures

textures: BaseTexture[]

Textures to keep.

transformNodesSearch playground for transformNodes

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

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

useConstantAnimationDeltaTimeSearch playground for useConstantAnimationDeltaTime

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

useDelayedTextureLoadingSearch playground for useDelayedTextureLoading

useDelayedTextureLoading: boolean

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

Static Readonly FOGMODE_EXPSearch playground for FOGMODE_EXP

FOGMODE_EXP: number

The fog density is following an exponential function

Static Readonly FOGMODE_EXP2Search playground for FOGMODE_EXP2

FOGMODE_EXP2: number

The fog density is following an exponential function faster than FOGMODE_EXP

Static Readonly FOGMODE_LINEARSearch playground for FOGMODE_LINEAR

FOGMODE_LINEAR: number

The fog density is following a linear function.

Static Readonly FOGMODE_NONESearch playground for FOGMODE_NONE

FOGMODE_NONE: number

The fog is deactivated

Static MaxDeltaTimeSearch playground for MaxDeltaTime

MaxDeltaTime: number

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

see

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

Static MinDeltaTimeSearch playground for MinDeltaTime

MinDeltaTime: number

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

see

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

Accessors

activeBonesPerfCounter

activeCamera

  • Gets or sets the current active camera

    Returns Nullable<Camera>

  • Gets or sets the current active camera

    Parameters

    Returns any

activeParticlesPerfCounter

afterCameraRender

  • set afterCameraRender(callback: () => void): any
  • Sets a function to be executed after rendering a camera

    Parameters

    • callback: () => void
        • (): void
        • Returns void

    Returns any

afterRender

  • set afterRender(callback: Nullable<() => void>): any
  • Sets a function to be executed after rendering this scene

    Parameters

    Returns any

animatables

  • Gets all animatable attached to the scene

    Returns Animatable[]

animationPropertiesOverride

beforeCameraRender

  • set beforeCameraRender(callback: () => void): any
  • Sets a function to be executed before rendering a camera

    Parameters

    • callback: () => void
        • (): void
        • Returns void

    Returns any

beforeRender

  • set beforeRender(callback: Nullable<() => void>): any
  • Sets a function to be executed before rendering this scene

    Parameters

    Returns any

blockMaterialDirtyMechanism

  • get blockMaterialDirtyMechanism(): boolean
  • set blockMaterialDirtyMechanism(value: boolean): any
  • Gets or sets a boolean blocking all the calls to markAllMaterialsAsDirty (ie. the materials won't be updated if they are out of sync)

    Returns 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)

    Parameters

    • value: boolean

    Returns any

blockfreeActiveMeshesAndRenderingGroups

  • get blockfreeActiveMeshesAndRenderingGroups(): boolean
  • set blockfreeActiveMeshesAndRenderingGroups(value: boolean): any
  • 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.

    Returns 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.

    Parameters

    • value: boolean

    Returns any

defaultMaterial

  • The default material used on meshes when no material is affected

    Returns Material

  • The default material used on meshes when no material is affected

    Parameters

    Returns any

environmentIntensity

  • get environmentIntensity(): number
  • set environmentIntensity(value: number): any
  • Intensity of the environment in all pbr material. This dims or reinforces the IBL lighting overall (reflection and diffuse). As in the majority of the scene they are the same (exception for multi room and so on), this is easier to reference from here than from all the materials.

    Returns number

  • Intensity of the environment in all pbr material. This dims or reinforces the IBL lighting overall (reflection and diffuse). 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.

    Parameters

    • value: number

    Returns any

environmentTexture

  • 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 reference from here than from all the materials.

    Returns 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.

    Parameters

    Returns any

fogEnabled

  • get fogEnabled(): boolean
  • set fogEnabled(value: boolean): any

fogMode

  • get fogMode(): number
  • set fogMode(value: number): any
  • Gets or sets the fog mode to use

    see

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

    Returns number

  • Gets or sets the fog mode to use

    see

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

    Parameters

    • value: number

    Returns any

forcePointsCloud

  • get forcePointsCloud(): boolean
  • set forcePointsCloud(value: boolean): any
  • Gets or sets a boolean indicating if all rendering must be done in point cloud

    Returns boolean

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

    Parameters

    • value: boolean

    Returns any

forceWireframe

  • get forceWireframe(): boolean
  • set forceWireframe(value: boolean): any
  • Gets or sets a boolean indicating if all rendering must be done in wireframe

    Returns boolean

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

    Parameters

    • value: boolean

    Returns any

frustumPlanes

  • get frustumPlanes(): Plane[]
  • Gets the list of frustum planes (built from the active camera)

    Returns Plane[]

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.

    Returns ImageProcessingConfiguration

isDisposed

  • get isDisposed(): boolean
  • Gets if the scene is already disposed

    Returns boolean

isLoading

  • get isLoading(): boolean
  • Returns a boolean indicating if the scene is still loading data

    Returns boolean

lightsEnabled

  • get lightsEnabled(): boolean
  • set lightsEnabled(value: boolean): any
  • Gets or sets a boolean indicating if lights are enabled on this scene

    Returns boolean

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

    Parameters

    • value: boolean

    Returns any

meshUnderPointer

  • Gets the mesh that is currently under the pointer

    Returns Nullable<AbstractMesh>

onDispose

  • set onDispose(callback: () => void): any
  • Sets a function to be executed when this scene is disposed.

    Parameters

    • callback: () => void
        • (): void
        • Returns void

    Returns any

pointerX

  • get pointerX(): number
  • set pointerX(value: number): any
  • Gets or sets the current on-screen X position of the pointer

    Returns number

  • Gets or sets the current on-screen X position of the pointer

    Parameters

    • value: number

    Returns any

pointerY

  • get pointerY(): number
  • set pointerY(value: number): any
  • Gets or sets the current on-screen Y position of the pointer

    Returns number

  • Gets or sets the current on-screen Y position of the pointer

    Parameters

    • value: number

    Returns any

prePass

  • get prePass(): boolean
  • Flag indicating that the frame buffer binding is handled by another component

    Returns boolean

shadowsEnabled

  • get shadowsEnabled(): boolean
  • set shadowsEnabled(value: boolean): any
  • Gets or sets a boolean indicating if shadows are enabled on this scene

    Returns boolean

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

    Parameters

    • value: boolean

    Returns any

skeletonsEnabled

  • get skeletonsEnabled(): boolean
  • set skeletonsEnabled(value: boolean): any
  • Gets or sets a boolean indicating if skeletons are enabled on this scene

    Returns boolean

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

    Parameters

    • value: boolean

    Returns any

skipFrustumClipping

  • get skipFrustumClipping(): boolean
  • set skipFrustumClipping(value: boolean): any
  • Gets or sets a boolean indicating if we should skip the frustum clipping part of the active meshes selection

    Returns boolean

  • Gets or sets a boolean indicating if we should skip the frustum clipping part of the active meshes selection

    Parameters

    • value: boolean

    Returns any

texturesEnabled

  • get texturesEnabled(): boolean
  • set texturesEnabled(value: boolean): any
  • Gets or sets a boolean indicating if textures are enabled on this scene

    Returns boolean

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

    Parameters

    • value: boolean

    Returns any

totalActiveIndicesPerfCounter

totalVerticesPerfCounter

uid

  • get uid(): string
  • Return a unique id as a string which can serve as an identifier for the scene

    Returns string

unTranslatedPointer

  • get unTranslatedPointer(): Vector2
  • Gets the pointer coordinates without any translation (ie. straight out of the pointer event)

    Returns Vector2

useRightHandedSystem

  • get useRightHandedSystem(): boolean
  • set useRightHandedSystem(value: boolean): any
  • Gets or sets a boolean indicating if the scene must use right-handed coordinates system

    Returns boolean

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

    Parameters

    • value: boolean

    Returns any

Static DoubleClickDelay

  • get DoubleClickDelay(): number
  • set DoubleClickDelay(value: number): any
  • Time in milliseconds to wait to raise long press events if button is still pressed. Default is 300 ms

    Returns number

  • Time in milliseconds to wait to raise long press events if button is still pressed. Default is 300 ms

    Parameters

    • value: number

    Returns any

Static DragMovementThreshold

  • get DragMovementThreshold(): number
  • set DragMovementThreshold(value: number): any
  • Gets or sets the distance in pixel that you have to move to prevent some events. Default is 10 pixels

    Returns number

  • Gets or sets the distance in pixel that you have to move to prevent some events. Default is 10 pixels

    Parameters

    • value: number

    Returns any

Static ExclusiveDoubleClickMode

  • get ExclusiveDoubleClickMode(): boolean
  • set ExclusiveDoubleClickMode(value: boolean): any
  • If you need to check double click without raising a single click at first click, enable this flag

    Returns boolean

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

    Parameters

    • value: boolean

    Returns any

Static LongPressDelay

  • get LongPressDelay(): number
  • set LongPressDelay(value: number): any
  • Time in milliseconds to wait to raise long press events if button is still pressed. Default is 500 ms

    Returns number

  • Time in milliseconds to wait to raise long press events if button is still pressed. Default is 500 ms

    Parameters

    • value: number

    Returns any

Methods

addActionManagerSearch playground for addActionManager

  • Adds the given action manager to this scene

    Parameters

    Returns void

addAnimationSearch playground for addAnimation

  • addAnimation(newAnimation: Animation): void
  • Adds the given animation to this scene

    Parameters

    • newAnimation: Animation

      The animation to add

    Returns void

addAnimationGroupSearch playground for addAnimationGroup

  • Adds the given animation group to this scene.

    Parameters

    Returns void

addCameraSearch playground for addCamera

  • addCamera(newCamera: Camera): void
  • Adds the given camera to this scene

    Parameters

    • newCamera: Camera

      The camera to add

    Returns void

addEffectLayerSearch playground for addEffectLayer

  • Adds the given effect layer to this scene

    Parameters

    • newEffectLayer: EffectLayer

      defines the effect layer to add

    Returns void

addExternalDataSearch playground for addExternalData

  • 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

addGeometrySearch playground for addGeometry

  • addGeometry(newGeometry: Geometry): void
  • Adds the given geometry to this scene

    Parameters

    • newGeometry: Geometry

      The geometry to add

    Returns void

addLensFlareSystemSearch playground for addLensFlareSystem

  • Adds the given lens flare system to this scene

    Parameters

    Returns void

addLightSearch playground for addLight

  • addLight(newLight: Light): void
  • Adds the given light to this scene

    Parameters

    • newLight: Light

      The light to add

    Returns void

addMaterialSearch playground for addMaterial

  • addMaterial(newMaterial: Material): void
  • Adds the given material to this scene

    Parameters

    • newMaterial: Material

      The material to add

    Returns void

addMeshSearch playground for addMesh

  • 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

addMorphTargetManagerSearch playground for addMorphTargetManager

  • Adds the given morph target to this scene

    Parameters

    Returns void

addMultiMaterialSearch playground for addMultiMaterial

  • Adds the given multi-material to this scene

    Parameters

    Returns void

addParticleSystemSearch playground for addParticleSystem

  • Adds the given particle system to this scene

    Parameters

    Returns void

addReflectionProbeSearch playground for addReflectionProbe

  • Adds the given reflection probe to this scene.

    Parameters

    Returns void

addSkeletonSearch playground for addSkeleton

  • addSkeleton(newSkeleton: Skeleton): void
  • Adds the given skeleton to this scene

    Parameters

    • newSkeleton: Skeleton

      The skeleton to add

    Returns void

addTextureSearch playground for addTexture

  • Adds the given texture to this scene.

    Parameters

    Returns void

addTransformNodeSearch playground for addTransformNode

  • Add a transform node to the list of scene's transform nodes

    Parameters

    • newTransformNode: TransformNode

      defines the transform node to add

    Returns void

animateSearch playground for animate

  • animate(): void
  • Execute all animations (for a frame)

    Returns void

attachControlSearch playground for attachControl

  • 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

beginAnimationSearch playground for beginAnimation

  • beginAnimation(target: any, from: number, to: number, loop?: boolean, speedRatio?: number, onAnimationEnd?: () => void, animatable?: Animatable, stopCurrent?: boolean, targetMask?: (target: any) => boolean, onAnimationLoop?: () => void, isAdditive?: boolean): 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: () => void

      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: (target: any) => boolean

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

        • (target: any): boolean
        • Parameters

          • target: any

          Returns boolean

    • Optional onAnimationLoop: () => void

      defines the callback to call when an animation loops

        • (): void
        • Returns void

    • Optional isAdditive: boolean

      defines whether the animation should be evaluated additively (false by default)

    Returns Animatable

    the animatable object created for this animation

beginDirectAnimationSearch playground for beginDirectAnimation

  • beginDirectAnimation(target: any, animations: Animation[], from: number, to: number, loop?: boolean, speedRatio?: number, onAnimationEnd?: () => void, onAnimationLoop?: () => void, isAdditive?: boolean): 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: () => void

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

        • (): void
        • Returns void

    • Optional onAnimationLoop: () => void

      defines the callback to call when an animation loops

        • (): void
        • Returns void

    • Optional isAdditive: boolean

      defines whether the animation should be evaluated additively (false by default)

    Returns Animatable

    the list of created animatables

beginDirectHierarchyAnimationSearch playground for beginDirectHierarchyAnimation

  • beginDirectHierarchyAnimation(target: Node, directDescendantsOnly: boolean, animations: Animation[], from: number, to: number, loop?: boolean, speedRatio?: number, onAnimationEnd?: () => void, onAnimationLoop?: () => void, isAdditive?: boolean): 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: () => void

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

        • (): void
        • Returns void

    • Optional onAnimationLoop: () => void

      defines the callback to call when an animation loops

        • (): void
        • Returns void

    • Optional isAdditive: boolean

      defines whether the animation should be evaluated additively (false by default)

    Returns Animatable[]

    the list of animatables created for all nodes

beginHierarchyAnimationSearch playground for beginHierarchyAnimation

  • beginHierarchyAnimation(target: any, directDescendantsOnly: boolean, from: number, to: number, loop?: boolean, speedRatio?: number, onAnimationEnd?: () => void, animatable?: Animatable, stopCurrent?: boolean, targetMask?: (target: any) => boolean, onAnimationLoop?: () => void, isAdditive?: boolean): 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: () => void

      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: (target: any) => boolean

      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

    • Optional onAnimationLoop: () => void

      defines the callback to call when an animation loops

        • (): void
        • Returns void

    • Optional isAdditive: boolean

      defines whether the animation should be evaluated additively (false by default)

    Returns Animatable[]

    the list of created animatables

beginWeightedAnimationSearch playground for beginWeightedAnimation

  • beginWeightedAnimation(target: any, from: number, to: number, weight: number, loop?: boolean, speedRatio?: number, onAnimationEnd?: () => void, animatable?: Animatable, targetMask?: (target: any) => boolean, onAnimationLoop?: () => void, isAdditive?: boolean): 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.

    • 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: () => void

      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: (target: any) => boolean

      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

    • Optional onAnimationLoop: () => void

      defines the callback to call when an animation loops

        • (): void
        • Returns void

    • Optional isAdditive: boolean

      defines whether the animation should be evaluated additively (false by default)

    Returns Animatable

    the animatable object created for this animation

bindEyePositionSearch playground for bindEyePosition

  • Bind the current view position to an effect.

    Parameters

    • effect: Nullable<Effect>

      The effect to be bound

    • Optional variableName: string

      name of the shader variable that will hold the eye position

    • Optional isVector3: boolean

      true to indicates that variableName is a Vector3 and not a Vector4

    Returns Vector4

    the computed eye position

cleanCachedTextureBufferSearch playground for cleanCachedTextureBuffer

  • 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

clearCachedVertexDataSearch playground for clearCachedVertexData

  • 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

createDefaultCameraSearch playground for createDefaultCamera

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

    see

    https://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

createDefaultCameraOrLightSearch playground for createDefaultCameraOrLight

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

    see

    https://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

createDefaultEnvironmentSearch playground for createDefaultEnvironment

createDefaultLightSearch playground for createDefaultLight

  • createDefaultLight(replace?: boolean): void

createDefaultSkyboxSearch playground for createDefaultSkybox

  • 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

createDefaultVRExperienceSearch playground for createDefaultVRExperience

createDefaultXRExperienceAsyncSearch playground for createDefaultXRExperienceAsync

createOrUpdateSelectionOctreeSearch playground for createOrUpdateSelectionOctree

  • createOrUpdateSelectionOctree(maxCapacity?: number, maxDepth?: number): Octree<AbstractMesh>

createPickingRaySearch playground for createPickingRay

  • 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

createPickingRayInCameraSpaceSearch playground for createPickingRayInCameraSpace

  • 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

createPickingRayInCameraSpaceToRefSearch playground for createPickingRayInCameraSpaceToRef

  • 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

createPickingRayToRefSearch playground for createPickingRayToRef

  • 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

deleteCompoundImpostorSearch playground for deleteCompoundImpostor

  • deleteCompoundImpostor(compound: any): void
  • Deletes a physics compound impostor

    Parameters

    • compound: any

      defines the compound to delete

    Returns void

detachControlSearch playground for detachControl

  • detachControl(): void
  • Detaches all event handlers

    Returns void

disableDepthRendererSearch playground for disableDepthRenderer

  • 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

disableGeometryBufferRendererSearch playground for disableGeometryBufferRenderer

  • disableGeometryBufferRenderer(): void
  • Disables the GeometryBufferRender associated with the scene

    Returns void

disablePhysicsEngineSearch playground for disablePhysicsEngine

  • disablePhysicsEngine(): void
  • Disables and disposes the physics engine associated with the scene

    Returns void

disablePrePassRendererSearch playground for disablePrePassRenderer

  • disablePrePassRenderer(): void
  • Disables the prepass associated with the scene

    Returns void

disableSubSurfaceForPrePassSearch playground for disableSubSurfaceForPrePass

  • disableSubSurfaceForPrePass(): void

disposeSearch playground for dispose

  • dispose(): void
  • Releases all held ressources

    Returns void

enableDepthRendererSearch playground for enableDepthRenderer

  • 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)

    • Optional storeNonLinearDepth: boolean

      Defines whether the depth is stored linearly like in Babylon Shadows or directly like glFragCoord.z

    • Optional force32bitsFloat: boolean

      Forces 32 bits float when supported (else 16 bits float is prioritized over 32 bits float if supported)

    Returns DepthRenderer

    the created depth renderer

enableGeometryBufferRendererSearch playground for enableGeometryBufferRenderer

  • 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

enablePhysicsSearch playground for enablePhysics

  • 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 CannonJS.

    Returns boolean

    a boolean indicating if the physics engine was initialized

enablePrePassRendererSearch playground for enablePrePassRenderer

enableSubSurfaceForPrePassSearch playground for enableSubSurfaceForPrePass

executeOnceBeforeRenderSearch playground for executeOnceBeforeRender

  • executeOnceBeforeRender(func: () => void, 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: () => void

      The function to be executed.

        • (): void
        • Returns void

    • Optional timeout: number

      optional delay in ms

    Returns void

executeWhenReadySearch playground for executeWhenReady

  • executeWhenReady(func: () => void): void
  • Registers a function to be executed when the scene is ready

    Parameters

    • func: () => void

      the function to be executed

        • (): void
        • Returns void

    Returns void

finalizeSceneUboSearch playground for finalizeSceneUbo

  • Update the scene ubo before it can be used in rendering processing

    Returns UniformBuffer

    the scene UniformBuffer

freeActiveMeshesSearch playground for freeActiveMeshes

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

    Returns void

freeProcessedMaterialsSearch playground for freeProcessedMaterials

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

    Returns void

freeRenderingGroupsSearch playground for freeRenderingGroups

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

    Returns void

freezeActiveMeshesSearch playground for freezeActiveMeshes

  • freezeActiveMeshes(skipEvaluateActiveMeshes?: boolean, onSuccess?: () => void, onError?: (message: string) => void, freezeMeshes?: boolean): Scene
  • Use this function to stop evaluating active meshes. The current list will be keep alive between frames

    Parameters

    • Optional skipEvaluateActiveMeshes: boolean

      defines an optional boolean indicating that the evaluate active meshes step must be completely skipped

    • Optional onSuccess: () => void

      optional success callback

        • (): void
        • Returns void

    • Optional onError: (message: string) => void

      optional error callback

        • (message: string): void
        • Parameters

          • message: string

          Returns void

    • Optional freezeMeshes: boolean

      defines if meshes should be frozen (true by default)

    Returns Scene

    the current scene

freezeMaterialsSearch playground for freezeMaterials

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

    Returns void

getActiveBonesSearch playground for getActiveBones

  • getActiveBones(): number
  • Gets the total number of active bones rendered per frame

    Returns number

    the total number of active bones rendered per frame

getActiveIndicesSearch playground for getActiveIndices

  • 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

getActiveMeshesSearch playground for getActiveMeshes

  • Gets the array of active meshes

    Returns SmartArray<AbstractMesh>

    an array of AbstractMesh

getActiveParticlesSearch playground for getActiveParticles

  • getActiveParticles(): number
  • Gets the total number of active particles rendered per frame

    Returns number

    the total number of active particles rendered per frame

getAllAnimatablesByTargetSearch playground for getAllAnimatablesByTarget

  • 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

getAnimatableByTargetSearch playground for getAnimatableByTarget

  • 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

getAnimationGroupByNameSearch playground for getAnimationGroupByName

  • 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.

getAnimationRatioSearch playground for getAnimationRatio

  • 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

getAutoClearDepthStencilSetupSearch playground for getAutoClearDepthStencilSetup

  • 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

getBoneByIDSearch playground for getBoneByID

  • Gets a bone using its id

    Parameters

    • id: string

      defines the bone's id

    Returns Nullable<Bone>

    the bone or null if not found

getBoneByNameSearch playground for getBoneByName

  • Gets a bone using its id

    Parameters

    • name: string

      defines the bone's name

    Returns Nullable<Bone>

    the bone or null if not found

getBoundingBoxRendererSearch playground for getBoundingBoxRenderer

  • Gets the bounding box renderer associated with the scene

    Returns BoundingBoxRenderer

    a BoundingBoxRenderer

getCachedEffectSearch playground for getCachedEffect

  • Gets the cached effect (ie. the latest rendered one)

    Returns Nullable<Effect>

    the cached effect

getCachedMaterialSearch playground for getCachedMaterial

  • Gets the cached material (ie. the latest rendered one)

    Returns Nullable<Material>

    the cached material

getCachedVisibilitySearch playground for getCachedVisibility

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

    Returns Nullable<number>

    the cached visibility state

getCameraByIDSearch playground for getCameraByID

  • 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

getCameraByNameSearch playground for getCameraByName

  • Gets a camera using its name

    Parameters

    • name: string

      defines the camera's name

    Returns Nullable<Camera>

    the camera or null if none found.

getCameraByUniqueIDSearch playground for getCameraByUniqueID

  • 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

getCamerasByTagsSearch playground for getCamerasByTags

  • getCamerasByTags(tagsQuery: string, forEach?: (camera: Camera) => void): Camera[]
  • Get a list of cameras by tags

    Parameters

    • tagsQuery: string

      defines the tags query to use

    • Optional forEach: (camera: Camera) => void

      defines a predicate used to filter results

        • Parameters

          Returns void

    Returns Camera[]

    an array of Camera

getClassNameSearch playground for getClassName

  • getClassName(): string
  • Gets a string identifying the name of the class

    Returns string

    "Scene" string

getEngineSearch playground for getEngine

  • Gets the engine associated with the scene

    Returns Engine

    an Engine

getExternalDataSearch playground for getExternalData

  • 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

getFrameIdSearch playground for getFrameId

  • getFrameId(): number
  • Gets an unique Id for the current frame

    Returns number

    a number

getGeometriesSearch playground for getGeometries

  • Gets the list of geometries attached to the scene

    Returns Geometry[]

    an array of Geometry

getGeometryByIDSearch playground for getGeometryByID

  • Gets a geometry using its ID

    Parameters

    • id: string

      defines the geometry's id

    Returns Nullable<Geometry>

    the geometry or null if none found.

getGlowLayerByNameSearch playground for getGlowLayerByName

  • 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.

getHighlightLayerByNameSearch playground for getHighlightLayerByName

  • 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<HighlightLayer>

    The highlight layer if found otherwise null.

getInternalStepSearch playground for getInternalStep

  • getInternalStep(): number

getLastEntryByIDSearch playground for getLastEntryByID

  • 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

getLastMaterialByIDSearch playground for getLastMaterialByID

  • Gets a the last added material using a given id

    Parameters

    • id: string

      defines the material's ID

    Returns Nullable<Material>

    the last material with the given id or null if none found.

getLastMeshByIDSearch playground for getLastMeshByID

  • 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.

getLastSkeletonByIDSearch playground for getLastSkeletonByID

  • 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.

getLensFlareSystemByIDSearch playground for getLensFlareSystemByID

  • Gets a lens flare system using its id

    Parameters

    • id: string

      defines the id to look for

    Returns Nullable<LensFlareSystem>

    the lens flare system or null if not found

getLensFlareSystemByNameSearch playground for getLensFlareSystemByName

  • Gets a lens flare system using its name

    Parameters

    • name: string

      defines the name to look for

    Returns Nullable<LensFlareSystem>

    the lens flare system or null if not found

getLightByIDSearch playground for getLightByID

  • 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.

getLightByNameSearch playground for getLightByName

  • 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.

getLightByUniqueIDSearch playground for getLightByUniqueID

  • 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.

getLightsByTagsSearch playground for getLightsByTags

  • getLightsByTags(tagsQuery: string, forEach?: (light: Light) => void): Light[]
  • Get a list of lights by tags

    Parameters

    • tagsQuery: string

      defines the tags query to use

    • Optional forEach: (light: Light) => void

      defines a predicate used to filter results

        • Parameters

          Returns void

    Returns Light[]

    an array of Light

getMaterialByIDSearch playground for getMaterialByID

  • get a material using its id

    Parameters

    • id: string

      defines the material's ID

    Returns Nullable<Material>

    the material or null if none found.

getMaterialByNameSearch playground for getMaterialByName

  • Gets a material using its name

    Parameters

    • name: string

      defines the material's name

    Returns Nullable<Material>

    the material or null if none found.

getMaterialByTagsSearch playground for getMaterialByTags

  • getMaterialByTags(tagsQuery: string, forEach?: (material: Material) => void): Material[]
  • Get a list of materials by tags

    Parameters

    • tagsQuery: string

      defines the tags query to use

    • Optional forEach: (material: Material) => void

      defines a predicate used to filter results

    Returns Material[]

    an array of Material

getMaterialByUniqueIDSearch playground for getMaterialByUniqueID

  • Get a material using its unique id

    Parameters

    • uniqueId: number

      defines the material's unique id

    Returns Nullable<Material>

    the material or null if none found.

getMeshByIDSearch playground for getMeshByID

  • 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

getMeshByNameSearch playground for getMeshByName

  • 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.

getMeshByUniqueIDSearch playground for getMeshByUniqueID

  • 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.

getMeshesByIDSearch playground for getMeshesByID

  • Gets a list of meshes using their id

    Parameters

    • id: string

      defines the id to search for

    Returns Array<AbstractMesh>

    a list of meshes

getMeshesByTagsSearch playground for getMeshesByTags

  • getMeshesByTags(tagsQuery: string, forEach?: (mesh: AbstractMesh) => void): Mesh[]
  • Get a list of meshes by tags

    Parameters

    • tagsQuery: string

      defines the tags query to use

    • Optional forEach: (mesh: AbstractMesh) => void

      defines a predicate used to filter results

    Returns Mesh[]

    an array of Mesh

getMorphTargetByIdSearch playground for getMorphTargetById

  • 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.

getMorphTargetByNameSearch playground for getMorphTargetByName

  • Gets a morph target using a given name (if many are found, this function will pick the first one)

    Parameters

    • name: string

      defines the name to search for

    Returns Nullable<MorphTarget>

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

getMorphTargetManagerByIdSearch playground for getMorphTargetManagerById

  • 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.

getNodeByIDSearch playground for getNodeByID

  • 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

getNodeByNameSearch playground for getNodeByName

  • 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.

getNodesSearch playground for getNodes

  • getNodes(): Array<Node>
  • Returns Array<Node>

    all meshes, lights, cameras, transformNodes and bones

getOrAddExternalDataWithFactorySearch playground for getOrAddExternalDataWithFactory

  • getOrAddExternalDataWithFactory<T>(key: string, factory: (k: string) => T): 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: (k: string) => T

      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.

getOutlineRendererSearch playground for getOutlineRenderer

  • Gets the outline renderer associated with the scene

    Returns OutlineRenderer

    a OutlineRenderer

getParticleSystemByIDSearch playground for getParticleSystemByID

  • 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

getPhysicsEngineSearch playground for getPhysicsEngine

  • Gets the current physics engine

    Returns Nullable<IPhysicsEngine>

    a IPhysicsEngine or null if none attached

getPointerOverMeshSearch playground for getPointerOverMesh

  • Gets the mesh under the pointer

    Returns Nullable<AbstractMesh>

    a Mesh or null if no mesh is under the pointer

getPointerOverSpriteSearch playground for getPointerOverSprite

  • Gets the sprite under the pointer

    Returns Nullable<Sprite>

    a Sprite or null if no sprite is under the pointer

getPostProcessByNameSearch playground for getPostProcessByName

  • Gets a post process using a given name (if many are found, this function will pick the first one)

    Parameters

    • name: string

      defines the name to search for

    Returns Nullable<PostProcess>

    the found post process or null if not found at all.

getProjectionMatrixSearch playground for getProjectionMatrix

  • getProjectionMatrix(): Matrix
  • Gets the current projection matrix

    Returns Matrix

    a Matrix

getRenderIdSearch playground for getRenderId

  • getRenderId(): number
  • Gets an unique Id for the current render phase

    Returns number

    a number

getSceneUniformBufferSearch playground for getSceneUniformBuffer

  • Gets the uniform buffer used to store scene data

    Returns UniformBuffer

    a UniformBuffer

getSkeletonByIdSearch playground for getSkeletonById

  • 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.

getSkeletonByNameSearch playground for getSkeletonByName

  • 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.

getSkeletonByUniqueIdSearch playground for getSkeletonByUniqueId

  • Gets a skeleton using a given auto generated unique id

    Parameters

    • uniqueId: number

      defines the unique id to search for

    Returns Nullable<Skeleton>

    the found skeleton or null if not found at all.

getSoundByNameSearch playground for getSoundByName

  • 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.

getStepIdSearch playground for getStepId

  • getStepId(): number

getTextureByUniqueIDSearch playground for getTextureByUniqueID

  • Get a texture using its unique id

    Parameters

    • uniqueId: number

      defines the texture's unique id

    Returns Nullable<BaseTexture>

    the texture or null if none found.

getTotalVerticesSearch playground for getTotalVertices

  • getTotalVertices(): number
  • Gets the total number of vertices rendered per frame

    Returns number

    the total number of vertices rendered per frame

getTransformMatrixSearch playground for getTransformMatrix

  • getTransformMatrix(): Matrix
  • Gets the current transform matrix

    Returns Matrix

    a Matrix made of View * Projection

getTransformNodeByIDSearch playground for getTransformNodeByID

  • 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.

getTransformNodeByNameSearch playground for getTransformNodeByName

  • 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.

getTransformNodeByUniqueIDSearch playground for getTransformNodeByUniqueID

  • Gets a transform node with its auto-generated unique id

    Parameters

    • uniqueId: number

      efines the unique id to search for

    Returns Nullable<TransformNode>

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

getTransformNodesByIDSearch playground for getTransformNodesByID

  • 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

getTransformNodesByTagsSearch playground for getTransformNodesByTags

  • Get a list of transform nodes by tags

    Parameters

    • tagsQuery: string

      defines the tags query to use

    • Optional forEach: (transform: TransformNode) => void

      defines a predicate used to filter results

    Returns TransformNode[]

    an array of TransformNode

getUniqueIdSearch playground for getUniqueId

  • getUniqueId(): number
  • Gets an unique (relatively to the current scene) Id

    Returns number

    an unique number for the scene

getViewMatrixSearch playground for getViewMatrix

  • Gets the current view matrix

    Returns Matrix

    a Matrix

getWaitingItemsCountSearch playground for getWaitingItemsCount

  • getWaitingItemsCount(): number
  • Returns the number of items waiting to be loaded

    Returns number

    the number of items waiting to be loaded

getWorldExtendsSearch playground for getWorldExtends

  • Get the world extend vectors with an optional filter

    Parameters

    • Optional filterPredicate: (mesh: AbstractMesh) => boolean

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

    Returns { max: Vector3; min: Vector3 }

    min and max vectors

incrementRenderIdSearch playground for incrementRenderId

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

    Returns void

isActiveMeshSearch playground for isActiveMesh

  • Gets a boolean indicating if the given mesh is active

    Parameters

    Returns boolean

    true if the mesh is in the active list

isCachedMaterialInvalidSearch playground for isCachedMaterialInvalid

  • 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

isPhysicsEnabledSearch playground for isPhysicsEnabled

  • 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

isPointerCapturedSearch playground for isPointerCaptured

  • 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

isReadySearch playground for isReady

  • 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

markAllMaterialsAsDirtySearch playground for markAllMaterialsAsDirty

  • markAllMaterialsAsDirty(flag: number, predicate?: (mat: Material) => boolean): 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: (mat: Material) => boolean

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

    Returns void

multiPickSearch playground for multiPick

  • 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: (mesh: AbstractMesh) => boolean

      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

    • Optional trianglePredicate: TrianglePickingPredicate

      defines an optional predicate used to select faces when a mesh intersection is detected

    Returns Nullable<PickingInfo[]>

    an array of PickingInfo

multiPickSpriteSearch playground for multiPickSprite

  • Launch a ray to try to pick sprites in the scene

    Parameters

    • x: number

      position on screen

    • y: number

      position on screen

    • Optional predicate: (sprite: Sprite) => boolean

      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 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 array

multiPickSpriteWithRaySearch playground for multiPickSpriteWithRay

  • Use the given ray to pick sprites in the scene

    Parameters

    • ray: Ray

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

    • Optional predicate: (sprite: Sprite) => boolean

      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 camera: Camera

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

    Returns Nullable<PickingInfo[]>

    a PickingInfo array

multiPickWithRaySearch playground for multiPickWithRay

  • Launch a ray to try to pick a mesh in the scene

    Parameters

    • ray: Ray

      Ray to use

    • predicate: (mesh: AbstractMesh) => boolean

      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 trianglePredicate: TrianglePickingPredicate

      defines an optional predicate used to select faces when a mesh intersection is detected

    Returns Nullable<PickingInfo[]>

    an array of PickingInfo

pickSearch playground for pick

  • 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: (mesh: AbstractMesh) => boolean

      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

      defines if the first intersection will be used (and not the closest)

    • 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

    • Optional trianglePredicate: TrianglePickingPredicate

      defines an optional predicate used to select faces when a mesh intersection is detected

    Returns Nullable<PickingInfo>

    a PickingInfo

pickSpriteSearch playground for pickSprite

  • 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: (sprite: Sprite) => boolean

      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

      defines if the first intersection will be used (and not the closest)

    • 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

pickSpriteWithRaySearch playground for pickSpriteWithRay

  • 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: (sprite: Sprite) => boolean

      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

      defines if the first intersection will be used (and not the closest)

    • 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

pickWithBoundingInfoSearch playground for pickWithBoundingInfo

  • Launch a ray to try to pick a mesh in the scene using only bounding information of the main mesh (not using submeshes)

    Parameters

    • x: number

      position on screen

    • y: number

      position on screen

    • Optional predicate: (mesh: AbstractMesh) => boolean

      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

      defines if the first intersection will be used (and not the closest)

    • 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 (Please note that some info will not be set like distance, bv, bu and everything that cannot be capture by only using bounding infos)

pickWithRaySearch playground for pickWithRay

  • Use the given ray to pick a mesh in the scene

    Parameters

    • ray: Ray

      The ray to use to pick meshes

    • Optional predicate: (mesh: AbstractMesh) => boolean

      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

      defines if the first intersection will be used (and not the closest)

    • Optional trianglePredicate: TrianglePickingPredicate

      defines an optional predicate used to select faces when a mesh intersection is detected

    Returns Nullable<PickingInfo>

    a PickingInfo

pushGeometrySearch playground for pushGeometry

  • 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

registerAfterRenderSearch playground for registerAfterRender

  • registerAfterRender(func: () => void): void
  • Registers a function to be called after every frame render

    Parameters

    • func: () => void

      defines the function to register

        • (): void
        • Returns void

    Returns void

registerBeforeRenderSearch playground for registerBeforeRender

  • registerBeforeRender(func: () => void): void
  • Registers a function to be called before every frame render

    Parameters

    • func: () => void

      defines the function to register

        • (): void
        • Returns void

    Returns void

removeActionManagerSearch playground for removeActionManager

  • Removes the given action manager from this scene.

    Parameters

    Returns number

    The index of the removed action manager

removeAnimationSearch playground for removeAnimation

  • 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

removeAnimationGroupSearch playground for removeAnimationGroup

  • Removes the given animation group from this scene.

    Parameters

    Returns number

    The index of the removed animation group

removeCameraSearch playground for removeCamera

  • 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

removeEffectLayerSearch playground for removeEffectLayer

  • 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

removeExternalDataSearch playground for removeExternalData

  • 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

removeGeometrySearch playground for removeGeometry

  • 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

removeLensFlareSystemSearch playground for removeLensFlareSystem

  • Removes the given lens flare system from this scene.

    Parameters

    Returns number

    The index of the removed lens flare system

removeLightSearch playground for removeLight

  • 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

removeMaterialSearch playground for removeMaterial

  • 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

removeMeshSearch playground for removeMesh

  • 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

removeMorphTargetManagerSearch playground for removeMorphTargetManager

  • 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

removeMultiMaterialSearch playground for removeMultiMaterial

  • Removes the given multi-material from this scene.

    Parameters

    Returns number

    The index of the removed multi-material

removeParticleSystemSearch playground for removeParticleSystem

  • 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

removeReflectionProbeSearch playground for removeReflectionProbe

  • Removes the given reflection probe from this scene.

    Parameters

    Returns number

    The index of the removed reflection probe

removeSkeletonSearch playground for removeSkeleton

  • 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

removeTextureSearch playground for removeTexture

  • Removes the given texture from this scene.

    Parameters

    Returns number

    The index of the removed texture

removeTransformNodeSearch playground for removeTransformNode

  • 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

renderSearch playground for render

  • render(updateCameras?: boolean, ignoreAnimations?: boolean): void
  • Render the scene

    Parameters

    • Optional updateCameras: boolean

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

    • Optional ignoreAnimations: boolean

      defines a boolean indicating if animations should not be executed (false by default)

    Returns void

resetCachedMaterialSearch playground for resetCachedMaterial

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

    Returns void

resetLastAnimationTimeFrameSearch playground for resetLastAnimationTimeFrame

  • resetLastAnimationTimeFrame(): void
  • Resets the last animation time frame. Useful to override when animations start running when loading a scene for the first time.

    Returns void

setActiveCameraByIDSearch playground for setActiveCameraByID

  • 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.

setActiveCameraByNameSearch playground for setActiveCameraByName

  • 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.

setDefaultCandidateProvidersSearch playground for setDefaultCandidateProviders

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

    Returns void

setPointerOverMeshSearch playground for setPointerOverMesh

  • Force the value of meshUnderPointer

    Parameters

    • mesh: Nullable<AbstractMesh>

      defines the mesh to use

    • Optional pointerId: number

      optional pointer id when using more than one pointer

    Returns void

setPointerOverSpriteSearch playground for setPointerOverSprite

  • Force the sprite under the pointer

    Parameters

    Returns void

setRenderingAutoClearDepthStencilSearch playground for setRenderingAutoClearDepthStencil

  • 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

setRenderingOrderSearch playground for setRenderingOrder

  • 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<(a: SubMesh, b: SubMesh) => number>

      The opaque queue comparison function use to sort.

    • Optional alphaTestSortCompareFn: Nullable<(a: SubMesh, b: SubMesh) => number>

      The alpha test queue comparison function use to sort.

    • Optional transparentSortCompareFn: Nullable<(a: SubMesh, b: SubMesh) => number>

      The transparent queue comparison function use to sort.

    Returns void

setStepIdSearch playground for setStepId

  • setStepId(newStepId: number): void

setTransformMatrixSearch playground for setTransformMatrix

  • Sets the current transform matrix

    Parameters

    • viewL: Matrix

      defines the View matrix to use

    • projectionL: Matrix

      defines the Projection matrix to use

    • Optional viewR: Matrix

      defines the right View matrix to use (if provided)

    • Optional projectionR: Matrix

      defines the right Projection matrix to use (if provided)

    Returns void

simulatePointerDownSearch playground for simulatePointerDown

  • 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

simulatePointerMoveSearch playground for simulatePointerMove

  • 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

simulatePointerUpSearch playground for simulatePointerUp

  • 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

sortLightsByPrioritySearch playground for sortLightsByPriority

  • sortLightsByPriority(): void
  • Sorts the list list based on light priorities

    Returns void

stopAllAnimationsSearch playground for stopAllAnimations

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

    Returns void

stopAnimationSearch playground for stopAnimation

  • stopAnimation(target: any, animationName?: string, targetMask?: (target: any) => boolean): 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: (target: any) => boolean

      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

switchActiveCameraSearch playground for switchActiveCamera

  • 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

unfreezeActiveMeshesSearch playground for unfreezeActiveMeshes

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

    Returns Scene

    the current scene

unfreezeMaterialsSearch playground for unfreezeMaterials

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

    Returns void

unregisterAfterRenderSearch playground for unregisterAfterRender

  • unregisterAfterRender(func: () => void): void
  • Unregisters a function called after every frame render

    Parameters

    • func: () => void

      defines the function to unregister

        • (): void
        • Returns void

    Returns void

unregisterBeforeRenderSearch playground for unregisterBeforeRender

  • unregisterBeforeRender(func: () => void): void
  • Unregisters a function called before every frame render

    Parameters

    • func: () => void

      defines the function to unregister

        • (): void
        • Returns void

    Returns void

updateTransformMatrixSearch playground for updateTransformMatrix

  • 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

whenReadyAsyncSearch playground for whenReadyAsync

  • 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 AddIndividualParserSearch playground for AddIndividualParser

  • Adds n individual parser in the list of available ones

    Parameters

    Returns void

Static AddParserSearch playground for AddParser

  • 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 CollisionCoordinatorFactorySearch playground for CollisionCoordinatorFactory

  • CollisionCoordinatorFactory(): ICollisionCoordinator
  • Factory used to create the a collision coordinator.

    Returns ICollisionCoordinator

    The collision coordinator

Static DefaultMaterialFactorySearch playground for DefaultMaterialFactory

  • Factory used to create the default material.

    Parameters

    • scene: Scene

      The scene to create the material for

    Returns Material

    The default material

Static GetIndividualParserSearch playground for GetIndividualParser

Static GetParserSearch playground for GetParser

  • Gets a general parser from the list of avaialble ones

    Parameters

    • name: string

      Defines the name of the parser

    Returns Nullable<BabylonFileParser>

    the requested parser or null

Static ParseSearch playground for Parse

  • 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

Legend

  • Constructor
  • Property
  • Method
  • Accessor
  • Property
  • Method
  • Inherited property
  • Inherited method
  • Static property
  • Static method