CLASSES
TagsA - Z

Scene

Scene

Description

class Scene

Represents a scene to be rendered by the engine.

@see http://doc.babylonjs.com/page.php?p=21911

Constructor

new Scene(engine)

@constructor

Parameters

Name Type Description
engine Engine

Members

static MinDeltaTime : number

static MaxDeltaTime : number

static FOGMODE_NONE : number

The fog is deactivated */

static FOGMODE_EXP : number

The fog density is following an exponential function */

static FOGMODE_EXP2 : number

The fog density is following an exponential function faster than FOGMODE_EXP */

static FOGMODE_LINEAR : number

The fog density is following a linear function. */

autoClear : boolean

autoClearDepthAndStencil : boolean

clearColor : Color4

ambientColor : Color3

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

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.

imageProcessingConfiguration : ImageProcessingConfiguration

Default image processing configuration used either in the rendering

Forward main pass or through the imageProcessingPostProcess if present.

As in the majority of the scene they are the same (exception for multi camera),

this is easier to reference from here than from all the materials and post process.

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

forceWireframe : boolean

forcePointsCloud : boolean

forceShowBoundingBoxes : boolean

clipPlane : Plane

animationsEnabled : boolean

constantlyUpdateMeshUnderPointer : boolean

hoverCursor : string

defaultCursor : string

preventDefaultOnPointerDown : boolean

This is used to call preventDefault() on pointer down

in order to block unwanted artifacts like system double clicks

metadata : any

loadingPluginName : string

onDisposeObservable : Observable<Scene>

An event triggered when the scene is disposed.

@type {BABYLON.Observable}

onDispose : () => void

A function to be executed when this scene is disposed. */

onBeforeRenderObservable : Observable<Scene>

An event triggered before rendering the scene

@type {BABYLON.Observable}

beforeRender : Nullable<() => void>

A function to be executed before rendering this scene */

onAfterRenderObservable : Observable<Scene>

An event triggered after rendering the scene

@type {BABYLON.Observable}

afterRender : Nullable<() => void>

A function to be executed after rendering this scene */

onReadyObservable : Observable<Scene>

An event triggered when the scene is ready

@type {BABYLON.Observable}

onBeforeCameraRenderObservable : Observable<Camera>

An event triggered before rendering a camera

@type {BABYLON.Observable}

beforeCameraRender : () => void

onAfterCameraRenderObservable : Observable<Camera>

An event triggered after rendering a camera

@type {BABYLON.Observable}

afterCameraRender : () => void

onNewCameraAddedObservable : Observable<Camera>

An event triggered when a camera is created

@type {BABYLON.Observable}

onCameraRemovedObservable : Observable<Camera>

An event triggered when a camera is removed

@type {BABYLON.Observable}

onNewLightAddedObservable : Observable<Light>

An event triggered when a light is created

@type {BABYLON.Observable}

onLightRemovedObservable : Observable<Light>

An event triggered when a light is removed

@type {BABYLON.Observable}

onNewGeometryAddedObservable : Observable<Geometry>

An event triggered when a geometry is created

@type {BABYLON.Observable}

onGeometryRemovedObservable : Observable<Geometry>

An event triggered when a geometry is removed

@type {BABYLON.Observable}

onNewMeshAddedObservable : Observable<AbstractMesh>

An event triggered when a mesh is created

@type {BABYLON.Observable}

onMeshRemovedObservable : Observable<AbstractMesh>

An event triggered when a mesh is removed

@type {BABYLON.Observable}

onBeforeStepObservable : Observable<Scene>

An event triggered before calculating deterministic simulation step

@type {BABYLON.Observable}

onAfterStepObservable : Observable<Scene>

An event triggered after calculating deterministic simulation step

@type {BABYLON.Observable}

onRenderingGroupObservable : Observable<RenderingGroupInfo>

This Observable will be triggered for each stage of 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)

animations : Animation[]

