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 Engine The babylon engine

Members

static MinDeltaTime : number

default : 1.0

In milliseconds, the minimum delta time between two steps

static MaxDeltaTime : number

default : 1000.0

In milliseconds, the maximum delta time between two steps

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.

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 enabled, a double click will not be preceed by a single click

autoClear : boolean

default : true

True to clear the color buffer at each render, false either

clearColor : any

default : Color3(0.2, 0.2, 0.3)

The color of the scene when cleared

ambientColor : Color3

default : Color3(0, 0, 0)

The scene ambiant color

forceWireframe : boolean

default : false

Forces the wireframe display of meshes

forcePointsCloud : boolean

forceShowBoundingBoxes : boolean

clipPlane : Plane

animationsEnabled : boolean

constantlyUpdateMeshUnderPointer : boolean

useRightHandedSystem : boolean

hoverCursor : string

metadata : any

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.

@type {Function}

onBeforeRenderObservable : Observable<Scene>

An event triggered before rendering the scene

@type {BABYLON.Observable}

beforeRender : () => void

A function to be executed before rendering this scene

@type {Function}

onAfterRenderObservable : Observable<Scene>

An event triggered after rendering the scene

@type {BABYLON.Observable}

afterRender : () => void

A function to be executed after rendering this scene

@type {Function}

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

Function triggered before the camera is rendered, with the concerned camera passed in argument

onAfterCameraRenderObservable : Observable<Camera>

An event triggered after rendering a camera

@type {BABYLON.Observable}

afterCameraRender : () => void

Function triggered after the camera is rendered, with the concerned camera passed in argument

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}

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

pointerUpPredicate : (Mesh: AbstractMesh) => boolean

pointerMovePredicate : (Mesh: 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: PickingInfo) => void

@deprecated Use onPointerObservable instead

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

@deprecated Use onPointerObservable instead

onPrePointerObservable : Observable<PointerInfoPre>

This observable event is triggered when any mouse event registered during Scene.attach() is called BEFORE the 3D engine to process anything (mesh/sprite picking for instance).

You have the possibility to skip the 3D Engine process and the call to onPointerObservable by setting PointerInfoBase.skipOnPointerObservable to true

onPointerObservable : Observable<PointerInfo>

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

unTranslatedPointer : Vector2

cameraToUseForPointers : Camera

The camera used for pointers

fogEnabled : boolean

is fog enabled on this scene.

@type {boolean}

fogMode : number

One of the following values : Scene.FOGMODE_NONE, Scene.FOGMODE_EXP, Scene.FOGMODE_EXP2 , Scene.FOGMODE_LINEAR

fogColor : Color3

default : Color3(0.2, 0.2, 0.3)

The fog color

fogDensity : number

default : 0.1

The fog density

fogStart : number

default : 0

Used with the Scene.FOGMODE_LINEAR fogMode

Where the fog starts

fogEnd : number

default : 1000.0

Used with the Scene.FOGMODE_LINEAR fogMode

Where the fog ends

shadowsEnabled : boolean

is shadow enabled on this scene.

@type {boolean}

lightsEnabled : boolean

is light enabled on this scene.

