Class Scene
Hierarchy
-
AbstractScene
- Scene
Implements
Index
Constructors
Properties
- action
Manager - action
Managers - active
Cameras - ambient
Color - animation
Groups - animation
Time Scale - animations
- animations
Enabled - audio
Enabled - audio
Listener Position Provider - audio
Positioning Refresh Rate - auto
Clear - auto
Clear Depth And Stencil - camera
ToUse For Pointers - cameras
- clear
Color - clip
Plane - clip
Plane2 - clip
Plane3 - clip
Plane4 - clip
Plane5 - clip
Plane6 - collisions
Enabled - constantly
Update Mesh Under Pointer - customLODSelector
- custom
Render Targets - debug
Layer - default
Cursor - delta
Time - disable
Offline Support Exception Rules - dispatch
All Sub Meshes OfActive Meshes - do
Not Handle Cursors - dump
Next Render Targets - effect
Layers - environmentBRDFTexture
- fog
Color - fog
Density - fog
End - fog
Start - force
Show Bounding Boxes - gamepad
Manager - geometries
- geometry
Buffer Renderer - get
Active Mesh Candidates - get
Active Sub Mesh Candidates - get
Colliding Sub Mesh Candidates - get
Deterministic Frame Time - get
Intersecting Sub Mesh Candidates - gravity
- headphone
- hover
Cursor - imported
Meshes Files - layers
- lens
Flare Systems - lens
Flares Enabled - lights
- loading
Plugin Name - main
Sound Track - materials
- meshes
- metadata
- morph
Target Managers - multi
Materials - offline
Provider - on
Active Camera Changed - on
After Active Meshes Evaluation Observable - on
After Animations Observable - on
After Camera Render Observable - on
After Draw Phase Observable - on
After Particles Rendering Observable - on
After Physics Observable - on
After Render Camera Observable - on
After Render Observable - on
After Render Targets Render Observable - on
After Rendering Group Observable - on
After Sprites Rendering Observable - on
After Step Observable - on
Animation File Imported Observable - on
Before Active Meshes Evaluation Observable - on
Before Animations Observable - on
Before Camera Render Observable - on
Before Draw Phase Observable - on
Before Particles Rendering Observable - on
Before Physics Observable - on
Before Render Observable - on
Before Render Targets Render Observable - on
Before Rendering Group Observable - on
Before Sprites Rendering Observable - on
Before Step Observable - on
Camera Removed Observable - on
Data Loaded Observable - on
Dispose Observable - on
Geometry Removed Observable - on
Keyboard Observable - on
Light Removed Observable - on
Material Removed Observable - on
Mesh Imported Observable - on
Mesh Removed Observable - on
Multi Material Removed Observable - on
New Camera Added Observable - on
New Geometry Added Observable - on
New Light Added Observable - on
New Material Added Observable - on
New Mesh Added Observable - on
New Multi Material Added Observable - on
New Skeleton Added Observable - on
New Texture Added Observable - on
New Transform Node Added Observable - on
Pointer Down - on
Pointer Move - on
Pointer Observable - on
Pointer Pick - on
Pointer Up - on
Pre Keyboard Observable - on
Pre Pointer Observable - on
Ready Observable - on
Skeleton Removed Observable - on
Texture Removed Observable - on
Transform Node Removed Observable - particle
Systems - particles
Enabled - physics
Enabled - pointer
Down Predicate - pointer
Move Predicate - pointer
UpPredicate - post
Process Manager - post
Process Render Pipeline Manager - post
Processes - post
Processes Enabled - pre
Pass - pre
Pass Renderer - prevent
Default OnPointer Down - prevent
Default OnPointer Up - probes
Enabled - procedural
Textures - procedural
Textures Enabled - reflection
Probes - render
Targets Enabled - require
Light Sorting - reserved
Data Store - root
Nodes - selection
Octree - simplification
Queue - skeletons
- sound
Tracks - sounds
- sprite
Managers - sprites
Enabled - sub
Surface Configuration - textures
- transform
Nodes - use
Constant Animation Delta Time - use
Delayed Texture Loading - FOGMODE_
EXP - FOGMODE_
EXP2 - FOGMODE_
LINEAR - FOGMODE_
NONE - Max
Delta Time - Min
Delta Time
Accessors
- active
Bones Perf Counter - active
Camera - active
Particles Perf Counter - after
Camera Render - after
Render - animatables
- animation
Properties Override - before
Camera Render - before
Render - block
Material Dirty Mechanism - blockfree
Active Meshes And Rendering Groups - default
Material - environment
Intensity - environment
Texture - fog
Enabled - fog
Mode - force
Points Cloud - force
Wireframe - frustum
Planes - image
Processing Configuration - is
Disposed - is
Loading - lights
Enabled - mesh
Under Pointer - on
Dispose - pointerX
- pointerY
- shadows
Enabled - skeletons
Enabled - skip
Frustum Clipping - textures
Enabled - total
Active Indices Perf Counter - total
Vertices Perf Counter - uid
- un
Translated Pointer - use
Right Handed System - Double
Click Delay - Drag
Movement Threshold - Exclusive
Double Click Mode - Long
Press Delay
Methods
- add
Action Manager - add
Animation - add
Animation Group - add
Camera - add
Effect Layer - add
External Data - add
Geometry - add
Lens Flare System - add
Light - add
Material - add
Mesh - add
Morph Target Manager - add
Multi Material - add
Particle System - add
Reflection Probe - add
Skeleton - add
Texture - add
Transform Node - animate
- attach
Control - begin
Animation - begin
Direct Animation - begin
Direct Hierarchy Animation - begin
Hierarchy Animation - begin
Weighted Animation - clean
Cached Texture Buffer - clear
Cached Vertex Data - create
Default Camera - create
Default Camera OrLight - create
Default Environment - create
Default Light - create
Default Skybox - create
DefaultVRExperience - create
DefaultXRExperience Async - create
OrUpdate Selection Octree - create
Picking Ray - create
Picking Ray InCamera Space - create
Picking Ray InCamera Space ToRef - create
Picking Ray ToRef - delete
Compound Impostor - detach
Control - disable
Depth Renderer - disable
Geometry Buffer Renderer - disable
Physics Engine - disable
Pre Pass Renderer - disable
Sub Surface For Pre Pass - dispose
- enable
Depth Renderer - enable
Geometry Buffer Renderer - enable
Physics - enable
Pre Pass Renderer - enable
Sub Surface For Pre Pass - execute
Once Before Render - execute
When Ready - free
Active Meshes - free
Processed Materials - free
Rendering Groups - freeze
Active Meshes - freeze
Materials - get
Active Bones - get
Active Indices - get
Active Meshes - get
Active Particles - get
All Animatables ByTarget - get
Animatable ByTarget - get
Animation Group ByName - get
Animation Ratio - get
Auto Clear Depth Stencil Setup - get
Bone ByID - get
Bone ByName - get
Bounding Box Renderer - get
Cached Effect - get
Cached Material - get
Cached Visibility - get
Camera ByID - get
Camera ByName - get
Camera ByUniqueID - get
Cameras ByTags - get
Class Name - get
Engine - get
External Data - get
Frame Id - get
Geometries - get
Geometry ByID - get
Glow Layer ByName - get
Highlight Layer ByName - get
Internal Step - get
Last Entry ByID - get
Last Material ByID - get
Last Mesh ByID - get
Last Skeleton ByID - get
Lens Flare System ByID - get
Lens Flare System ByName - get
Light ByID - get
Light ByName - get
Light ByUniqueID - get
Lights ByTags - get
Material ByID - get
Material ByName - get
Material ByTags - get
Material ByUniqueID - get
Mesh ByID - get
Mesh ByName - get
Mesh ByUniqueID - get
Meshes ByID - get
Meshes ByTags - get
Morph Target ById - get
Morph Target ByName - get
Morph Target Manager ById - get
Node ByID - get
Node ByName - get
Nodes - get
OrAdd External Data With Factory - get
Outline Renderer - get
Particle System ByID - get
Physics Engine - get
Pointer Over Mesh - get
Pointer Over Sprite - get
Post Process ByName - get
Projection Matrix - get
Render Id - get
Scene Uniform Buffer - get
Skeleton ById - get
Skeleton ByName - get
Skeleton ByUnique Id - get
Sound ByName - get
Step Id - get
Texture ByUniqueID - get
Total Vertices - get
Transform Matrix - get
Transform Node ByID - get
Transform Node ByName - get
Transform Node ByUniqueID - get
Transform Nodes ByID - get
Transform Nodes ByTags - get
Unique Id - get
View Matrix - get
Waiting Items Count - get
World Extends - increment
Render Id - is
Active Mesh - is
Cached Material Invalid - is
Physics Enabled - is
Pointer Captured - is
Ready - mark
All Materials AsDirty - multi
Pick - multi
Pick Sprite - multi
Pick Sprite With Ray - multi
Pick With Ray - pick
- pick
Sprite - pick
Sprite With Ray - pick
With Bounding Info - pick
With Ray - push
Geometry - register
After Render - register
Before Render - remove
Action Manager - remove
Animation - remove
Animation Group - remove
Camera - remove
Effect Layer - remove
External Data - remove
Geometry - remove
Lens Flare System - remove
Light - remove
Material - remove
Mesh - remove
Morph Target Manager - remove
Multi Material - remove
Particle System - remove
Reflection Probe - remove
Skeleton - remove
Texture - remove
Transform Node - render
- reset
Cached Material - reset
Last Animation Time Frame - set
Active Camera ByID - set
Active Camera ByName - set
Default Candidate Providers - set
Pointer Over Mesh - set
Pointer Over Sprite - set
Rendering Auto Clear Depth Stencil - set
Rendering Order - set
Step Id - set
Transform Matrix - simulate
Pointer Down - simulate
Pointer Move - simulate
Pointer Up - sort
Lights ByPriority - stop
All Animations - stop
Animation - switch
Active Camera - unfreeze
Active Meshes - unfreeze
Materials - unregister
After Render - unregister
Before Render - update
Transform Matrix - when
Ready Async - Add
Individual Parser - Add
Parser - Collision
Coordinator Factory - Default
Material Factory - Get
Individual Parser - Get
Parser - Parse
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
action ManagerSearch playground for actionManager
Gets or sets the action manager associated with the scene
action ManagersSearch playground for actionManagers
ActionManagers available on the scene.
active CamerasSearch playground for activeCameras
All of the active cameras added to this scene.
ambient ColorSearch playground for ambientColor
Defines the color used to simulate the ambient color (Default is (0, 0, 0))
animation GroupsSearch playground for animationGroups
All of the animation groups added to this scene
animation Time ScaleSearch playground for animationTimeScale
Gets or sets a general scale for animation speed
animationsSearch playground for animations
Gets a list of Animations associated with the scene
animations EnabledSearch playground for animationsEnabled
Gets or sets a boolean indicating if animations are enabled
audio EnabledSearch playground for audioEnabled
Gets or sets if audio support is enabled
audio Listener Position ProviderSearch playground for audioListenerPositionProvider
Gets or sets custom audio listener position provider
audio Positioning Refresh RateSearch playground for audioPositioningRefreshRate
Gets or sets a refresh rate when using 3D audio positioning
auto ClearSearch playground for autoClear
Gets or sets a boolean that indicates if the scene must clear the render buffer before rendering a frame
auto Clear Depth And StencilSearch playground for autoClearDepthAndStencil
Gets or sets a boolean that indicates if the scene must clear the depth and stencil buffers before rendering a frame
camera ToUse For PointersSearch playground for cameraToUseForPointers
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
All of the cameras added to this scene
clear ColorSearch playground for clearColor
Defines the color used to clear the render buffer (Default is (0.2, 0.2, 0.3, 1.0))
clip PlaneSearch playground for clipPlane
Gets or sets the active clipplane 1
clip Plane2Search playground for clipPlane2
Gets or sets the active clipplane 2
clip Plane3Search playground for clipPlane3
Gets or sets the active clipplane 3
clip Plane4Search playground for clipPlane4
Gets or sets the active clipplane 4
clip Plane5Search playground for clipPlane5
Gets or sets the active clipplane 5
clip Plane6Search playground for clipPlane6
Gets or sets the active clipplane 6
collisions EnabledSearch playground for collisionsEnabled
Gets or sets a boolean indicating if collisions are enabled on this scene
constantly Update Mesh Under PointerSearch playground for constantlyUpdateMeshUnderPointer
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
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
-
-
Parameters
-
mesh: AbstractMesh
-
camera: Camera
Returns Nullable<AbstractMesh>
-
-
custom Render TargetsSearch playground for customRenderTargets
The list of user defined render targets added to the scene
debug LayerSearch playground for debugLayer
Gets the debug layer (aka Inspector) associated with the scene
default CursorSearch playground for defaultCursor
Defines the HTML default cursor to use (empty by default)
delta TimeSearch playground for deltaTime
Gets the current delta time used by animation engine
disable Offline Support Exception RulesSearch playground for disableOfflineSupportExceptionRules
Use this array to add regular expressions used to disable offline support for specific urls
dispatch All Sub Meshes OfActive MeshesSearch playground for dispatchAllSubMeshesOfActiveMeshes
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)
do Not Handle CursorsSearch playground for doNotHandleCursors
Defines whether cursors are handled by the scene.
dump Next Render TargetsSearch playground for dumpNextRenderTargets
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
effect LayersSearch playground for effectLayers
The list of effect layers (highlights/glow) added to the scene
environmentBRDFTextureSearch playground for environmentBRDFTexture
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):
- For uncorrelated BRDF (pbr.brdf.useEnergyConservation = false and pbr.brdf.useSmithVisibilityHeightCorrelated = false) : https://assets.babylonjs.com/environments/uncorrelatedBRDF.dds
- For correlated BRDF (pbr.brdf.useEnergyConservation = false and pbr.brdf.useSmithVisibilityHeightCorrelated = true) : https://assets.babylonjs.com/environments/correlatedBRDF.dds
- For correlated multi scattering BRDF (pbr.brdf.useEnergyConservation = true and pbr.brdf.useSmithVisibilityHeightCorrelated = true) : https://assets.babylonjs.com/environments/correlatedMSBRDF.dds The material properties need to be setup according to the type of texture in use.
fog ColorSearch playground for fogColor
Gets or sets the fog color to use
fog DensitySearch playground for fogDensity
Gets or sets the fog density to use
fog EndSearch playground for fogEnd
Gets or sets the fog end distance to use
fog StartSearch playground for fogStart
Gets or sets the fog start distance to use
force Show Bounding BoxesSearch playground for forceShowBoundingBoxes
Gets or sets a boolean indicating if all bounding boxes must be rendered
gamepad ManagerSearch playground for gamepadManager
Gets the gamepad manager associated with the scene
geometriesSearch playground for geometries
The list of geometries used in the scene.
geometry Buffer RendererSearch playground for geometryBufferRenderer
Gets or Sets the current geometry buffer associated to the scene.
get Active Mesh CandidatesSearch playground for getActiveMeshCandidates
Lambda returning the list of potentially active meshes.
Type declaration
-
-
Returns ISmartArrayLike<AbstractMesh>
-
get Active Sub Mesh CandidatesSearch playground for getActiveSubMeshCandidates
Lambda returning the list of potentially active sub meshes.
Type declaration
-
-
Parameters
-
mesh: AbstractMesh
Returns ISmartArrayLike<SubMesh>
-
-
get Colliding Sub Mesh CandidatesSearch playground for getCollidingSubMeshCandidates
Lambda returning the list of potentially colliding sub meshes.
Type declaration
-
-
Parameters
-
mesh: AbstractMesh
-
collider: Collider
Returns ISmartArrayLike<SubMesh>
-
-
get Deterministic Frame TimeSearch playground for getDeterministicFrameTime
User updatable function that will return a deterministic frame time when engine is in deterministic lock step mode
Type declaration
-
-
Returns number
-
get Intersecting Sub Mesh CandidatesSearch playground for getIntersectingSubMeshCandidates
Lambda returning the list of potentially intersecting sub meshes.
Type declaration
-
-
Parameters
-
mesh: AbstractMesh
-
localRay: Ray
Returns ISmartArrayLike<SubMesh>
-
-
gravitySearch playground for gravity
Defines the gravity applied to this scene (used only for collisions)
headphoneSearch playground for headphone
Gets or sets if audio will be output to headphones
hover CursorSearch playground for hoverCursor
Defines the HTML cursor to use when hovering over interactive elements
imported Meshes FilesSearch playground for importedMeshesFiles
Gets the list of meshes imported to the scene through SceneLoader
layersSearch playground for layers
The list of layers (background and foreground) of the scene
lens Flare SystemsSearch playground for lensFlareSystems
The list of lens flare system added to the scene
lens Flares EnabledSearch playground for lensFlaresEnabled
Gets or sets a boolean indicating if lens flares are enabled on this scene
lightsSearch playground for lights
All of the lights added to this scene
loading Plugin NameSearch playground for loadingPluginName
Gets the name of the plugin used to load this scene (null by default)
main Sound TrackSearch playground for mainSoundTrack
The main sound track played by the scene. It cotains your primary collection of sounds.
materialsSearch playground for materials
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.
meshesSearch playground for meshes
All of the (abstract) meshes added to this scene
metadataSearch playground for metadata
Gets or sets user defined metadata
morph Target ManagersSearch playground for morphTargetManagers
The list of morph target managers added to the scene
multi MaterialsSearch playground for multiMaterials
All of the multi-materials added to this scene
offline ProviderSearch playground for offlineProvider
Gets or sets the current offline provider to use to store scene data
on Active Camera ChangedSearch playground for onActiveCameraChanged
An event triggered when the activeCamera property is updated
on After Active Meshes Evaluation ObservableSearch playground for onAfterActiveMeshesEvaluationObservable
An event triggered when active meshes evaluation is done
on After Animations ObservableSearch playground for onAfterAnimationsObservable
An event triggered after animations processing
on After Camera Render ObservableSearch playground for onAfterCameraRenderObservable
An event triggered after rendering a camera
on After Draw Phase ObservableSearch playground for onAfterDrawPhaseObservable
An event triggered after draw calls have been sent
on After Particles Rendering ObservableSearch playground for onAfterParticlesRenderingObservable
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)
on After Physics ObservableSearch playground for onAfterPhysicsObservable
An event triggered when physic simulation has been done
on After Render Camera ObservableSearch playground for onAfterRenderCameraObservable
An event triggered after rendering the scene for an active camera (When scene.render is called this will be called after each camera)
on After Render ObservableSearch playground for onAfterRenderObservable
An event triggered after rendering the scene
on After Render Targets Render ObservableSearch playground for onAfterRenderTargetsRenderObservable
An event triggered when render targets were rendered. Can happen multiple times per frame.
on After Rendering Group ObservableSearch playground for onAfterRenderingGroupObservable
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)
on After Sprites Rendering ObservableSearch playground for onAfterSpritesRenderingObservable
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)
on After Step ObservableSearch playground for onAfterStepObservable
An event triggered after calculating deterministic simulation step
on Animation File Imported ObservableSearch playground for onAnimationFileImportedObservable
This Observable will when an animation file has been imported into the scene.
on Before Active Meshes Evaluation ObservableSearch playground for onBeforeActiveMeshesEvaluationObservable
An event triggered when active meshes evaluation is about to start
on Before Animations ObservableSearch playground for onBeforeAnimationsObservable
An event triggered before animating the scene
on Before Camera Render ObservableSearch playground for onBeforeCameraRenderObservable
An event triggered before rendering a camera
on Before Draw Phase ObservableSearch playground for onBeforeDrawPhaseObservable
An event triggered before draw calls are ready to be sent
on Before Particles Rendering ObservableSearch playground for onBeforeParticlesRenderingObservable
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)
on Before Physics ObservableSearch playground for onBeforePhysicsObservable
An event triggered when physic simulation is about to be run
on Before Render ObservableSearch playground for onBeforeRenderObservable
An event triggered before rendering the scene (right after animations and physics)
on Before Render Targets Render ObservableSearch playground for onBeforeRenderTargetsRenderObservable
An event triggered when render targets are about to be rendered Can happen multiple times per frame.
on Before Rendering Group ObservableSearch playground for onBeforeRenderingGroupObservable
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)
on Before Sprites Rendering ObservableSearch playground for onBeforeSpritesRenderingObservable
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)
on Before Step ObservableSearch playground for onBeforeStepObservable
An event triggered before calculating deterministic simulation step
on Camera Removed ObservableSearch playground for onCameraRemovedObservable
An event triggered when a camera is removed
on Data Loaded ObservableSearch playground for onDataLoadedObservable
An event triggered when SceneLoader.Append or SceneLoader.Load or SceneLoader.ImportMesh were successfully executed
on Dispose ObservableSearch playground for onDisposeObservable
An event triggered when the scene is disposed.
on Geometry Removed ObservableSearch playground for onGeometryRemovedObservable
An event triggered when a geometry is removed
on Keyboard ObservableSearch playground for onKeyboardObservable
Observable event triggered each time an keyboard event is received from the hosting window
on Light Removed ObservableSearch playground for onLightRemovedObservable
An event triggered when a light is removed
on Material Removed ObservableSearch playground for onMaterialRemovedObservable
An event triggered when a material is removed
on Mesh Imported ObservableSearch playground for onMeshImportedObservable
This Observable will when a mesh has been imported into the scene.
on Mesh Removed ObservableSearch playground for onMeshRemovedObservable
An event triggered when a mesh is removed
on Multi Material Removed ObservableSearch playground for onMultiMaterialRemovedObservable
An event triggered when a multi material is removed
on New Camera Added ObservableSearch playground for onNewCameraAddedObservable
An event triggered when a camera is created
on New Geometry Added ObservableSearch playground for onNewGeometryAddedObservable
An event triggered when a geometry is created
on New Light Added ObservableSearch playground for onNewLightAddedObservable
An event triggered when a light is created
on New Material Added ObservableSearch playground for onNewMaterialAddedObservable
An event triggered when a material is created
on New Mesh Added ObservableSearch playground for onNewMeshAddedObservable
An event triggered when a mesh is created
on New Multi Material Added ObservableSearch playground for onNewMultiMaterialAddedObservable
An event triggered when a multi material is created
on New Skeleton Added ObservableSearch playground for onNewSkeletonAddedObservable
An event triggered when a skeleton is created
on New Texture Added ObservableSearch playground for onNewTextureAddedObservable
An event triggered when a texture is created
on New Transform Node Added ObservableSearch playground for onNewTransformNodeAddedObservable
An event triggered when a transform node is created
on Pointer DownSearch playground for onPointerDown
Callback called when a pointer down is detected
Type declaration
-
-
Parameters
-
evt: PointerEvent
-
pickInfo: PickingInfo
-
type: PointerEventTypes
Returns void
-
-
on Pointer MoveSearch playground for onPointerMove
Callback called when a pointer move is detected
Type declaration
-
-
Parameters
-
evt: PointerEvent
-
pickInfo: PickingInfo
-
type: PointerEventTypes
Returns void
-
-
on Pointer ObservableSearch playground for onPointerObservable
Observable event triggered each time an input event is received from the rendering canvas
on Pointer PickSearch playground for onPointerPick
Callback called when a pointer pick is detected
Type declaration
-
-
Parameters
-
evt: PointerEvent
-
pickInfo: PickingInfo
Returns void
-
-
on Pointer UpSearch playground for onPointerUp
Callback called when a pointer up is detected
Type declaration
-
-
Parameters
-
evt: PointerEvent
-
pickInfo: Nullable<PickingInfo>
-
type: PointerEventTypes
Returns void
-
-
on Pre Keyboard ObservableSearch playground for onPreKeyboardObservable
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
on Pre Pointer ObservableSearch playground for onPrePointerObservable
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
on Ready ObservableSearch playground for onReadyObservable
An event triggered when the scene is ready
on Skeleton Removed ObservableSearch playground for onSkeletonRemovedObservable
An event triggered when a skeleton is removed
on Texture Removed ObservableSearch playground for onTextureRemovedObservable
An event triggered when a texture is removed
on Transform Node Removed ObservableSearch playground for onTransformNodeRemovedObservable
An event triggered when a transform node is removed
particle SystemsSearch playground for particleSystems
All of the particle systems added to this scene
particles EnabledSearch playground for particlesEnabled
Gets or sets a boolean indicating if particles are enabled on this scene
physics EnabledSearch playground for physicsEnabled
Gets or sets a boolean indicating if physic engines are enabled on this scene
pointer Down PredicateSearch playground for pointerDownPredicate
Gets or sets a predicate used to select candidate meshes for a pointer down event
Type declaration
-
-
Parameters
-
Mesh: AbstractMesh
Returns boolean
-
-
pointer Move PredicateSearch playground for pointerMovePredicate
Gets or sets a predicate used to select candidate meshes for a pointer move event
Type declaration
-
-
Parameters
-
Mesh: AbstractMesh
Returns boolean
-
-
pointer UpPredicateSearch playground for pointerUpPredicate
Gets or sets a predicate used to select candidate meshes for a pointer up event
Type declaration
-
-
Parameters
-
Mesh: AbstractMesh
Returns boolean
-
-
post Process ManagerSearch playground for postProcessManager
Gets the current postprocess manager
Readonly post Process Render Pipeline ManagerSearch playground for postProcessRenderPipelineManager
Gets the postprocess render pipeline manager
post ProcessesSearch playground for postProcesses
The list of postprocesses added to the scene
post Processes EnabledSearch playground for postProcessesEnabled
Gets or sets a boolean indicating if postprocesses are enabled on this scene
pre PassSearch playground for prePass
Flag indicating that the frame buffer binding is handled by another component
pre Pass RendererSearch playground for prePassRenderer
Gets or Sets the current prepass renderer associated to the scene.
prevent Default OnPointer DownSearch playground for preventDefaultOnPointerDown
This is used to call preventDefault() on pointer down in order to block unwanted artifacts like system double clicks
prevent Default OnPointer UpSearch playground for preventDefaultOnPointerUp
This is used to call preventDefault() on pointer up in order to block unwanted artifacts like system double clicks
probes EnabledSearch playground for probesEnabled
Gets or sets a boolean indicating if probes are enabled on this scene
procedural TexturesSearch playground for proceduralTextures
The list of procedural textures added to the scene
procedural Textures EnabledSearch playground for proceduralTexturesEnabled
Gets or sets a boolean indicating if procedural textures are enabled on this scene
reflection ProbesSearch playground for reflectionProbes
The list of reflection probes added to the scene
render Targets EnabledSearch playground for renderTargetsEnabled
Gets or sets a boolean indicating if render targets are enabled on this scene
require Light SortingSearch playground for requireLightSorting
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
reserved Data StoreSearch playground for reservedDataStore
For internal use only. Please do not use.
root NodesSearch playground for rootNodes
Gets the list of root nodes (ie. nodes with no parent)
selection OctreeSearch playground for selectionOctree
Gets the octree used to boost mesh selection (picking)
simplification QueueSearch playground for simplificationQueue
Gets or sets the simplification queue attached to the scene
skeletonsSearch playground for skeletons
The list of skeletons added to the scene
sound TracksSearch playground for soundTracks
The list of sound tracks added to the scene
soundsSearch playground for sounds
The list of sounds used in the scene.
sprite ManagersSearch playground for spriteManagers
All of the sprite managers added to this scene
sprites EnabledSearch playground for spritesEnabled
Gets or sets a boolean indicating if sprites are enabled on this scene
sub Surface ConfigurationSearch playground for subSurfaceConfiguration
Gets or Sets the current prepass renderer associated to the scene.
texturesSearch playground for textures
Textures to keep.
transform NodesSearch playground for transformNodes
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.
use Constant Animation Delta TimeSearch playground for useConstantAnimationDeltaTime
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
use Delayed Texture LoadingSearch playground for useDelayedTextureLoading
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
The fog density is following an exponential function
Static Readonly FOGMODE_ EXP2Search playground for FOGMODE_EXP2
The fog density is following an exponential function faster than FOGMODE_EXP
Static Readonly FOGMODE_ LINEARSearch playground for FOGMODE_LINEAR
The fog density is following a linear function.
Static Readonly FOGMODE_ NONESearch playground for FOGMODE_NONE
The fog is deactivated
Static Max Delta TimeSearch playground for MaxDeltaTime
Gets or sets the maximum deltatime when deterministic lock step is enabled
Static Min Delta TimeSearch playground for MinDeltaTime
Gets or sets the minimum deltatime when deterministic lock step is enabled
Accessors
active Bones Perf Counter
-
Gets the performance counter for active bones
Returns PerfCounter
active Camera
active Particles Perf Counter
-
Gets the performance counter for active particles
Returns PerfCounter
after Camera Render
-
Sets a function to be executed after rendering a camera
Parameters
-
callback: () => void
-
-
Returns void
-
-
Returns any
-
after Render
-
Sets a function to be executed after rendering this scene
Parameters
-
callback: Nullable<() => void>
Returns any
-
animatables
-
Gets all animatable attached to the scene
Returns Animatable[]
animation Properties Override
-
Gets or sets the animation properties override
Returns Nullable<AnimationPropertiesOverride>
-
Gets or sets the animation properties override
Parameters
-
value: Nullable<AnimationPropertiesOverride>
Returns any
-
before Camera Render
-
Sets a function to be executed before rendering a camera
Parameters
-
callback: () => void
-
-
Returns void
-
-
Returns any
-
before Render
-
Sets a function to be executed before rendering this scene
Parameters
-
callback: Nullable<() => void>
Returns any
-
block Material Dirty Mechanism
-
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
-
blockfree Active Meshes And Rendering Groups
-
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
-
default Material
environment Intensity
-
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
-
environment Texture
-
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
-
value: Nullable<BaseTexture>
Returns any
-
fog Enabled
-
Gets or sets a boolean indicating if fog is enabled on this scene
Returns boolean
-
Gets or sets a boolean indicating if fog is enabled on this scene
Parameters
-
value: boolean
Returns any
-
fog Mode
-
Gets or sets the fog mode to use
Returns number
-
Gets or sets the fog mode to use
Parameters
-
value: number
Returns any
-
force Points Cloud
-
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
-
force Wireframe
-
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
-
frustum Planes
-
Gets the list of frustum planes (built from the active camera)
Returns Plane[]
image Processing Configuration
-
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
is Disposed
-
Gets if the scene is already disposed
Returns boolean
is Loading
-
Returns a boolean indicating if the scene is still loading data
Returns boolean
lights Enabled
-
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
-
mesh Under Pointer
-
Gets the mesh that is currently under the pointer
Returns Nullable<AbstractMesh>
on Dispose
-
Sets a function to be executed when this scene is disposed.
Parameters
-
callback: () => void
-
-
Returns void
-
-
Returns any
-
pointerX
-
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
-
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
-
shadows Enabled
-
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
-
skeletons Enabled
-
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
-
skip Frustum Clipping
-
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
-
textures Enabled
-
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
-
total Active Indices Perf Counter
-
Gets the performance counter for active indices
Returns PerfCounter
total Vertices Perf Counter
-
Gets the performance counter for total vertices
Returns PerfCounter
uid
-
Return a unique id as a string which can serve as an identifier for the scene
Returns string
un Translated Pointer
-
Gets the pointer coordinates without any translation (ie. straight out of the pointer event)
Returns Vector2
use Right Handed System
-
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 Double Click Delay
-
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 Drag Movement Threshold
-
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 Exclusive Double Click Mode
-
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 Long Press Delay
-
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
add Action ManagerSearch playground for addActionManager
-
Adds the given action manager to this scene
Parameters
-
newActionManager: AbstractActionManager
The action manager to add
Returns void
-
add AnimationSearch playground for addAnimation
-
Adds the given animation to this scene
Parameters
-
newAnimation: Animation
The animation to add
Returns void
-
add Animation GroupSearch playground for addAnimationGroup
-
Adds the given animation group to this scene.
Parameters
-
newAnimationGroup: AnimationGroup
The animation group to add
Returns void
-
add CameraSearch playground for addCamera
-
Adds the given camera to this scene
Parameters
-
newCamera: Camera
The camera to add
Returns void
-
add Effect LayerSearch playground for addEffectLayer
-
Adds the given effect layer to this scene
Parameters
-
newEffectLayer: EffectLayer
defines the effect layer to add
Returns void
-
add External DataSearch playground for addExternalData
-
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
-
add GeometrySearch playground for addGeometry
-
Adds the given geometry to this scene
Parameters
-
newGeometry: Geometry
The geometry to add
Returns void
-
add Lens Flare SystemSearch playground for addLensFlareSystem
-
Adds the given lens flare system to this scene
Parameters
-
newLensFlareSystem: LensFlareSystem
The lens flare system to add
Returns void
-
add LightSearch playground for addLight
-
Adds the given light to this scene
Parameters
-
newLight: Light
The light to add
Returns void
-
add MaterialSearch playground for addMaterial
-
Adds the given material to this scene
Parameters
-
newMaterial: Material
The material to add
Returns void
-
add MeshSearch 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
-
add Morph Target ManagerSearch playground for addMorphTargetManager
-
Adds the given morph target to this scene
Parameters
-
newMorphTargetManager: MorphTargetManager
The morph target to add
Returns void
-
add Multi MaterialSearch playground for addMultiMaterial
-
Adds the given multi-material to this scene
Parameters
-
newMultiMaterial: MultiMaterial
The multi-material to add
Returns void
-
add Particle SystemSearch playground for addParticleSystem
-
Adds the given particle system to this scene
Parameters
-
newParticleSystem: IParticleSystem
The particle system to add
Returns void
-
add Reflection ProbeSearch playground for addReflectionProbe
-
Adds the given reflection probe to this scene.
Parameters
-
newReflectionProbe: ReflectionProbe
The reflection probe to add
Returns void
-
add SkeletonSearch playground for addSkeleton
-
Adds the given skeleton to this scene
Parameters
-
newSkeleton: Skeleton
The skeleton to add
Returns void
-
add TextureSearch playground for addTexture
-
Adds the given texture to this scene.
Parameters
-
newTexture: BaseTexture
The texture to add
Returns void
-
add Transform NodeSearch 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
-
Execute all animations (for a frame)
Returns void
attach ControlSearch playground for attachControl
-
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
-
begin AnimationSearch playground for beginAnimation
-
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
-
-
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)
-
-
Parameters
-
target: any
Returns boolean
-
-
-
-
Optional onAnimationLoop: () => void
defines the callback to call when an animation loops
-
-
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
-
begin Direct AnimationSearch playground for beginDirectAnimation
-
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)
-
-
Returns void
-
-
-
Optional onAnimationLoop: () => void
defines the callback to call when an animation loops
-
-
Returns void
-
-
-
Optional isAdditive: boolean
defines whether the animation should be evaluated additively (false by default)
Returns Animatable
the list of created animatables
-
begin Direct Hierarchy AnimationSearch playground for beginDirectHierarchyAnimation
-
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)
-
-
Returns void
-
-
-
Optional onAnimationLoop: () => void
defines the callback to call when an animation loops
-
-
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
-
begin Hierarchy AnimationSearch playground for beginHierarchyAnimation
-
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
-
-
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)
-
-
Parameters
-
target: any
Returns boolean
-
-
-
-
Optional onAnimationLoop: () => void
defines the callback to call when an animation loops
-
-
Returns void
-
-
-
Optional isAdditive: boolean
defines whether the animation should be evaluated additively (false by default)
Returns Animatable[]
the list of created animatables
-
begin Weighted AnimationSearch playground for beginWeightedAnimation
-
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
-
-
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)
-
-
Parameters
-
target: any
Returns boolean
-
-
-
-
Optional onAnimationLoop: () => void
defines the callback to call when an animation loops
-
-
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
-
clean Cached Texture BufferSearch playground for cleanCachedTextureBuffer
-
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
clear Cached Vertex DataSearch playground for clearCachedVertexData
-
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
create Default CameraSearch playground for createDefaultCamera
-
Creates a default camera for the scene.
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
-
create Default Camera OrLightSearch playground for createDefaultCameraOrLight
-
Creates a default camera and a default 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
-
create Default EnvironmentSearch playground for createDefaultEnvironment
-
Creates a new environment
Parameters
-
Optional options: Partial<IEnvironmentHelperOptions>
defines the options you can use to configure the environment
Returns Nullable<EnvironmentHelper>
the new EnvironmentHelper
-
create Default LightSearch playground for createDefaultLight
-
Creates a default light for the scene.
Parameters
-
Optional replace: boolean
has the default false, when true replaces the existing lights in the scene with a hemispheric light
Returns void
-
create Default SkyboxSearch playground for createDefaultSkybox
-
Creates a new sky box
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
-
create DefaultVRExperienceSearch playground for createDefaultVRExperience
-
Creates a new VREXperienceHelper
Parameters
-
Optional webVROptions: VRExperienceHelperOptions
defines the options used to create the new VREXperienceHelper
Returns VRExperienceHelper
a new VREXperienceHelper
-
create DefaultXRExperience AsyncSearch playground for createDefaultXRExperienceAsync
-
Creates a new WebXRDefaultExperience
Parameters
-
options: WebXRDefaultExperienceOptions
experience options
Returns Promise<WebXRDefaultExperience>
a promise for a new WebXRDefaultExperience
-
create OrUpdate Selection OctreeSearch playground for createOrUpdateSelectionOctree
-
Creates or updates the octree used to boost selection (picking)
Parameters
-
Optional maxCapacity: number
defines the maximum capacity per leaf
-
Optional maxDepth: number
defines the maximum depth of the octree
Returns Octree<AbstractMesh>
an octree of AbstractMesh
-
create Picking RaySearch 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
-
create Picking Ray InCamera SpaceSearch playground for createPickingRayInCameraSpace
create Picking Ray InCamera Space ToRefSearch playground for createPickingRayInCameraSpaceToRef
-
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
-
create Picking Ray ToRefSearch 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
-
delete Compound ImpostorSearch playground for deleteCompoundImpostor
-
Deletes a physics compound impostor
Parameters
-
compound: any
defines the compound to delete
Returns void
-
detach ControlSearch playground for detachControl
-
Detaches all event handlers
Returns void
disable Depth RendererSearch playground for disableDepthRenderer
disable Geometry Buffer RendererSearch playground for disableGeometryBufferRenderer
-
Disables the GeometryBufferRender associated with the scene
Returns void
disable Physics EngineSearch playground for disablePhysicsEngine
-
Disables and disposes the physics engine associated with the scene
Returns void
disable Pre Pass RendererSearch playground for disablePrePassRenderer
-
Disables the prepass associated with the scene
Returns void
disable Sub Surface For Pre PassSearch playground for disableSubSurfaceForPrePass
-
Disables the subsurface effect for prepass
Returns void
disposeSearch playground for dispose
-
Releases all held ressources
Returns void
enable Depth RendererSearch 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
-
enable Geometry Buffer RendererSearch 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
-
enable PhysicsSearch playground for enablePhysics
enable Pre Pass RendererSearch playground for enablePrePassRenderer
-
Enables the prepass and associates it with the scene
Returns Nullable<PrePassRenderer>
the PrePassRenderer
enable Sub Surface For Pre PassSearch playground for enableSubSurfaceForPrePass
-
Enables the subsurface effect for prepass
Returns Nullable<SubSurfaceConfiguration>
the SubSurfaceConfiguration
execute Once Before RenderSearch playground for executeOnceBeforeRender
-
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.
-
-
Returns void
-
-
-
Optional timeout: number
optional delay in ms
Returns void
-
execute When ReadySearch playground for executeWhenReady
-
Registers a function to be executed when the scene is ready
Parameters
-
func: () => void
the function to be executed
-
-
Returns void
-
-
Returns void
-
free Active MeshesSearch playground for freeActiveMeshes
-
Clear the active meshes smart array preventing retention point in mesh dispose.
Returns void
free Processed MaterialsSearch playground for freeProcessedMaterials
-
Clear the processed materials smart array preventing retention point in material dispose.
Returns void
free Rendering GroupsSearch playground for freeRenderingGroups
-
Clear the info related to rendering groups preventing retention points during dispose.
Returns void
freeze Active MeshesSearch playground for freezeActiveMeshes
-
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
-
-
Returns void
-
-
-
Optional onError: (message: string) => void
optional error callback
-
-
Parameters
-
message: string
Returns void
-
-
-
Returns Scene
the current scene
-
freeze MaterialsSearch playground for freezeMaterials
-
Freeze all materials A frozen material will not be updatable but should be faster to render
Returns void
get Active BonesSearch playground for getActiveBones
-
Gets the total number of active bones rendered per frame
Returns number
the total number of active bones rendered per frame
get Active IndicesSearch playground for getActiveIndices
-
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
get Active MeshesSearch playground for getActiveMeshes
-
Gets the array of active meshes
Returns SmartArray<AbstractMesh>
an array of AbstractMesh
get Active ParticlesSearch playground for getActiveParticles
-
Gets the total number of active particles rendered per frame
Returns number
the total number of active particles rendered per frame
get All Animatables ByTargetSearch playground for getAllAnimatablesByTarget
-
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
-
get Animatable ByTargetSearch 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
-
get Animation Group ByNameSearch 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.
-
get Animation RatioSearch playground for getAnimationRatio
-
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
get Auto Clear Depth Stencil SetupSearch 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
-
get Bone ByIDSearch playground for getBoneByID
get Bone ByNameSearch playground for getBoneByName
get Bounding Box RendererSearch playground for getBoundingBoxRenderer
-
Gets the bounding box renderer associated with the scene
Returns BoundingBoxRenderer
a BoundingBoxRenderer
get Cached EffectSearch playground for getCachedEffect
get Cached MaterialSearch playground for getCachedMaterial
get Cached VisibilitySearch playground for getCachedVisibility
-
Gets the cached visibility state (ie. the latest rendered one)
Returns Nullable<number>
the cached visibility state
get Camera ByIDSearch playground for getCameraByID
get Camera ByNameSearch playground for getCameraByName
get Camera ByUniqueIDSearch playground for getCameraByUniqueID
get Cameras ByTagsSearch playground for getCamerasByTags
get Class NameSearch playground for getClassName
-
Gets a string identifying the name of the class
Returns string
"Scene" string
get EngineSearch playground for getEngine
-
Gets the engine associated with the scene
Returns Engine
an Engine
get External DataSearch playground for getExternalData
-
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
-
get Frame IdSearch playground for getFrameId
-
Gets an unique Id for the current frame
Returns number
a number
get GeometriesSearch playground for getGeometries
-
Gets the list of geometries attached to the scene
Returns Geometry[]
an array of Geometry
get Geometry ByIDSearch playground for getGeometryByID
get Glow Layer ByNameSearch playground for getGlowLayerByName
get Highlight Layer ByNameSearch 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.
-
get Internal StepSearch playground for getInternalStep
-
Gets the internal step used by deterministic lock step
Returns number
the internal step
get Last Entry ByIDSearch playground for getLastEntryByID
get Last Material ByIDSearch playground for getLastMaterialByID
get Last Mesh ByIDSearch 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.
-
get Last Skeleton ByIDSearch playground for getLastSkeletonByID
get Lens Flare System ByIDSearch 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
-
get Lens Flare System ByNameSearch 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
-
get Light ByIDSearch playground for getLightByID
get Light ByNameSearch playground for getLightByName
get Light ByUniqueIDSearch playground for getLightByUniqueID
get Lights ByTagsSearch playground for getLightsByTags
get Material ByIDSearch playground for getMaterialByID
get Material ByNameSearch playground for getMaterialByName
get Material ByTagsSearch playground for getMaterialByTags
get Material ByUniqueIDSearch playground for getMaterialByUniqueID
get Mesh ByIDSearch 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
-
get Mesh ByNameSearch 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.
-
get Mesh ByUniqueIDSearch 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.
-
get Meshes ByIDSearch 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
-
get Meshes ByTagsSearch playground for getMeshesByTags
-
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
-
-
Parameters
-
mesh: AbstractMesh
Returns void
-
-
-
Returns Mesh[]
an array of Mesh
-
get Morph Target ByIdSearch 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.
-
get Morph Target ByNameSearch 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.
-
get Morph Target Manager ByIdSearch 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.
-
get Node ByIDSearch playground for getNodeByID
get Node ByNameSearch playground for getNodeByName
get NodesSearch playground for getNodes
-
Returns Array<Node>
all meshes, lights, cameras, transformNodes and bones
get OrAdd External Data With FactorySearch playground for getOrAddExternalDataWithFactory
-
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
-
-
Parameters
-
k: string
Returns T
-
-
-
Returns T
the associated data, can be null if the factory returned null.
-
get Outline RendererSearch playground for getOutlineRenderer
-
Gets the outline renderer associated with the scene
Returns OutlineRenderer
a OutlineRenderer
get Particle System ByIDSearch 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
-
get Physics EngineSearch playground for getPhysicsEngine
-
Gets the current physics engine
Returns Nullable<IPhysicsEngine>
a IPhysicsEngine or null if none attached
get Pointer Over MeshSearch playground for getPointerOverMesh
-
Gets the mesh under the pointer
Returns Nullable<AbstractMesh>
a Mesh or null if no mesh is under the pointer
get Pointer Over SpriteSearch playground for getPointerOverSprite
get Post Process ByNameSearch 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.
-
get Projection MatrixSearch playground for getProjectionMatrix
-
Gets the current projection matrix
Returns Matrix
a Matrix
get Render IdSearch playground for getRenderId
-
Gets an unique Id for the current render phase
Returns number
a number
get Scene Uniform BufferSearch playground for getSceneUniformBuffer
-
Gets the uniform buffer used to store scene data
Returns UniformBuffer
a UniformBuffer
get Skeleton ByIdSearch playground for getSkeletonById
get Skeleton ByNameSearch playground for getSkeletonByName
get Skeleton ByUnique IdSearch playground for getSkeletonByUniqueId
get Sound ByNameSearch playground for getSoundByName
get Step IdSearch playground for getStepId
-
Gets the step Id used by deterministic lock step
Returns number
the step Id
get Texture ByUniqueIDSearch 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.
-
get Total VerticesSearch playground for getTotalVertices
-
Gets the total number of vertices rendered per frame
Returns number
the total number of vertices rendered per frame
get Transform MatrixSearch playground for getTransformMatrix
-
Gets the current transform matrix
Returns Matrix
a Matrix made of View * Projection
get Transform Node ByIDSearch 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.
-
get Transform Node ByNameSearch 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.
-
get Transform Node ByUniqueIDSearch 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.
-
get Transform Nodes ByIDSearch 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
-
get Transform Nodes ByTagsSearch 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
-
-
Parameters
-
transform: TransformNode
Returns void
-
-
-
Returns TransformNode[]
an array of TransformNode
-
get Unique IdSearch playground for getUniqueId
-
Gets an unique (relatively to the current scene) Id
Returns number
an unique number for the scene
get View MatrixSearch playground for getViewMatrix
-
Gets the current view matrix
Returns Matrix
a Matrix
get Waiting Items CountSearch playground for getWaitingItemsCount
-
Returns the number of items waiting to be loaded
Returns number
the number of items waiting to be loaded
get World ExtendsSearch 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
-
-
Parameters
-
mesh: AbstractMesh
Returns boolean
-
-
-
Returns { max: Vector3; min: Vector3 }
min and max vectors
-
increment Render IdSearch playground for incrementRenderId
-
Call this function if you want to manually increment the render Id
Returns void
is Active MeshSearch playground for isActiveMesh
-
Gets a boolean indicating if the given mesh is active
Parameters
-
mesh: AbstractMesh
defines the mesh to look for
Returns boolean
true if the mesh is in the active list
-
is Cached Material InvalidSearch playground for isCachedMaterialInvalid
-
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
-
is Physics EnabledSearch playground for isPhysicsEnabled
-
Gets a boolean indicating if there is an active physics engine
Returns boolean
a boolean indicating if there is an active physics engine
is Pointer CapturedSearch playground for isPointerCaptured
-
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
-
is ReadySearch playground for isReady
-
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
mark All Materials AsDirtySearch playground for markAllMaterialsAsDirty
-
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
-
-
Parameters
-
mat: Material
Returns boolean
-
-
-
Returns void
-
multi PickSearch 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
-
-
Parameters
-
mesh: AbstractMesh
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
-
Optional trianglePredicate: TrianglePickingPredicate
defines an optional predicate used to select faces when a mesh intersection is detected
Returns Nullable<PickingInfo[]>
an array of PickingInfo
-
multi Pick SpriteSearch 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
-
sprite: Sprite
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
-
multi Pick Sprite With RaySearch 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
-
sprite: Sprite
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
-
multi Pick With RaySearch 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
-
-
Parameters
-
mesh: AbstractMesh
Returns boolean
-
-
-
-
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
-
-
Parameters
-
mesh: AbstractMesh
Returns boolean
-
-
-
-
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
-
pick SpriteSearch 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
-
sprite: Sprite
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
-
pick Sprite With RaySearch 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
-
sprite: Sprite
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
-
pick With Bounding InfoSearch 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
-
-
Parameters
-
mesh: AbstractMesh
Returns boolean
-
-
-
-
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)
-
pick With RaySearch 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
-
-
Parameters
-
mesh: AbstractMesh
Returns boolean
-
-
-
-
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
-
push GeometrySearch playground for pushGeometry
-
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
-
register After RenderSearch playground for registerAfterRender
-
Registers a function to be called after every frame render
Parameters
-
func: () => void
defines the function to register
-
-
Returns void
-
-
Returns void
-
register Before RenderSearch playground for registerBeforeRender
-
Registers a function to be called before every frame render
Parameters
-
func: () => void
defines the function to register
-
-
Returns void
-
-
Returns void
-
remove Action ManagerSearch playground for removeActionManager
-
Removes the given action manager from this scene.
Parameters
-
toRemove: AbstractActionManager
The action manager to remove
Returns number
The index of the removed action manager
-
remove AnimationSearch playground for removeAnimation
-
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
-
remove Animation GroupSearch playground for removeAnimationGroup
-
Removes the given animation group from this scene.
Parameters
-
toRemove: AnimationGroup
The animation group to remove
Returns number
The index of the removed animation group
-
remove CameraSearch playground for removeCamera
-
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
-
remove Effect LayerSearch 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
-
remove External DataSearch playground for removeExternalData
-
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
-
remove GeometrySearch playground for removeGeometry
-
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
-
remove Lens Flare SystemSearch playground for removeLensFlareSystem
-
Removes the given lens flare system from this scene.
Parameters
-
toRemove: LensFlareSystem
The lens flare system to remove
Returns number
The index of the removed lens flare system
-
remove LightSearch playground for removeLight
-
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
-
remove MaterialSearch playground for removeMaterial
-
Removes the given material from this scene.
Parameters
-
toRemove: Material
The material to remove
Returns number
The index of the removed material
-
remove MeshSearch playground for removeMesh
-
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
-
remove Morph Target ManagerSearch playground for removeMorphTargetManager
-
Remove a morph target for the list of scene's morph targets
Parameters
-
toRemove: MorphTargetManager
defines the morph target to remove
Returns number
the index where the morph target was in the morph target list
-
remove Multi MaterialSearch playground for removeMultiMaterial
-
Removes the given multi-material from this scene.
Parameters
-
toRemove: MultiMaterial
The multi-material to remove
Returns number
The index of the removed multi-material
-
remove Particle SystemSearch playground for removeParticleSystem
-
Remove a particle system for the list of scene's particle systems
Parameters
-
toRemove: IParticleSystem
defines the particle system to remove
Returns number
the index where the particle system was in the particle system list
-
remove Reflection ProbeSearch playground for removeReflectionProbe
-
Removes the given reflection probe from this scene.
Parameters
-
toRemove: ReflectionProbe
The reflection probe to remove
Returns number
The index of the removed reflection probe
-
remove SkeletonSearch playground for removeSkeleton
-
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
-
remove TextureSearch playground for removeTexture
-
Removes the given texture from this scene.
Parameters
-
toRemove: BaseTexture
The texture to remove
Returns number
The index of the removed texture
-
remove Transform NodeSearch playground for removeTransformNode
-
Remove a transform node for the list of scene's transform nodes
Parameters
-
toRemove: TransformNode
defines the transform node to remove
Returns number
the index where the transform node was in the transform node list
-
renderSearch playground for render
-
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
-
reset Cached MaterialSearch playground for resetCachedMaterial
-
Resets all cached information relative to material (including effect and visibility)
Returns void
reset Last Animation Time FrameSearch playground for resetLastAnimationTimeFrame
-
Resets the last animation time frame. Useful to override when animations start running when loading a scene for the first time.
Returns void
set Active Camera ByIDSearch playground for setActiveCameraByID
set Active Camera ByNameSearch playground for setActiveCameraByName
set Default Candidate ProvidersSearch playground for setDefaultCandidateProviders
-
Sets the default candidate providers for the scene. This sets the getActiveMeshCandidates, getActiveSubMeshCandidates, getIntersectingSubMeshCandidates and getCollidingSubMeshCandidates to their default function
Returns void
set Pointer Over MeshSearch 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
-
set Pointer Over SpriteSearch playground for setPointerOverSprite
set Rendering Auto Clear Depth StencilSearch playground for setRenderingAutoClearDepthStencil
-
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
-
set Rendering OrderSearch 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
-
set Step IdSearch playground for setStepId
-
Sets the step Id used by deterministic lock step
Parameters
-
newStepId: number
defines the step Id
Returns void
-
set Transform MatrixSearch 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
-
simulate Pointer DownSearch playground for simulatePointerDown
-
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
-
simulate Pointer MoveSearch playground for simulatePointerMove
-
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
-
simulate Pointer UpSearch playground for simulatePointerUp
-
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
-
sort Lights ByPrioritySearch playground for sortLightsByPriority
-
Sorts the list list based on light priorities
Returns void
stop All AnimationsSearch playground for stopAllAnimations
-
Stops and removes all animations that have been applied to the scene
Returns void
stop AnimationSearch playground for stopAnimation
-
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)
-
-
Parameters
-
target: any
Returns boolean
-
-
-
Returns void
-
switch Active CameraSearch playground for switchActiveCamera
-
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
-
unfreeze Active MeshesSearch playground for unfreezeActiveMeshes
-
Use this function to restart evaluating active meshes on every frame
Returns Scene
the current scene
unfreeze MaterialsSearch playground for unfreezeMaterials
-
Unfreeze all materials A frozen material will not be updatable but should be faster to render
Returns void
unregister After RenderSearch playground for unregisterAfterRender
-
Unregisters a function called after every frame render
Parameters
-
func: () => void
defines the function to unregister
-
-
Returns void
-
-
Returns void
-
unregister Before RenderSearch playground for unregisterBeforeRender
-
Unregisters a function called before every frame render
Parameters
-
func: () => void
defines the function to unregister
-
-
Returns void
-
-
Returns void
-
update Transform MatrixSearch playground for updateTransformMatrix
-
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
-
when Ready AsyncSearch playground for whenReadyAsync
-
Returns a promise that resolves when the scene is ready
Returns Promise<void>
A promise that resolves when the scene is ready
Static Add Individual ParserSearch playground for AddIndividualParser
-
Adds n individual parser in the list of available ones
Parameters
-
name: string
Defines the name of the parser
-
parser: IndividualBabylonFileParser
Defines the parser to add
Returns void
-
Static Add ParserSearch 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 Collision Coordinator FactorySearch playground for CollisionCoordinatorFactory
-
Factory used to create the a collision coordinator.
Returns ICollisionCoordinator
The collision coordinator
Static Default Material FactorySearch playground for DefaultMaterialFactory
Static Get Individual ParserSearch playground for GetIndividualParser
-
Gets an individual parser from the list of avaialble ones
Parameters
-
name: string
Defines the name of the parser
Returns Nullable<IndividualBabylonFileParser>
the requested parser or null
-
Static Get ParserSearch 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
-
Represents a scene to be rendered by the engine.
https://doc.babylonjs.com/features/scene