pointerDownPredicate : AbstractMesh) => boolean

pointerUpPredicate : AbstractMesh) => boolean

pointerMovePredicate : AbstractMesh) => boolean

onPointerMove : (evt: PointerEvent, pickInfo: PickingInfo) => void

Deprecated. Use onPointerObservable instead */

onPointerDown : (evt: PointerEvent, pickInfo: PickingInfo) => void

Deprecated. Use onPointerObservable instead */

onPointerUp : (evt: PointerEvent, pickInfo: Nullable<PickingInfo>) => void

Deprecated. Use onPointerObservable instead */

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

Deprecated. Use onPointerObservable instead */

gamepadManager : GamepadManager

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

onPointerObservable : Observable<PointerInfo>

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

unTranslatedPointer : Vector2

static DragMovementThreshold : number

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

static LongPressDelay : number

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

static DoubleClickDelay : number

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

static ExclusiveDoubleClickMode : boolean

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

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 */

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

onKeyboardObservable : Observable<KeyboardInfo>

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

useRightHandedSystem : boolean

fogEnabled : boolean

is fog enabled on this scene.

fogMode : number

fogColor : Color3

fogDensity : number

fogStart : number

fogEnd : number

shadowsEnabled : boolean

lightsEnabled : boolean

lights : Light[]

All of the lights added to this scene.

@see BABYLON.Light

@type {BABYLON.Light[]}

cameras : Camera[]

All of the cameras added to this scene. */

activeCameras : Camera[]

All of the active cameras added to this scene. */

activeCamera : Nullable<Camera>

The current active camera */

meshes : AbstractMesh[]

All of the (abstract) meshes added to this scene.

@see BABYLON.AbstractMesh

@type {BABYLON.AbstractMesh[]}

materials : Material[]

multiMaterials : MultiMaterial[]

defaultMaterial : Material

The default material used on meshes when no material is affected */

The default material used on meshes when no material is affected */

texturesEnabled : boolean

textures : BaseTexture[]

particlesEnabled : boolean

particleSystems : IParticleSystem[]

spritesEnabled : boolean

spriteManagers : SpriteManager[]

layers : Layer[]

highlightLayers : HighlightLayer[]

skeletonsEnabled : boolean

skeletons : Skeleton[]

morphTargetManagers : MorphTargetManager[]

lensFlaresEnabled : boolean

lensFlareSystems : LensFlareSystem[]

collisionsEnabled : boolean

collisionCoordinator : ICollisionCoordinator

gravity : Vector3

Defines the gravity applied to this scene */

postProcesses : PostProcess[]

postProcessesEnabled : boolean

postProcessManager : PostProcessManager

postProcessRenderPipelineManager : PostProcessRenderPipelineManager

renderTargetsEnabled : boolean

dumpNextRenderTargets : boolean

customRenderTargets : RenderTargetTexture[]

useDelayedTextureLoading : boolean

importedMeshesFiles : String[]

probesEnabled : boolean

reflectionProbes : ReflectionProbe[]

database : Database

actionManager : ActionManager

This scene's action manager

@type {BABYLON.ActionManager}

proceduralTexturesEnabled : boolean

soundTracks : SoundTrack[]

mainSoundTrack : SoundTrack

VRHelper : VRExperienceHelper

simplificationQueue : SimplificationQueue

animationTimeScale : number

frustumPlanes : Plane[]

requireLightSorting : boolean

debugLayer : DebugLayer

workerCollisions : boolean

selectionOctree : Octree<AbstractMesh>

meshUnderPointer : Nullable<AbstractMesh>

The mesh that is currently under the pointer.

@return {BABYLON.AbstractMesh} mesh under the pointer/mouse cursor or null if none.

pointerX : number

Current on-screen X position of the pointer

@return {number} X position of the pointer

pointerY : number

Current on-screen Y position of the pointer

@return {number} Y position of the pointer