@type {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.

@see BABYLON.Camera

@type {BABYLON.Camera[]}

activeCameras : Camera[]

The array holding the list of active Camera instances

activeCamera : Camera

The active camera for this scene

meshes : AbstractMesh[]

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

@see BABYLON.AbstractMesh

@type {BABYLON.AbstractMesh[]}

materials : Material[]

The array holding all materials of this scene

multiMaterials : MultiMaterial[]

The array holding all multimaterials of this scene

defaultMaterial : StandardMaterial

The default material used on meshes when no material is affected

texturesEnabled : boolean

True if texture should be enabled, false otherwise

textures : BaseTexture[]

The array holding all textures used in the scene

particlesEnabled : boolean

True if Particles should be enabled, false otherwise

particleSystems : ParticleSystem[]

The array holding all particle systems of this scene

spritesEnabled : boolean

spriteManagers : SpriteManager[]

The array holding all sprite managers of this scene

layers : Layer[]

The array holding all layers of this scene

highlightLayers : HighlightLayer[]

skeletonsEnabled : boolean

skeletons : Skeleton[]

The array holding all skeletons of this scene

lensFlaresEnabled : boolean

lensFlareSystems : LensFlareSystem[]

The array holding all lensflare systems of this scene

collisionsEnabled : boolean

True if collisions should be enabled, false otherwise

collisionCoordinator : ICollisionCoordinator

gravity : Vector3

Defines the gravity applied to this scene

postProcessesEnabled : boolean

True if postProcesses should be enabled, false otherwise

postProcessManager : PostProcessManager

The post process manager of this scene

postProcessRenderPipelineManager : PostProcessRenderPipelineManager

The post process render pipeline manager of this scene

renderTargetsEnabled : boolean

True if custom render target should be enabled, false otherwise

dumpNextRenderTargets : boolean

customRenderTargets : RenderTargetTexture[]

The array holding all custom render targets of this scene

useDelayedTextureLoading : boolean

True if the texture loading should be delayed, false otherwise

importedMeshesFiles : String[]

The array holding all imported mesh files

probesEnabled : boolean

reflectionProbes : ReflectionProbe[]

database : any

The database this scene is saved into

actionManager : ActionManager

This scene's action manager

@type {BABYLON.ActionManager}

proceduralTexturesEnabled : boolean

mainSoundTrack : SoundTrack

soundTracks : SoundTrack[]

simplificationQueue : SimplificationQueue

debugLayer : DebugLayer

workerCollisions : boolean

SelectionOctree : Octree<AbstractMesh>

meshUnderPointer : 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

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

audioEnabled : boolean

headphone : boolean

Methods

getCachedMaterial() → Material

getBoundingBoxRenderer() → BoundingBoxRenderer

Returns the bounding box renderer

getOutlineRenderer() → OutlineRenderer

Returns the outline rendrer

getEngine() → Engine

Returns the engine

getTotalVertices() → number

Returns all the vertices of this scene

getActiveIndices() → number

getActiveParticles() → number

Returns all the active particles of this scene

getActiveBones() → number

getLastFrameDuration() → number

Returns the duration of the last frame in milliseconds

getEvaluateActiveMeshesDuration() → number

Returns the duration of active meshes in milliseconds

getActiveMeshes() → SmartArray<Mesh>

Returns the list of acti meshes of this scene

getRenderTargetsDuration() → number

Returns the duration of targets render in milliseconds

getRenderDuration() → number

Returns the duration of the last render in milliseconds

getParticlesDuration() → number

Returns the duration of the last particles processing in milliseconds

getSpritesDuration() → number

Returns the duration of the last sprites processing in milliseconds

getAnimationRatio() → number

Returns the animation ratio (speed)

getRenderId() → number

Returns the render ID of this scene

incrementRenderId() → void

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 defines if you want to attach events to pointerup
optional attachDown boolean defines if you want to attach events to pointerdown defines if you want to attach events to pointerdown
optional attachMove boolean defines if you want to attach events to pointermove defines if you want to attach events to pointermove

detachControl() → void

Detaches mouse/keyboard control to this scene

isReady() → boolean

Returns true when the scene is ready to be displayed (all meshes are ready and all materials are ready)

resetCachedMaterial() → void

registerBeforeRender(func) → void

Registers in an array the given function which will be executed before rendering the scene

Parameters

Name Type Description
func () => void The given function to call

unregisterBeforeRender(func) → void

Removes the given function from the beforeRender array

Parameters

Name Type Description
func () => void The given function to call

registerAfterRender(func) → void

Parameters

Name Type Description
func () => void The given function to call

unregisterAfterRender(func) → void

Parameters

Name Type Description
func () => void The given function to call

getWaitingItemsCount() → number

Returns the length of pending data (not ready yet)

executeWhenReady(func) → void

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

Parameters

Name Type Description
func () => void The given function to call

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

Will start the animation sequence of a given target

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

@see BABYLON.Animatable

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

Parameters

Name Type Description
target any - the target - the target - the target - the target - the target
from number The starting frame
to number The ending frame
optional loop boolean If true, the animation will loop
optional speedRatio number default : 1.The speed ratio of this animation
optional onAnimationEnd () => void The function triggered on the end of the animation

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

Begins a direct animation (no children animations)

Parameters

Name Type Description
target any - the target - the target - the target - the target
animations Animation[] An array of animations
from number The starting frame
to number The ending frame
optional loop boolean If true, the animation will loop
optional speedRatio number default : 1.The speed ratio of this animation

getAnimatableByTarget(target) → Animatable

Returns the first Animatable instance having the given target in the active animatable array

Parameters

Name Type Description
target any - the target - the target - the target - the target

stopAnimation(target, animationName) → void

Will stop the animation of the given target

@see beginAnimation

Parameters

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

getViewMatrix() → Matrix

Returns the view Matrix

getProjectionMatrix() → Matrix

Returns the projection Matrix

getTransformMatrix() → Matrix

Returns the transform Matrix

setTransformMatrix(view, projection) → void

Sets the transform matrix by multiplying the given view Matrix by the given projection Matrix

Parameters

Name Type Description
view Matrix The given view Matrix
projection Matrix The given projection Matrix

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

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

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) → 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 The given id