totalVerticesPerfCounter : PerfCounter

totalActiveIndicesPerfCounter : PerfCounter

activeParticlesPerfCounter : PerfCounter

activeBonesPerfCounter : PerfCounter

interFramePerfCounter : PerfCounter

lastFramePerfCounter : PerfCounter

evaluateActiveMeshesDurationPerfCounter : PerfCounter

renderDurationPerfCounter : PerfCounter

particlesDurationPerfCounter : PerfCounter

spriteDuractionPerfCounter : PerfCounter

Animatables : Animatable[]

uid : string

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

this : ()

audioEnabled : boolean

headphone : boolean

isDisposed : boolean

Methods

setStepId(newStepId) void

Parameters

Name Type Description
newStepId number

getStepId() number

getInternalStep() number

getCachedMaterial() Nullable<Material>

getCachedEffect() Nullable<Effect>

getCachedVisibility() Nullable<number>

isCachedMaterialInvalid(material, effect, visibility) boolean

Parameters

Name Type Description
material Material
effect Effect
optional visibility number

getBoundingBoxRenderer() BoundingBoxRenderer

getOutlineRenderer() OutlineRenderer

getEngine() Engine

getTotalVertices() number

getActiveIndices() number

getActiveParticles() number

getActiveBones() number

getInterFramePerfCounter() number

getLastFrameDuration() number

getEvaluateActiveMeshesDuration() number

getActiveMeshes() SmartArray<AbstractMesh>

getRenderTargetsDuration() number

getRenderDuration() number

getParticlesDuration() number

getSpritesDuration() number

getAnimationRatio() number

getRenderId() number

incrementRenderId() void

simulatePointerMove(pickResult) 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

Name Type Description
pickResult PickingInfo

simulatePointerDown(pickResult) 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

Name Type Description
pickResult PickingInfo

simulatePointerUp(pickResult) 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

Name Type Description
pickResult PickingInfo

attachControl(attachUp, attachDown, attachMove) void