setActiveCameraByName(name) → 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 The given name

getMaterialByID(id) → Material

get a material using its id

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

Parameters

Name Type Description
id string The given id

getMaterialByName(name) → Material

get a material using its name

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

Parameters

Name Type Description
name string The given name

getLensFlareSystemByName(name) → LensFlareSystem

Parameters

Name Type Description
name string The given name

getLensFlareSystemByID(id) → LensFlareSystem

Parameters

Name Type Description
id string The given id

getCameraByID(id) → Camera

Returns the first Camera instance using the given id

Parameters

Name Type Description
id string The given id

getCameraByUniqueID(uniqueId) → Camera

Parameters

Name Type Description
uniqueId number

getCameraByName(name) → Camera

get a camera using its name

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

Parameters

Name Type Description
name string The given name

getBoneByID(id) → Bone

get a bone using its id

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

Parameters

Name Type Description
id string The given id

getBoneByName(name) → Bone

get a bone using its id

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

Parameters

Name Type Description
name string The given name

getLightByName(name) → 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 The given name

getLightByID(id) → 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 The given id

getLightByUniqueID(uniqueId) → 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) → ParticleSystem

get a particle system by id

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

Parameters

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

getGeometryByID(id) → Geometry

get a geometry using its ID

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

Parameters

Name Type Description
id string The given id

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 True to force the transform matrix update even if the projection is synchronized, false otherwise

removeGeometry(geometry) → boolean

Removes an existing geometry

@return {boolean} was the geometry removed or not

Parameters

Name Type Description
geometry Geometry

getGeometries() → Geometry[]

Returns the list of geometries of this scene

getMeshByID(id) → 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 The given id

getMeshesByID(id) → Array<AbstractMesh>

Parameters

Name Type Description
id string The given id

getMeshByUniqueID(uniqueId) → 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) → 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 The given id

getLastEntryByID(id) → 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 The given id

getNodeByID(id) → Node

Parameters

Name Type Description
id string The given id

getNodeByName(name) → Node

Parameters

Name Type Description
name string The given name

getMeshByName(name) → AbstractMesh

Returns the Mesh instance having the given name

Parameters

Name Type Description
name string The given name

getSoundByName(name) → Sound

Parameters

Name Type Description
name string The given name

getLastSkeletonByID(id) → Skeleton

Returns the last instance of Skeleton using the given id

Parameters

Name Type Description
id string The given id

getSkeletonById(id) → Skeleton

Returns the first Skeleton instance using the given id

Parameters

Name Type Description
id string The given id

getSkeletonByName(name) → Skeleton

Returns the first Skeleton instance corresponding to the given name

Parameters

Name Type Description
name string The given name

isActiveMesh(mesh) → boolean

Tests if the given mesh is active or not

Parameters

Name Type Description
mesh Mesh The given mesh

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) → 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 any the unique key that identifies the data

updateTransformMatrix(force) → void

Updates the transform matrix of this scene with the one of the active camera

Parameters

Name Type Description
optional force boolean True to force the transform matrix update even if the projection is synchronized, false otherwise