Attach events to the canvas (To handle actionManagers triggers and raise onPointerMove, onPointerDown and onPointerUp

Parameters

Name Type Description
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

detachControl() void

isReady() boolean

resetCachedMaterial() void

registerBeforeRender(func) void

Parameters

Name Type Description
func () => void

unregisterBeforeRender(func) void

Parameters

Name Type Description
func () => void

registerAfterRender(func) void

Parameters

Name Type Description
func () => void

unregisterAfterRender(func) void

Parameters

Name Type Description
func () => void

getWaitingItemsCount() number

executeWhenReady(func) void

Registers a function to be executed when the scene is ready.

Parameters

Name Type Description
func () => void

beginAnimation(target, from, to, loop, speedRatio, onAnimationEnd, animatable) Animatable

Will start the animation sequence of a given target

Returns {BABYLON.Animatable} the animatable object created for this animation

See BABYLON.Animatable

Parameters

Name Type Description
target any - the target
from number
to number
optional loop boolean
optional speedRatio number
optional onAnimationEnd () => void

beginDirectAnimation(target, animations, from, to, loop, speedRatio, onAnimationEnd) Animatable

Parameters

Name Type Description
target any
animations Animation[]
from number
to number
optional loop boolean
optional speedRatio number

getAnimatableByTarget(target) Nullable<Animatable>

Parameters

Name Type Description
target any

stopAnimation(target, animationName) void

Will stop the animation of the given target

@see beginAnimation

Parameters

Name Type Description
target any - the target
optional animationName string - the name of the animation to stop (all animations will be stopped is empty)

getViewMatrix() Matrix

getProjectionMatrix() Matrix

getTransformMatrix() Matrix

setTransformMatrix(view, projection) void

Parameters

Name Type Description
view Matrix
projection Matrix

getSceneUniformBuffer() UniformBuffer

getUniqueId() number

addMesh(newMesh) void

Parameters

Name Type Description
newMesh AbstractMesh

removeMesh(toRemove) number

Parameters

Name Type Description
toRemove AbstractMesh

removeSkeleton(toRemove) number

Parameters

Name Type Description
toRemove Skeleton

removeMorphTargetManager(toRemove) number

Parameters

Name Type Description
toRemove MorphTargetManager

removeLight(toRemove) number

Parameters

Name Type Description
toRemove Light

removeCamera(toRemove) number

Parameters

Name Type Description
toRemove Camera

addLight(newLight) void

Parameters

Name Type Description
newLight Light

sortLightsByPriority() void

addCamera(newCamera) void

Parameters

Name Type Description
newCamera Camera

switchActiveCamera(newCamera, attachControl) void

Switch active camera

Parameters

Name Type Description
newCamera Camera
optional attachControl boolean

setActiveCameraByID(id) Nullable<Camera>

sets the active camera of the scene using its ID

@return {BABYLON.Camera|null} the new active camera or null if none found.

@see activeCamera

Parameters

Name Type Description
id string

setActiveCameraByName(name) Nullable<Camera>

sets the active camera of the scene using its name

@return {BABYLON.Camera|null} the new active camera or null if none found.

@see activeCamera

Parameters

Name Type Description
name string

getMaterialByID(id) Nullable<Material>

get a material using its id

@return {BABYLON.Material|null} the material or null if none found.

Parameters

Name Type Description
id string

getMaterialByName(name) Nullable<Material>

get a material using its name

@return {BABYLON.Material|null} the material or null if none found.

Parameters

Name Type Description
name string

getLensFlareSystemByName(name) Nullable<LensFlareSystem>

Parameters

Name Type Description
name string

getLensFlareSystemByID(id) Nullable<LensFlareSystem>

Parameters

Name Type Description
id string

getCameraByID(id) Nullable<Camera>

Parameters

Name Type Description
id string

getCameraByUniqueID(uniqueId) Nullable<Camera>

Parameters

Name Type Description
uniqueId number

getCameraByName(name) Nullable<Camera>

get a camera using its name

@return {BABYLON.Camera|null} the camera or null if none found.

Parameters

Name Type Description
name string

getBoneByID(id) Nullable<Bone>

get a bone using its id

@return {BABYLON.Bone|null} the bone or null if not found

Parameters

Name Type Description
id string

getBoneByName(name) Nullable<Bone>

get a bone using its id

@return {BABYLON.Bone|null} the bone or null if not found

Parameters

Name Type Description
name string

getLightByName(name) Nullable<Light>

get a light node using its name

@return {BABYLON.Light|null} the light or null if none found.

Parameters

Name Type Description
name string

getLightByID(id) Nullable<Light>

get a light node using its ID

@return {BABYLON.Light|null} the light or null if none found.

Parameters

Name Type Description
id string

getLightByUniqueID(uniqueId) Nullable<Light>

get a light node using its scene-generated unique ID

@return {BABYLON.Light|null} the light or null if none found.

Parameters

Name Type Description
uniqueId number

getParticleSystemByID(id) Nullable<IParticleSystem>

get a particle system by id

@return {BABYLON.IParticleSystem|null} the corresponding system or null if none found.

Parameters

Name Type Description
id string {number} the particle system id

getGeometryByID(id) Nullable<Geometry>

get a geometry using its ID

@return {BABYLON.Geometry|null} the geometry or null if none found.

Parameters

Name Type Description
id string

pushGeometry(geometry, force) boolean

add a new geometry to this scene.

@return {boolean} was the geometry added or not

Parameters

Name Type Description
geometry Geometry
optional force boolean

removeGeometry(geometry) boolean

Removes an existing geometry

@return {boolean} was the geometry removed or not

Parameters

Name Type Description
geometry Geometry

getGeometries() Geometry[]

getMeshByID(id) Nullable<AbstractMesh>

Get the first added mesh found of a given ID

@return {BABYLON.AbstractMesh|null} the mesh found or null if not found at all.

Parameters

Name Type Description
id string

getMeshesByID(id) Array<AbstractMesh>

Parameters

Name Type Description
id string

getMeshByUniqueID(uniqueId) Nullable<AbstractMesh>

Get a mesh with its auto-generated unique id

@return {BABYLON.AbstractMesh|null} the mesh found or null if not found at all.

Parameters

Name Type Description
uniqueId number

getLastMeshByID(id) Nullable<AbstractMesh>

Get a the last added mesh found of a given ID

@return {BABYLON.AbstractMesh|null} the mesh found or null if not found at all.

Parameters

Name Type Description
id string

getLastEntryByID(id) Nullable<Node>

Get a the last added node (Mesh, Camera, Light) found of a given ID

@return {BABYLON.Node|null} the node found or null if not found at all.

Parameters

Name Type Description
id string

getNodeByID(id) Nullable<Node>

Parameters

Name Type Description
id string

getNodeByName(name) Nullable<Node>

Parameters

Name Type Description
name string

getMeshByName(name) Nullable<AbstractMesh>

Parameters

Name Type Description
name string

getSoundByName(name) Nullable<Sound>

Parameters

Name Type Description
name string

getLastSkeletonByID(id) Nullable<Skeleton>

Parameters

Name Type Description
id string

getSkeletonById(id) Nullable<Skeleton>

Parameters

Name Type Description
id string

getSkeletonByName(name) Nullable<Skeleton>

Parameters

Name Type Description
name string

getMorphTargetManagerById(id) Nullable<MorphTargetManager>

Parameters

Name Type Description
id number

isActiveMesh(mesh) boolean

Parameters

Name Type Description
mesh AbstractMesh

getHighlightLayerByName(name) Nullable<HighlightLayer>

Return a the first highlight layer of the scene with a given name.

@return The highlight layer if found otherwise null.

Parameters

Name Type Description
name string The name of the highlight layer to look for.

addExternalData(key, data) 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.

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

Parameters

Name Type Description
key string the unique key that identifies the data
data T the data object to associate to the key for this Engine instance

getExternalData(key) Nullable<T>

Get an externaly attached data from its key

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

Parameters

Name Type Description
key string the unique key that identifies the data

getOrAddExternalDataWithFactory(key, factory) T

Get an externaly attached data from its key, create it using a factory if it's not already present

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

Parameters

Name Type Description
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

removeExternalData(key) boolean

Remove an externaly attached data from the Engine instance

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

Parameters

Name Type Description
key string the unique key that identifies the data

freezeActiveMeshes() Scene

Use this function to stop evaluating active meshes. The current list will be keep alive between frames

unfreezeActiveMeshes()

Use this function to restart evaluating active meshes on every frame

updateTransformMatrix(force) void

Parameters

Name Type Description
optional force boolean

updateAlternateTransformMatrix(alternateCamera) void

Parameters

Name Type Description
alternateCamera Camera

render() void

enableDepthRenderer() DepthRenderer

disableDepthRenderer() void

enableGeometryBufferRenderer(ratio) Nullable<GeometryBufferRenderer>

Parameters

Name Type Description
optional ratio number

disableGeometryBufferRenderer() void

freezeMaterials() void

unfreezeMaterials() void

dispose() void

disposeSounds() void

getWorldExtends() : Vector3 }

createOrUpdateSelectionOctree(maxCapacity, maxDepth) Octree<AbstractMesh>

Parameters

Name Type Description
optional maxCapacity number
optional maxDepth number

createPickingRay(x, y, world, camera, cameraViewSpace) Ray

Parameters

Name Type Description
x number
y number
world Matrix
camera Nullable<Camera>

createPickingRayInCameraSpace(x, y, camera) Nullable<Ray>

Parameters

Name Type Description
x number
y number
optional camera Camera

pick(x, y, predicate, fastCheck, camera) Nullable<PickingInfo>

Parameters

Name Type Description
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 Launch a fast check only using the bounding boxes. Can be set to null.

pickSprite(x, y, predicate, fastCheck, camera) Nullable<PickingInfo>

Parameters

Name Type Description
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
optional fastCheck boolean Launch a fast check only using the bounding boxes. Can be set to null.

pickWithRay(ray, predicate, fastCheck) Nullable<PickingInfo>

Parameters

Name Type Description
ray Ray The ray to use to pick meshes
predicate (mesh: AbstractMesh) => boolean Predicate function used to determine eligible sprites. Can be set to null. In this case, a sprite must have isPickable set to true
optional fastCheck boolean Launch a fast check only using the bounding boxes. Can be set to null.

multiPick(x, y, predicate, camera) Nullable<PickingInfo[]>

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