render() → void

Renders this Scene

enableDepthRenderer() → DepthRenderer

disableDepthRenderer() → void

freezeMaterials() → void

unfreezeMaterials() → void

dispose() → void

Remove of this scene all lights, meshes, cameras, materials, particle systems, spritemanagers.

disposeSounds() → void

getWorldExtends() → { min: Vector3, max: Vector3 }

createOrUpdateSelectionOctree(maxCapacity, maxDepth) → Octree<AbstractMesh>

Creates a new octree for this scene or update it if existing.

Parameters

Name Type Description
optional maxCapacity number default : 64 The maximum capacity of the octree
optional maxDepth number default : 2 The maximum depth of the octree

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

Parameters

Name Type Description
x number X position on screen
y number Y position on screen
world Matrix The world Matrix
camera Camera

createPickingRayInCameraSpace(x, y, camera) → Ray

Parameters

Name Type Description
x number X position on screen
y number Y position on screen
camera Camera

pick(x, y, predicate, fastCheck, camera) → 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
optional fastCheck boolean Launch a fast check only using the bounding boxes. Can be set to null.

pickSprite(x, y, predicate, fastCheck, camera) → PickingInfo

Parameters

Name Type Description
x number X position on screen
y number Y position on screen
optional predicate (sprite: Sprite) => 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.

pickWithRay(ray, predicate, fastCheck) → PickingInfo

Function used to pick a mesh by giving a ray (instead of a position).

Parameters

Name Type Description
ray Ray The given Ray
predicate (mesh: Mesh) => 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.

multiPick(x, y, predicate, camera) → PickingInfo[]

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) → PickingInfo[]

Parameters

Name Type Description
ray Ray The given Ray
predicate (mesh: Mesh) => 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

The action OnPointerOutTrigger and OnPointerOverTrigger are triggered for the given mesh

Parameters

Name Type Description
mesh AbstractMesh The given mesh

getPointerOverMesh() → AbstractMesh

Returns the pointer over the mesh

setPointerOverSprite(sprite) → void

Parameters

Name Type Description
sprite Sprite

getPointerOverSprite() → Sprite

getPhysicsEngine() → PhysicsEngine

Returns the physic engine used for this scene

enablePhysics(gravity, plugin) → boolean

Enables physics to the current scene

@return {boolean} was the physics engine initialized

Parameters

Name Type Description
optional gravity Vector3 The given gravity
optional plugin IPhysicsEnginePlugin default : OimoJSPlugin. The physics plugin used

disablePhysicsEngine() → void

Delete the physics engine of the scene

isPhysicsEnabled() → boolean

True if a physic engine is defined, false otherwise

setGravity(gravity) → void

Parameters

Name Type Description
gravity Vector3 The given gravity

createCompoundImpostor(parts, options) → any

Legacy support, using the new API

@Deprecated

Parameters

Name Type Description
parts any The array of object build this way {mesh: Mesh, impostor: number}
options PhysicsImpostorParameters An object build this way {mass: number, friction: number, restitution: number}

deleteCompoundImpostor(compound) → void

Unregister the compound impostor in the physic engine.

Parameters

Name Type Description
compound any The param type is the one used by the physics plugin

createDefaultCameraOrLight() → void

getMeshesByTags(tagsQuery, forEach) → Mesh[]

Returns the list of meshes corresponding to the tag query given in parameter

Parameters

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

getCamerasByTags(tagsQuery, forEach) → Camera[]

Returns the list of cameras corresponding to the tag query given in parameter

Parameters

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

getLightsByTags(tagsQuery, forEach) → Light[]

Returns the list of lights corresponding to the tag query given in parameter

Parameters

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

getMaterialByTags(tagsQuery, forEach) → Material[]

Parameters

Name Type Description
tagsQuery string !tag5))
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 (a: SubMesh, b: SubMesh) => number The opaque queue comparison function use to sort.
optional alphaTestSortCompareFn (a: SubMesh, b: SubMesh) => number The alpha test queue comparison function use to sort.

setRenderingAutoClearDepthStencil(renderingGroupId, autoClearDepthStencil) → 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.