Parameters

Name Type Description
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

multiPickWithRay(ray, predicate) Nullable<PickingInfo[]>

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

Parameters

Name Type Description
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

setPointerOverMesh(mesh) void

Parameters

Name Type Description
mesh Nullable<AbstractMesh>

getPointerOverMesh() Nullable<AbstractMesh>

setPointerOverSprite(sprite) void

Parameters

Name Type Description
sprite Nullable<Sprite>

getPointerOverSprite() Nullable<Sprite>

getPhysicsEngine() Nullable<PhysicsEngine>

enablePhysics(gravity, plugin) boolean

Enables physics to the current scene

@return {boolean} was the physics engine initialized

Parameters

Name Type Description
optional gravity Nullable<Vector3>
optional plugin IPhysicsEnginePlugin

disablePhysicsEngine() void

isPhysicsEnabled() boolean

deleteCompoundImpostor(compound) void

Parameters

Name Type Description
compound any

createDefaultCameraOrLight(createArcRotateCamera, replace, attachCameraControls) void

Parameters

Name Type Description
optional createArcRotateCamera boolean
optional replace boolean
optional attachCameraControls boolean

createDefaultSkybox(environmentTexture, pbr, scale, blur) Nullable<Mesh>

Parameters

Name Type Description
optional environmentTexture BaseTexture
optional pbr boolean
optional scale number

createDefaultVRExperience(webVROptions) void

Parameters

Name Type Description
optional webVROptions WebVROptions

getMeshesByTags(tagsQuery, forEach) Mesh[]

Parameters

Name Type Description
tagsQuery string
optional forEach (mesh: AbstractMesh) => void

getCamerasByTags(tagsQuery, forEach) Camera[]

Parameters

Name Type Description
tagsQuery string
optional forEach (camera: Camera) => void

getLightsByTags(tagsQuery, forEach) Light[]

Parameters

Name Type Description
tagsQuery string
optional forEach (light: Light) => void

getMaterialByTags(tagsQuery, forEach) Material[]

Parameters

Name Type Description
tagsQuery string
optional forEach (material: Material) => void

setRenderingOrder(renderingGroupId, opaqueSortCompareFn, alphaTestSortCompareFn, transparentSortCompareFn) void

Overrides the default sort function applied in the renderging group to prepare the meshes.

This allowed control for front to back rendering or reversly depending of the special needs.

     * @param renderingGroupId The rendering group id corresponding to its index

Parameters

Name Type Description
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.

setRenderingAutoClearDepthStencil(renderingGroupId, autoClearDepthStencil, depth, stencil) void

Specifies whether or not the stencil and depth buffer are cleared between two rendering groups.

     * @param renderingGroupId The rendering group id corresponding to its index

Parameters

Name Type Description
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.

markAllMaterialsAsDirty(flag, predicate) void

Will flag all materials as dirty to trigger new shader compilation

Parameters

Name Type Description
flag number
optional predicate (mat: Material) => boolean If not null, it will be used to specifiy if a material has to be marked as dirty