@babylonjs/core 7.27.0 → 7.27.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (144) hide show
  1. package/Animations/animationGroup.d.ts +2 -2
  2. package/Animations/animationGroup.js.map +1 -1
  3. package/Audio/audioSceneComponent.d.ts +5 -9
  4. package/Audio/audioSceneComponent.js.map +1 -1
  5. package/Bones/skeleton.d.ts +2 -2
  6. package/Bones/skeleton.js.map +1 -1
  7. package/Cameras/camera.d.ts +2 -0
  8. package/Cameras/camera.js +2 -0
  9. package/Cameras/camera.js.map +1 -1
  10. package/Engines/WebGPU/webgpuSnapshotRendering.js +3 -0
  11. package/Engines/WebGPU/webgpuSnapshotRendering.js.map +1 -1
  12. package/Engines/abstractEngine.js +2 -2
  13. package/Engines/abstractEngine.js.map +1 -1
  14. package/{abstractScene.d.ts → IAssetContainer.d.ts} +33 -6
  15. package/IAssetContainer.js +2 -0
  16. package/IAssetContainer.js.map +1 -0
  17. package/Layers/effectLayerSceneComponent.d.ts +6 -6
  18. package/Layers/effectLayerSceneComponent.js +3 -3
  19. package/Layers/effectLayerSceneComponent.js.map +1 -1
  20. package/Layers/glowLayer.d.ts +3 -3
  21. package/Layers/glowLayer.js +2 -2
  22. package/Layers/glowLayer.js.map +1 -1
  23. package/Layers/highlightLayer.d.ts +3 -3
  24. package/Layers/highlightLayer.js +2 -2
  25. package/Layers/highlightLayer.js.map +1 -1
  26. package/Layers/layerSceneComponent.d.ts +5 -5
  27. package/Layers/layerSceneComponent.js.map +1 -1
  28. package/LensFlares/lensFlareSystemSceneComponent.d.ts +6 -6
  29. package/LensFlares/lensFlareSystemSceneComponent.js +6 -6
  30. package/LensFlares/lensFlareSystemSceneComponent.js.map +1 -1
  31. package/Lights/Shadows/shadowGeneratorSceneComponent.d.ts +3 -3
  32. package/Lights/Shadows/shadowGeneratorSceneComponent.js.map +1 -1
  33. package/Materials/GreasedLine/greasedLineSimpleMaterial.js +1 -1
  34. package/Materials/GreasedLine/greasedLineSimpleMaterial.js.map +1 -1
  35. package/Materials/Textures/Procedurals/proceduralTextureSceneComponent.d.ts +2 -2
  36. package/Materials/Textures/Procedurals/proceduralTextureSceneComponent.js.map +1 -1
  37. package/Materials/Textures/baseTexture.d.ts +2 -2
  38. package/Materials/Textures/baseTexture.js.map +1 -1
  39. package/Materials/effectRenderer.d.ts +1 -0
  40. package/Materials/effectRenderer.js +2 -0
  41. package/Materials/effectRenderer.js.map +1 -1
  42. package/Materials/material.d.ts +2 -2
  43. package/Materials/material.decalMapConfiguration.d.ts +1 -1
  44. package/Materials/material.decalMapConfiguration.js +1 -1
  45. package/Materials/material.decalMapConfiguration.js.map +1 -1
  46. package/Materials/material.js.map +1 -1
  47. package/Materials/shaderMaterial.d.ts +5 -0
  48. package/Materials/shaderMaterial.js +7 -0
  49. package/Materials/shaderMaterial.js.map +1 -1
  50. package/Maths/math.color.d.ts +20 -0
  51. package/Maths/math.color.js +41 -12
  52. package/Maths/math.color.js.map +1 -1
  53. package/Meshes/Builders/greasedLineBuilder.d.ts +16 -0
  54. package/Meshes/Builders/greasedLineBuilder.js +1 -1
  55. package/Meshes/Builders/greasedLineBuilder.js.map +1 -1
  56. package/Meshes/Builders/groundBuilder.d.ts +1 -0
  57. package/Meshes/Builders/groundBuilder.js +2 -2
  58. package/Meshes/Builders/groundBuilder.js.map +1 -1
  59. package/Meshes/GreasedLine/greasedLineBaseMesh.js +1 -1
  60. package/Meshes/GreasedLine/greasedLineBaseMesh.js.map +1 -1
  61. package/Meshes/GreasedLine/greasedLineMesh.js +1 -1
  62. package/Meshes/GreasedLine/greasedLineMesh.js.map +1 -1
  63. package/Meshes/GreasedLine/greasedLineRibbonMesh.js +1 -1
  64. package/Meshes/GreasedLine/greasedLineRibbonMesh.js.map +1 -1
  65. package/Meshes/Node/Blocks/Set/setPositionsBlock.d.ts +3 -0
  66. package/Meshes/Node/Blocks/Set/setPositionsBlock.js +86 -1
  67. package/Meshes/Node/Blocks/Set/setPositionsBlock.js.map +1 -1
  68. package/Meshes/Node/Blocks/Sources/nullBlock.d.ts +4 -0
  69. package/Meshes/Node/Blocks/Sources/nullBlock.js +8 -0
  70. package/Meshes/Node/Blocks/Sources/nullBlock.js.map +1 -1
  71. package/Meshes/Node/Blocks/Sources/planeBlock.d.ts +13 -0
  72. package/Meshes/Node/Blocks/Sources/planeBlock.js +41 -3
  73. package/Meshes/Node/Blocks/Sources/planeBlock.js.map +1 -1
  74. package/Meshes/Node/Blocks/debugBlock.js +1 -1
  75. package/Meshes/Node/Blocks/debugBlock.js.map +1 -1
  76. package/Meshes/Node/Blocks/geometryElbowBlock.js +1 -1
  77. package/Meshes/Node/Blocks/geometryElbowBlock.js.map +1 -1
  78. package/Meshes/Node/Blocks/geometryOptimizeBlock.d.ts +4 -0
  79. package/Meshes/Node/Blocks/geometryOptimizeBlock.js +47 -1
  80. package/Meshes/Node/Blocks/geometryOptimizeBlock.js.map +1 -1
  81. package/Meshes/geometry.d.ts +2 -2
  82. package/Meshes/geometry.js.map +1 -1
  83. package/Meshes/mesh.d.ts +7 -0
  84. package/Meshes/mesh.js +15 -0
  85. package/Meshes/mesh.js.map +1 -1
  86. package/Meshes/meshUVSpaceRenderer.d.ts +3 -2
  87. package/Meshes/meshUVSpaceRenderer.js +15 -3
  88. package/Meshes/meshUVSpaceRenderer.js.map +1 -1
  89. package/Misc/greasedLineTools.d.ts +3 -1
  90. package/Misc/greasedLineTools.js +17 -2
  91. package/Misc/greasedLineTools.js.map +1 -1
  92. package/Misc/index.d.ts +2 -0
  93. package/Misc/index.js +2 -0
  94. package/Misc/index.js.map +1 -1
  95. package/Misc/screenshotTools.js +3 -2
  96. package/Misc/screenshotTools.js.map +1 -1
  97. package/Misc/textureTools.js +20 -4
  98. package/Misc/textureTools.js.map +1 -1
  99. package/Morph/morphTargetManager.d.ts +2 -2
  100. package/Morph/morphTargetManager.js.map +1 -1
  101. package/PostProcesses/postProcess.d.ts +2 -2
  102. package/PostProcesses/postProcess.js.map +1 -1
  103. package/Probes/reflectionProbe.d.ts +5 -5
  104. package/Probes/reflectionProbe.js +3 -3
  105. package/Probes/reflectionProbe.js.map +1 -1
  106. package/Rendering/fluidRenderer/fluidRenderer.d.ts +2 -2
  107. package/Rendering/fluidRenderer/fluidRenderer.js.map +1 -1
  108. package/Rendering/prePassRendererSceneComponent.d.ts +2 -2
  109. package/Rendering/prePassRendererSceneComponent.js.map +1 -1
  110. package/Rendering/subSurfaceSceneComponent.d.ts +2 -2
  111. package/Rendering/subSurfaceSceneComponent.js.map +1 -1
  112. package/Shaders/lod.fragment.js +2 -2
  113. package/Shaders/lod.fragment.js.map +1 -1
  114. package/Shaders/lodCube.fragment.js +2 -2
  115. package/Shaders/lodCube.fragment.js.map +1 -1
  116. package/Shaders/spriteMap.fragment.js +18 -6
  117. package/Shaders/spriteMap.fragment.js.map +1 -1
  118. package/Shaders/spriteMap.vertex.js +1 -1
  119. package/Shaders/spriteMap.vertex.js.map +1 -1
  120. package/ShadersWGSL/lod.fragment.d.ts +5 -0
  121. package/ShadersWGSL/lod.fragment.js +11 -0
  122. package/ShadersWGSL/lod.fragment.js.map +1 -0
  123. package/ShadersWGSL/lodCube.fragment.d.ts +5 -0
  124. package/ShadersWGSL/lodCube.fragment.js +30 -0
  125. package/ShadersWGSL/lodCube.fragment.js.map +1 -0
  126. package/Sprites/spriteMap.d.ts +16 -0
  127. package/Sprites/spriteMap.js +17 -0
  128. package/Sprites/spriteMap.js.map +1 -1
  129. package/assetContainer.d.ts +143 -3
  130. package/assetContainer.js +129 -8
  131. package/assetContainer.js.map +1 -1
  132. package/index.d.ts +0 -1
  133. package/index.js +0 -1
  134. package/index.js.map +1 -1
  135. package/node.d.ts +2 -2
  136. package/node.js.map +1 -1
  137. package/package.json +1 -1
  138. package/scene.d.ts +103 -14
  139. package/scene.js +170 -71
  140. package/scene.js.map +1 -1
  141. package/sceneComponent.d.ts +3 -3
  142. package/sceneComponent.js.map +1 -1
  143. package/abstractScene.js +0 -117
  144. package/abstractScene.js.map +0 -1
@@ -2,7 +2,6 @@ import type { Scene } from "./scene";
2
2
  import type { SmartArrayNoDuplicate } from "./Misc/smartArray";
3
3
  import type { Nullable } from "./types";
4
4
  import type { PickingInfo } from "./Collisions/pickingInfo";
5
- import type { AbstractScene } from "./abstractScene";
6
5
  import type { IPointerEvent } from "./Events/deviceInputEvents";
7
6
  import type { Mesh } from "./Meshes/mesh";
8
7
  import type { Effect } from "./Materials/effect";
@@ -10,6 +9,7 @@ import type { Camera } from "./Cameras/camera";
10
9
  import type { AbstractMesh } from "./Meshes/abstractMesh";
11
10
  import type { SubMesh } from "./Meshes/subMesh";
12
11
  import type { RenderTargetTexture } from "./Materials/Textures/renderTargetTexture";
12
+ import type { IAssetContainer } from "./IAssetContainer";
13
13
  /**
14
14
  * Groups all the scene component constants in one place to ease maintenance.
15
15
  * @internal
@@ -118,13 +118,13 @@ export interface ISceneSerializableComponent extends ISceneComponent {
118
118
  * Adds all the elements from the container to the scene
119
119
  * @param container the container holding the elements
120
120
  */
121
- addFromContainer(container: AbstractScene): void;
121
+ addFromContainer(container: IAssetContainer): void;
122
122
  /**
123
123
  * Removes all the elements in the container from the scene
124
124
  * @param container contains the elements to remove
125
125
  * @param dispose if the removed element should be disposed (default: false)
126
126
  */
127
- removeFromContainer(container: AbstractScene, dispose?: boolean): void;
127
+ removeFromContainer(container: IAssetContainer, dispose?: boolean): void;
128
128
  /**
129
129
  * Serializes the component data to the specified json object
130
130
  * @param serializationObject The object to serialize to
@@ -1 +1 @@
1
- {"version":3,"file":"sceneComponent.js","sourceRoot":"","sources":["../../../dev/core/src/sceneComponent.ts"],"names":[],"mappings":"AAcA;;;GAGG;AACH,MAAM,OAAO,uBAAuB;;AACT,wCAAgB,GAAG,aAAa,CAAC;AACjC,kCAAU,GAAG,OAAO,CAAC;AACrB,4CAAoB,GAAG,iBAAiB,CAAC;AACzC,gDAAwB,GAAG,qBAAqB,CAAC;AACjD,2CAAmB,GAAG,gB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C,CAAC;YACrB,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC;YACtB,IAAI,KAAK,GAAG,QAAQ,EAAE;gBAClB,MAAM;aACT;SACJ;QACD,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;IAC5E,CAAC;IAED;;OAEG;IACI,KAAK;QACR,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;IACpB,CAAC;CACJ","sourcesContent":["import type { Scene } from \"./scene\";\r\nimport type { SmartArrayNoDuplicate } from \"./Misc/smartArray\";\r\nimport type { Nullable } from \"./types\";\r\nimport type { PickingInfo } from \"./Collisions/pickingInfo\";\r\nimport type { AbstractScene } from \"./abstractScene\";\r\nimport type { IPointerEvent } from \"./Events/deviceInputEvents\";\r\n\r\nimport type { Mesh } from \"./Meshes/mesh\";\r\nimport type { Effect } from \"./Materials/effect\";\r\nimport type { Camera } from \"./Cameras/camera\";\r\nimport type { AbstractMesh } from \"./Meshes/abstractMesh\";\r\nimport type { SubMesh } from \"./Meshes/subMesh\";\r\nimport type { RenderTargetTexture } from \"./Materials/Textures/renderTargetTexture\";\r\n\r\n/**\r\n * Groups all the scene component constants in one place to ease maintenance.\r\n * @internal\r\n */\r\nexport class SceneComponentConstants {\r\n public static readonly NAME_EFFECTLAYER = \"EffectLayer\";\r\n public static readonly NAME_LAYER = \"Layer\";\r\n public static readonly NAME_LENSFLARESYSTEM = \"LensFlareSystem\";\r\n public static readonly NAME_BOUNDINGBOXRENDERER = \"BoundingBoxRenderer\";\r\n public static readonly NAME_PARTICLESYSTEM = \"ParticleSystem\";\r\n public static readonly NAME_GAMEPAD = \"Gamepad\";\r\n public static readonly NAME_SIMPLIFICATIONQUEUE = \"SimplificationQueue\";\r\n public static readonly NAME_GEOMETRYBUFFERRENDERER = \"GeometryBufferRenderer\";\r\n public static readonly NAME_PREPASSRENDERER = \"PrePassRenderer\";\r\n public static readonly NAME_DEPTHRENDERER = \"DepthRenderer\";\r\n public static readonly NAME_DEPTHPEELINGRENDERER = \"DepthPeelingRenderer\";\r\n public static readonly NAME_IBLSHADOWSRENDERER = \"IblShadowsRenderer\";\r\n public static readonly NAME_POSTPROCESSRENDERPIPELINEMANAGER = \"PostProcessRenderPipelineManager\";\r\n public static readonly NAME_SPRITE = \"Sprite\";\r\n public static readonly NAME_SUBSURFACE = \"SubSurface\";\r\n public static readonly NAME_OUTLINERENDERER = \"Outline\";\r\n public static readonly NAME_PROCEDURALTEXTURE = \"ProceduralTexture\";\r\n public static readonly NAME_SHADOWGENERATOR = \"ShadowGenerator\";\r\n public static readonly NAME_OCTREE = \"Octree\";\r\n public static readonly NAME_PHYSICSENGINE = \"PhysicsEngine\";\r\n public static readonly NAME_AUDIO = \"Audio\";\r\n public static readonly NAME_FLUIDRENDERER = \"FluidRenderer\";\r\n\r\n public static readonly STEP_ISREADYFORMESH_EFFECTLAYER = 0;\r\n\r\n public static readonly STEP_BEFOREEVALUATEACTIVEMESH_BOUNDINGBOXRENDERER = 0;\r\n\r\n public static readonly STEP_EVALUATESUBMESH_BOUNDINGBOXRENDERER = 0;\r\n\r\n public static readonly STEP_PREACTIVEMESH_BOUNDINGBOXRENDERER = 0;\r\n\r\n public static readonly STEP_CAMERADRAWRENDERTARGET_EFFECTLAYER = 1;\r\n\r\n public static readonly STEP_BEFORECAMERADRAW_PREPASS = 0;\r\n public static readonly STEP_BEFORECAMERADRAW_EFFECTLAYER = 1;\r\n public static readonly STEP_BEFORECAMERADRAW_LAYER = 2;\r\n\r\n public static readonly STEP_BEFORERENDERTARGETDRAW_PREPASS = 0;\r\n public static readonly STEP_BEFORERENDERTARGETDRAW_LAYER = 1;\r\n\r\n public static readonly STEP_BEFORERENDERINGMESH_PREPASS = 0;\r\n public static readonly STEP_BEFORERENDERINGMESH_OUTLINE = 1;\r\n\r\n public static readonly STEP_AFTERRENDERINGMESH_PREPASS = 0;\r\n public static readonly STEP_AFTERRENDERINGMESH_OUTLINE = 1;\r\n\r\n public static readonly STEP_AFTERRENDERINGGROUPDRAW_EFFECTLAYER_DRAW = 0;\r\n public static readonly STEP_AFTERRENDERINGGROUPDRAW_BOUNDINGBOXRENDERER = 1;\r\n\r\n public static readonly STEP_BEFORECAMERAUPDATE_SIMPLIFICATIONQUEUE = 0;\r\n public static readonly STEP_BEFORECAMERAUPDATE_GAMEPAD = 1;\r\n\r\n public static readonly STEP_BEFORECLEAR_PROCEDURALTEXTURE = 0;\r\n public static readonly STEP_BEFORECLEAR_PREPASS = 1;\r\n\r\n public static readonly STEP_BEFORERENDERTARGETCLEAR_PREPASS = 0;\r\n\r\n public static readonly STEP_AFTERRENDERTARGETDRAW_PREPASS = 0;\r\n public static readonly STEP_AFTERRENDERTARGETDRAW_LAYER = 1;\r\n\r\n public static readonly STEP_AFTERCAMERADRAW_PREPASS = 0;\r\n public static readonly STEP_AFTERCAMERADRAW_EFFECTLAYER = 1;\r\n public static readonly STEP_AFTERCAMERADRAW_LENSFLARESYSTEM = 2;\r\n public static readonly STEP_AFTERCAMERADRAW_EFFECTLAYER_DRAW = 3;\r\n public static readonly STEP_AFTERCAMERADRAW_LAYER = 4;\r\n public static readonly STEP_AFTERCAMERADRAW_FLUIDRENDERER = 5;\r\n\r\n public static readonly STEP_AFTERCAMERAPOSTPROCESS_LAYER = 0;\r\n\r\n public static readonly STEP_AFTERRENDERTARGETPOSTPROCESS_LAYER = 0;\r\n\r\n public static readonly STEP_AFTERRENDER_AUDIO = 0;\r\n\r\n public static readonly STEP_GATHERRENDERTARGETS_DEPTHRENDERER = 0;\r\n public static readonly STEP_GATHERRENDERTARGETS_GEOMETRYBUFFERRENDERER = 1;\r\n public static readonly STEP_GATHERRENDERTARGETS_SHADOWGENERATOR = 2;\r\n public static readonly STEP_GATHERRENDERTARGETS_POSTPROCESSRENDERPIPELINEMANAGER = 3;\r\n\r\n public static readonly STEP_GATHERACTIVECAMERARENDERTARGETS_DEPTHRENDERER = 0;\r\n public static readonly STEP_GATHERACTIVECAMERARENDERTARGETS_FLUIDRENDERER = 1;\r\n\r\n public static readonly STEP_POINTERMOVE_SPRITE = 0;\r\n public static readonly STEP_POINTERDOWN_SPRITE = 0;\r\n public static readonly STEP_POINTERUP_SPRITE = 0;\r\n}\r\n\r\n/**\r\n * This represents a scene component.\r\n *\r\n * This is used to decouple the dependency the scene is having on the different workloads like\r\n * layers, post processes...\r\n */\r\nexport interface ISceneComponent {\r\n /**\r\n * The name of the component. Each component must have a unique name.\r\n */\r\n name: string;\r\n\r\n /**\r\n * The scene the component belongs to.\r\n */\r\n scene: Scene;\r\n\r\n /**\r\n * Register the component to one instance of a scene.\r\n */\r\n register(): void;\r\n\r\n /**\r\n * Rebuilds the elements related to this component in case of\r\n * context lost for instance.\r\n */\r\n rebuild(): void;\r\n\r\n /**\r\n * Disposes the component and the associated ressources.\r\n */\r\n dispose(): void;\r\n}\r\n\r\n/**\r\n * This represents a SERIALIZABLE scene component.\r\n *\r\n * This extends Scene Component to add Serialization methods on top.\r\n */\r\nexport interface ISceneSerializableComponent extends ISceneComponent {\r\n /**\r\n * Adds all the elements from the container to the scene\r\n * @param container the container holding the elements\r\n */\r\n addFromContainer(container: AbstractScene): void;\r\n\r\n /**\r\n * Removes all the elements in the container from the scene\r\n * @param container contains the elements to remove\r\n * @param dispose if the removed element should be disposed (default: false)\r\n */\r\n removeFromContainer(container: AbstractScene, dispose?: boolean): void;\r\n\r\n /**\r\n * Serializes the component data to the specified json object\r\n * @param serializationObject The object to serialize to\r\n */\r\n serialize(serializationObject: any): void;\r\n}\r\n\r\n/**\r\n * Strong typing of a Mesh related stage step action\r\n */\r\nexport type MeshStageAction = (mesh: AbstractMesh, hardwareInstancedRendering: boolean) => boolean;\r\n\r\n/**\r\n * Strong typing of a Evaluate Sub Mesh related stage step action\r\n */\r\nexport type EvaluateSubMeshStageAction = (mesh: AbstractMesh, subMesh: SubMesh) => void;\r\n\r\n/**\r\n * Strong typing of a pre active Mesh related stage step action\r\n */\r\nexport type PreActiveMeshStageAction = (mesh: AbstractMesh) => void;\r\n\r\n/**\r\n * Strong typing of a Camera related stage step action\r\n */\r\nexport type CameraStageAction = (camera: Camera) => void;\r\n\r\n/**\r\n * Strong typing of a Camera Frame buffer related stage step action\r\n */\r\nexport type CameraStageFrameBufferAction = (camera: Camera) => boolean;\r\n\r\n/**\r\n * Strong typing of a Render Target related stage step action\r\n */\r\nexport type RenderTargetStageAction = (renderTarget: RenderTargetTexture, faceIndex?: number, layer?: number) => void;\r\n\r\n/**\r\n * Strong typing of a RenderingGroup related stage step action\r\n */\r\nexport type RenderingGroupStageAction = (renderingGroupId: number) => void;\r\n\r\n/**\r\n * Strong typing of a Mesh Render related stage step action\r\n */\r\nexport type RenderingMeshStageAction = (mesh: Mesh, subMesh: SubMesh, batch: any, effect: Nullable<Effect>) => void;\r\n\r\n/**\r\n * Strong typing of a simple stage step action\r\n */\r\nexport type SimpleStageAction = () => void;\r\n\r\n/**\r\n * Strong typing of a render target action.\r\n */\r\nexport type RenderTargetsStageAction = (renderTargets: SmartArrayNoDuplicate<RenderTargetTexture>) => void;\r\n\r\n/**\r\n * Strong typing of a pointer move action.\r\n */\r\nexport type PointerMoveStageAction = (\r\n unTranslatedPointerX: number,\r\n unTranslatedPointerY: number,\r\n pickResult: Nullable<PickingInfo>,\r\n isMeshPicked: boolean,\r\n element: Nullable<HTMLElement>\r\n) => Nullable<PickingInfo>;\r\n\r\n/**\r\n * Strong typing of a pointer up/down action.\r\n */\r\nexport type PointerUpDownStageAction = (\r\n unTranslatedPointerX: number,\r\n unTranslatedPointerY: number,\r\n pickResult: Nullable<PickingInfo>,\r\n evt: IPointerEvent,\r\n doubleClick: boolean\r\n) => Nullable<PickingInfo>;\r\n\r\n/**\r\n * Representation of a stage in the scene (Basically a list of ordered steps)\r\n * @internal\r\n */\r\nexport class Stage<T extends Function> extends Array<{ index: number; component: ISceneComponent; action: T }> {\r\n /**\r\n * Hide ctor from the rest of the world.\r\n * @param items The items to add.\r\n */\r\n private constructor(items?: { index: number; component: ISceneComponent; action: T }[]) {\r\n super(...(<any>items));\r\n }\r\n\r\n /**\r\n * Creates a new Stage.\r\n * @returns A new instance of a Stage\r\n */\r\n static Create<T extends Function>(): Stage<T> {\r\n return Object.create(Stage.prototype);\r\n }\r\n\r\n /**\r\n * Registers a step in an ordered way in the targeted stage.\r\n * @param index Defines the position to register the step in\r\n * @param component Defines the component attached to the step\r\n * @param action Defines the action to launch during the step\r\n */\r\n public registerStep(index: number, component: ISceneComponent, action: T): void {\r\n let i = 0;\r\n let maxIndex = Number.MAX_VALUE;\r\n for (; i < this.length; i++) {\r\n const step = this[i];\r\n maxIndex = step.index;\r\n if (index < maxIndex) {\r\n break;\r\n }\r\n }\r\n this.splice(i, 0, { index, component, action: action.bind(component) });\r\n }\r\n\r\n /**\r\n * Clears all the steps from the stage.\r\n */\r\n public clear(): void {\r\n this.length = 0;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"sceneComponent.js","sourceRoot":"","sources":["../../../dev/core/src/sceneComponent.ts"],"names":[],"mappings":"AAcA;;;GAGG;AACH,MAAM,OAAO,uBAAuB;;AACT,wCAAgB,GAAG,aAAa,CAAC;AACjC,kCAAU,GAAG,OAAO,CAAC;AACrB,4CAAoB,GAAG,iBAAiB,CAAC;AACzC,gDAAwB,GAAG,qBAAqB,CAAC;AACjD,2CAAmB,GAAG,gBAAgB,CAAC;AACvC,oCAAY,GAAG,SAAS,CAAC;AACzB,gDAAwB,GAAG,qBAAqB,CAAC;AACjD,mDAA2B,GAAG,wBAAwB,CAAC;AACvD,4CAAoB,GAAG,iBAAiB,CAAC;AACzC,0CAAkB,GAAG,eAAe,CAAC;AACrC,iDAAyB,GAAG,sBAAsB,CAAC;AACnD,+CAAuB,GAAG,oBAAoB,CAAC;AAC/C,6DAAqC,GAAG,kCAAkC,CAAC;AAC3E,mCAAW,GAAG,QAAQ,CAAC;AACvB,uCA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AC,CAAC;IACpB,CAAC;CACJ","sourcesContent":["import type { Scene } from \"./scene\";\r\nimport type { SmartArrayNoDuplicate } from \"./Misc/smartArray\";\r\nimport type { Nullable } from \"./types\";\r\nimport type { PickingInfo } from \"./Collisions/pickingInfo\";\r\nimport type { IPointerEvent } from \"./Events/deviceInputEvents\";\r\n\r\nimport type { Mesh } from \"./Meshes/mesh\";\r\nimport type { Effect } from \"./Materials/effect\";\r\nimport type { Camera } from \"./Cameras/camera\";\r\nimport type { AbstractMesh } from \"./Meshes/abstractMesh\";\r\nimport type { SubMesh } from \"./Meshes/subMesh\";\r\nimport type { RenderTargetTexture } from \"./Materials/Textures/renderTargetTexture\";\r\nimport type { IAssetContainer } from \"./IAssetContainer\";\r\n\r\n/**\r\n * Groups all the scene component constants in one place to ease maintenance.\r\n * @internal\r\n */\r\nexport class SceneComponentConstants {\r\n public static readonly NAME_EFFECTLAYER = \"EffectLayer\";\r\n public static readonly NAME_LAYER = \"Layer\";\r\n public static readonly NAME_LENSFLARESYSTEM = \"LensFlareSystem\";\r\n public static readonly NAME_BOUNDINGBOXRENDERER = \"BoundingBoxRenderer\";\r\n public static readonly NAME_PARTICLESYSTEM = \"ParticleSystem\";\r\n public static readonly NAME_GAMEPAD = \"Gamepad\";\r\n public static readonly NAME_SIMPLIFICATIONQUEUE = \"SimplificationQueue\";\r\n public static readonly NAME_GEOMETRYBUFFERRENDERER = \"GeometryBufferRenderer\";\r\n public static readonly NAME_PREPASSRENDERER = \"PrePassRenderer\";\r\n public static readonly NAME_DEPTHRENDERER = \"DepthRenderer\";\r\n public static readonly NAME_DEPTHPEELINGRENDERER = \"DepthPeelingRenderer\";\r\n public static readonly NAME_IBLSHADOWSRENDERER = \"IblShadowsRenderer\";\r\n public static readonly NAME_POSTPROCESSRENDERPIPELINEMANAGER = \"PostProcessRenderPipelineManager\";\r\n public static readonly NAME_SPRITE = \"Sprite\";\r\n public static readonly NAME_SUBSURFACE = \"SubSurface\";\r\n public static readonly NAME_OUTLINERENDERER = \"Outline\";\r\n public static readonly NAME_PROCEDURALTEXTURE = \"ProceduralTexture\";\r\n public static readonly NAME_SHADOWGENERATOR = \"ShadowGenerator\";\r\n public static readonly NAME_OCTREE = \"Octree\";\r\n public static readonly NAME_PHYSICSENGINE = \"PhysicsEngine\";\r\n public static readonly NAME_AUDIO = \"Audio\";\r\n public static readonly NAME_FLUIDRENDERER = \"FluidRenderer\";\r\n\r\n public static readonly STEP_ISREADYFORMESH_EFFECTLAYER = 0;\r\n\r\n public static readonly STEP_BEFOREEVALUATEACTIVEMESH_BOUNDINGBOXRENDERER = 0;\r\n\r\n public static readonly STEP_EVALUATESUBMESH_BOUNDINGBOXRENDERER = 0;\r\n\r\n public static readonly STEP_PREACTIVEMESH_BOUNDINGBOXRENDERER = 0;\r\n\r\n public static readonly STEP_CAMERADRAWRENDERTARGET_EFFECTLAYER = 1;\r\n\r\n public static readonly STEP_BEFORECAMERADRAW_PREPASS = 0;\r\n public static readonly STEP_BEFORECAMERADRAW_EFFECTLAYER = 1;\r\n public static readonly STEP_BEFORECAMERADRAW_LAYER = 2;\r\n\r\n public static readonly STEP_BEFORERENDERTARGETDRAW_PREPASS = 0;\r\n public static readonly STEP_BEFORERENDERTARGETDRAW_LAYER = 1;\r\n\r\n public static readonly STEP_BEFORERENDERINGMESH_PREPASS = 0;\r\n public static readonly STEP_BEFORERENDERINGMESH_OUTLINE = 1;\r\n\r\n public static readonly STEP_AFTERRENDERINGMESH_PREPASS = 0;\r\n public static readonly STEP_AFTERRENDERINGMESH_OUTLINE = 1;\r\n\r\n public static readonly STEP_AFTERRENDERINGGROUPDRAW_EFFECTLAYER_DRAW = 0;\r\n public static readonly STEP_AFTERRENDERINGGROUPDRAW_BOUNDINGBOXRENDERER = 1;\r\n\r\n public static readonly STEP_BEFORECAMERAUPDATE_SIMPLIFICATIONQUEUE = 0;\r\n public static readonly STEP_BEFORECAMERAUPDATE_GAMEPAD = 1;\r\n\r\n public static readonly STEP_BEFORECLEAR_PROCEDURALTEXTURE = 0;\r\n public static readonly STEP_BEFORECLEAR_PREPASS = 1;\r\n\r\n public static readonly STEP_BEFORERENDERTARGETCLEAR_PREPASS = 0;\r\n\r\n public static readonly STEP_AFTERRENDERTARGETDRAW_PREPASS = 0;\r\n public static readonly STEP_AFTERRENDERTARGETDRAW_LAYER = 1;\r\n\r\n public static readonly STEP_AFTERCAMERADRAW_PREPASS = 0;\r\n public static readonly STEP_AFTERCAMERADRAW_EFFECTLAYER = 1;\r\n public static readonly STEP_AFTERCAMERADRAW_LENSFLARESYSTEM = 2;\r\n public static readonly STEP_AFTERCAMERADRAW_EFFECTLAYER_DRAW = 3;\r\n public static readonly STEP_AFTERCAMERADRAW_LAYER = 4;\r\n public static readonly STEP_AFTERCAMERADRAW_FLUIDRENDERER = 5;\r\n\r\n public static readonly STEP_AFTERCAMERAPOSTPROCESS_LAYER = 0;\r\n\r\n public static readonly STEP_AFTERRENDERTARGETPOSTPROCESS_LAYER = 0;\r\n\r\n public static readonly STEP_AFTERRENDER_AUDIO = 0;\r\n\r\n public static readonly STEP_GATHERRENDERTARGETS_DEPTHRENDERER = 0;\r\n public static readonly STEP_GATHERRENDERTARGETS_GEOMETRYBUFFERRENDERER = 1;\r\n public static readonly STEP_GATHERRENDERTARGETS_SHADOWGENERATOR = 2;\r\n public static readonly STEP_GATHERRENDERTARGETS_POSTPROCESSRENDERPIPELINEMANAGER = 3;\r\n\r\n public static readonly STEP_GATHERACTIVECAMERARENDERTARGETS_DEPTHRENDERER = 0;\r\n public static readonly STEP_GATHERACTIVECAMERARENDERTARGETS_FLUIDRENDERER = 1;\r\n\r\n public static readonly STEP_POINTERMOVE_SPRITE = 0;\r\n public static readonly STEP_POINTERDOWN_SPRITE = 0;\r\n public static readonly STEP_POINTERUP_SPRITE = 0;\r\n}\r\n\r\n/**\r\n * This represents a scene component.\r\n *\r\n * This is used to decouple the dependency the scene is having on the different workloads like\r\n * layers, post processes...\r\n */\r\nexport interface ISceneComponent {\r\n /**\r\n * The name of the component. Each component must have a unique name.\r\n */\r\n name: string;\r\n\r\n /**\r\n * The scene the component belongs to.\r\n */\r\n scene: Scene;\r\n\r\n /**\r\n * Register the component to one instance of a scene.\r\n */\r\n register(): void;\r\n\r\n /**\r\n * Rebuilds the elements related to this component in case of\r\n * context lost for instance.\r\n */\r\n rebuild(): void;\r\n\r\n /**\r\n * Disposes the component and the associated ressources.\r\n */\r\n dispose(): void;\r\n}\r\n\r\n/**\r\n * This represents a SERIALIZABLE scene component.\r\n *\r\n * This extends Scene Component to add Serialization methods on top.\r\n */\r\nexport interface ISceneSerializableComponent extends ISceneComponent {\r\n /**\r\n * Adds all the elements from the container to the scene\r\n * @param container the container holding the elements\r\n */\r\n addFromContainer(container: IAssetContainer): void;\r\n\r\n /**\r\n * Removes all the elements in the container from the scene\r\n * @param container contains the elements to remove\r\n * @param dispose if the removed element should be disposed (default: false)\r\n */\r\n removeFromContainer(container: IAssetContainer, dispose?: boolean): void;\r\n\r\n /**\r\n * Serializes the component data to the specified json object\r\n * @param serializationObject The object to serialize to\r\n */\r\n serialize(serializationObject: any): void;\r\n}\r\n\r\n/**\r\n * Strong typing of a Mesh related stage step action\r\n */\r\nexport type MeshStageAction = (mesh: AbstractMesh, hardwareInstancedRendering: boolean) => boolean;\r\n\r\n/**\r\n * Strong typing of a Evaluate Sub Mesh related stage step action\r\n */\r\nexport type EvaluateSubMeshStageAction = (mesh: AbstractMesh, subMesh: SubMesh) => void;\r\n\r\n/**\r\n * Strong typing of a pre active Mesh related stage step action\r\n */\r\nexport type PreActiveMeshStageAction = (mesh: AbstractMesh) => void;\r\n\r\n/**\r\n * Strong typing of a Camera related stage step action\r\n */\r\nexport type CameraStageAction = (camera: Camera) => void;\r\n\r\n/**\r\n * Strong typing of a Camera Frame buffer related stage step action\r\n */\r\nexport type CameraStageFrameBufferAction = (camera: Camera) => boolean;\r\n\r\n/**\r\n * Strong typing of a Render Target related stage step action\r\n */\r\nexport type RenderTargetStageAction = (renderTarget: RenderTargetTexture, faceIndex?: number, layer?: number) => void;\r\n\r\n/**\r\n * Strong typing of a RenderingGroup related stage step action\r\n */\r\nexport type RenderingGroupStageAction = (renderingGroupId: number) => void;\r\n\r\n/**\r\n * Strong typing of a Mesh Render related stage step action\r\n */\r\nexport type RenderingMeshStageAction = (mesh: Mesh, subMesh: SubMesh, batch: any, effect: Nullable<Effect>) => void;\r\n\r\n/**\r\n * Strong typing of a simple stage step action\r\n */\r\nexport type SimpleStageAction = () => void;\r\n\r\n/**\r\n * Strong typing of a render target action.\r\n */\r\nexport type RenderTargetsStageAction = (renderTargets: SmartArrayNoDuplicate<RenderTargetTexture>) => void;\r\n\r\n/**\r\n * Strong typing of a pointer move action.\r\n */\r\nexport type PointerMoveStageAction = (\r\n unTranslatedPointerX: number,\r\n unTranslatedPointerY: number,\r\n pickResult: Nullable<PickingInfo>,\r\n isMeshPicked: boolean,\r\n element: Nullable<HTMLElement>\r\n) => Nullable<PickingInfo>;\r\n\r\n/**\r\n * Strong typing of a pointer up/down action.\r\n */\r\nexport type PointerUpDownStageAction = (\r\n unTranslatedPointerX: number,\r\n unTranslatedPointerY: number,\r\n pickResult: Nullable<PickingInfo>,\r\n evt: IPointerEvent,\r\n doubleClick: boolean\r\n) => Nullable<PickingInfo>;\r\n\r\n/**\r\n * Representation of a stage in the scene (Basically a list of ordered steps)\r\n * @internal\r\n */\r\nexport class Stage<T extends Function> extends Array<{ index: number; component: ISceneComponent; action: T }> {\r\n /**\r\n * Hide ctor from the rest of the world.\r\n * @param items The items to add.\r\n */\r\n private constructor(items?: { index: number; component: ISceneComponent; action: T }[]) {\r\n super(...(<any>items));\r\n }\r\n\r\n /**\r\n * Creates a new Stage.\r\n * @returns A new instance of a Stage\r\n */\r\n static Create<T extends Function>(): Stage<T> {\r\n return Object.create(Stage.prototype);\r\n }\r\n\r\n /**\r\n * Registers a step in an ordered way in the targeted stage.\r\n * @param index Defines the position to register the step in\r\n * @param component Defines the component attached to the step\r\n * @param action Defines the action to launch during the step\r\n */\r\n public registerStep(index: number, component: ISceneComponent, action: T): void {\r\n let i = 0;\r\n let maxIndex = Number.MAX_VALUE;\r\n for (; i < this.length; i++) {\r\n const step = this[i];\r\n maxIndex = step.index;\r\n if (index < maxIndex) {\r\n break;\r\n }\r\n }\r\n this.splice(i, 0, { index, component, action: action.bind(component) });\r\n }\r\n\r\n /**\r\n * Clears all the steps from the stage.\r\n */\r\n public clear(): void {\r\n this.length = 0;\r\n }\r\n}\r\n"]}
package/abstractScene.js DELETED
@@ -1,117 +0,0 @@
1
- import { RegisterClass } from "./Misc/typeStore.js";
2
- /**
3
- * Base class of the scene acting as a container for the different elements composing a scene.
4
- * This class is dynamically extended by the different components of the scene increasing
5
- * flexibility and reducing coupling
6
- */
7
- export class AbstractScene {
8
- constructor() {
9
- /**
10
- * Gets the list of root nodes (ie. nodes with no parent)
11
- */
12
- this.rootNodes = [];
13
- /** All of the cameras added to this scene
14
- * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras
15
- */
16
- this.cameras = [];
17
- /**
18
- * All of the lights added to this scene
19
- * @see https://doc.babylonjs.com/features/featuresDeepDive/lights/lights_introduction
20
- */
21
- this.lights = [];
22
- /**
23
- * All of the (abstract) meshes added to this scene
24
- */
25
- this.meshes = [];
26
- /**
27
- * The list of skeletons added to the scene
28
- * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/bonesSkeletons
29
- */
30
- this.skeletons = [];
31
- /**
32
- * All of the particle systems added to this scene
33
- * @see https://doc.babylonjs.com/features/featuresDeepDive/particles/particle_system/particle_system_intro
34
- */
35
- this.particleSystems = [];
36
- /**
37
- * Gets a list of Animations associated with the scene
38
- */
39
- this.animations = [];
40
- /**
41
- * All of the animation groups added to this scene
42
- * @see https://doc.babylonjs.com/features/featuresDeepDive/animation/groupAnimations
43
- */
44
- this.animationGroups = [];
45
- /**
46
- * All of the multi-materials added to this scene
47
- * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/multiMaterials
48
- */
49
- this.multiMaterials = [];
50
- /**
51
- * All of the materials added to this scene
52
- * In the context of a Scene, it is not supposed to be modified manually.
53
- * Any addition or removal should be done using the addMaterial and removeMaterial Scene methods.
54
- * Note also that the order of the Material within the array is not significant and might change.
55
- * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/materials_introduction
56
- */
57
- this.materials = [];
58
- /**
59
- * The list of morph target managers added to the scene
60
- * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/dynamicMeshMorph
61
- */
62
- this.morphTargetManagers = [];
63
- /**
64
- * The list of geometries used in the scene.
65
- */
66
- this.geometries = [];
67
- /**
68
- * All of the transform nodes added to this scene
69
- * In the context of a Scene, it is not supposed to be modified manually.
70
- * Any addition or removal should be done using the addTransformNode and removeTransformNode Scene methods.
71
- * Note also that the order of the TransformNode within the array is not significant and might change.
72
- * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/transforms/parent_pivot/transform_node
73
- */
74
- this.transformNodes = [];
75
- /**
76
- * ActionManagers available on the scene.
77
- * @deprecated
78
- */
79
- this.actionManagers = [];
80
- /**
81
- * Textures to keep.
82
- */
83
- this.textures = [];
84
- /** @internal */
85
- this._environmentTexture = null;
86
- /**
87
- * The list of postprocesses added to the scene
88
- */
89
- this.postProcesses = [];
90
- }
91
- /**
92
- * Texture used in all pbr material as the reflection texture.
93
- * As in the majority of the scene they are the same (exception for multi room and so on),
94
- * this is easier to reference from here than from all the materials.
95
- */
96
- get environmentTexture() {
97
- return this._environmentTexture;
98
- }
99
- set environmentTexture(value) {
100
- this._environmentTexture = value;
101
- }
102
- /**
103
- * @returns all meshes, lights, cameras, transformNodes and bones
104
- */
105
- getNodes() {
106
- let nodes = [];
107
- nodes = nodes.concat(this.meshes);
108
- nodes = nodes.concat(this.lights);
109
- nodes = nodes.concat(this.cameras);
110
- nodes = nodes.concat(this.transformNodes); // dummies
111
- this.skeletons.forEach((skeleton) => (nodes = nodes.concat(skeleton.bones)));
112
- return nodes;
113
- }
114
- }
115
- // Register Class Name
116
- RegisterClass("BABYLON.AbstractScene", AbstractScene);
117
- //# sourceMappingURL=abstractScene.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"abstractScene.js","sourceRoot":"","sources":["../../../dev/core/src/abstractScene.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD;;;;GAIG;AACH,MAAM,OAAgB,aAAa;IAAnC;QACI;;WAEG;QACI,cAAS,GAAW,EAAE,CAAC;QAE9B;;WAEG;QACI,YAAO,GAAa,EAAE,CAAC;QAE9B;;;WAGG;QACI,WAAM,GAAY,EAAE,CAAC;QAE5B;;WAEG;QACI,WAAM,GAAmB,EAAE,CAAC;QAEnC;;;WAGG;QACI,cAAS,GAAe,EAAE,CAAC;QAElC;;;WAGG;QACI,oBAAe,GAAsB,EAAE,CAAC;QAE/C;;WAEG;QACI,eAAU,GAAgB,EAAE,CAAC;QAEpC;;;WAGG;QACI,oBAAe,GAAqB,EAAE,CAAC;QAE9C;;;WAGG;QACI,mBAAc,GAAoB,EAAE,CAAC;QAE5C;;;;;;WAMG;QACI,cAAS,GAAe,EAAE,CAAC;QAElC;;;WAGG;QACI,wBAAmB,GAAyB,EAAE,CAAC;QAEtD;;WAEG;QACI,eAAU,GAAe,EAAE,CAAC;QAEnC;;;;;;WAMG;QACI,mBAAc,GAAoB,EAAE,CAAC;QAE5C;;;WAGG;QACI,mBAAc,GAA4B,EAAE,CAAC;QAEpD;;WAEG;QACI,aAAQ,GAAkB,EAAE,CAAC;QAEpC,gBAAgB;QACN,wBAAmB,GAA0B,IAAI,CAAC;QAc5D;;WAEG;QACI,kBAAa,GAAkB,EAAE,CAAC;IAc7C,CAAC;IA9BG;;;;OAIG;IACH,IAAW,kBAAkB;QACzB,OAAO,IAAI,CAAC,mBAAmB,CAAC;IACpC,CAAC;IAED,IAAW,kBAAkB,CAAC,KAA4B;QACtD,IAAI,CAAC,mBAAmB,GAAG,KAAK,CAAC;IACrC,CAAC;IAOD;;OAEG;IACI,QAAQ;QACX,IAAI,KAAK,GAAW,EAAE,CAAC;QACvB,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAClC,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAClC,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACnC,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,UAAU;QACrD,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAC7E,OAAO,KAAK,CAAC;IACjB,CAAC;CACJ;AAED,sBAAsB;AACtB,aAAa,CAAC,uBAAuB,EAAE,aAAa,CAAC,CAAC","sourcesContent":["import type { Nullable } from \"./types\";\r\nimport type { AbstractMesh } from \"./Meshes/abstractMesh\";\r\nimport type { TransformNode } from \"./Meshes/transformNode\";\r\nimport type { Geometry } from \"./Meshes/geometry\";\r\nimport type { Skeleton } from \"./Bones/skeleton\";\r\nimport type { MorphTargetManager } from \"./Morph/morphTargetManager\";\r\nimport type { IParticleSystem } from \"./Particles/IParticleSystem\";\r\nimport type { AnimationGroup } from \"./Animations/animationGroup\";\r\nimport type { BaseTexture } from \"./Materials/Textures/baseTexture\";\r\nimport type { Material } from \"./Materials/material\";\r\nimport type { MultiMaterial } from \"./Materials/multiMaterial\";\r\nimport type { AbstractActionManager } from \"./Actions/abstractActionManager\";\r\nimport type { Camera } from \"./Cameras/camera\";\r\nimport type { Light } from \"./Lights/light\";\r\nimport type { Node } from \"./node\";\r\nimport type { PostProcess } from \"./PostProcesses/postProcess\";\r\nimport type { Animation } from \"./Animations/animation\";\r\nimport { RegisterClass } from \"./Misc/typeStore\";\r\n\r\n/**\r\n * Base class of the scene acting as a container for the different elements composing a scene.\r\n * This class is dynamically extended by the different components of the scene increasing\r\n * flexibility and reducing coupling\r\n */\r\nexport abstract class AbstractScene {\r\n /**\r\n * Gets the list of root nodes (ie. nodes with no parent)\r\n */\r\n public rootNodes: Node[] = [];\r\n\r\n /** All of the cameras added to this scene\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras\r\n */\r\n public cameras: Camera[] = [];\r\n\r\n /**\r\n * All of the lights added to this scene\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/lights/lights_introduction\r\n */\r\n public lights: Light[] = [];\r\n\r\n /**\r\n * All of the (abstract) meshes added to this scene\r\n */\r\n public meshes: AbstractMesh[] = [];\r\n\r\n /**\r\n * The list of skeletons added to the scene\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/bonesSkeletons\r\n */\r\n public skeletons: Skeleton[] = [];\r\n\r\n /**\r\n * All of the particle systems added to this scene\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/particles/particle_system/particle_system_intro\r\n */\r\n public particleSystems: IParticleSystem[] = [];\r\n\r\n /**\r\n * Gets a list of Animations associated with the scene\r\n */\r\n public animations: Animation[] = [];\r\n\r\n /**\r\n * All of the animation groups added to this scene\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/animation/groupAnimations\r\n */\r\n public animationGroups: AnimationGroup[] = [];\r\n\r\n /**\r\n * All of the multi-materials added to this scene\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/multiMaterials\r\n */\r\n public multiMaterials: MultiMaterial[] = [];\r\n\r\n /**\r\n * All of the materials added to this scene\r\n * In the context of a Scene, it is not supposed to be modified manually.\r\n * Any addition or removal should be done using the addMaterial and removeMaterial Scene methods.\r\n * Note also that the order of the Material within the array is not significant and might change.\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/materials_introduction\r\n */\r\n public materials: Material[] = [];\r\n\r\n /**\r\n * The list of morph target managers added to the scene\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/dynamicMeshMorph\r\n */\r\n public morphTargetManagers: MorphTargetManager[] = [];\r\n\r\n /**\r\n * The list of geometries used in the scene.\r\n */\r\n public geometries: Geometry[] = [];\r\n\r\n /**\r\n * All of the transform nodes added to this scene\r\n * In the context of a Scene, it is not supposed to be modified manually.\r\n * Any addition or removal should be done using the addTransformNode and removeTransformNode Scene methods.\r\n * Note also that the order of the TransformNode within the array is not significant and might change.\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/transforms/parent_pivot/transform_node\r\n */\r\n public transformNodes: TransformNode[] = [];\r\n\r\n /**\r\n * ActionManagers available on the scene.\r\n * @deprecated\r\n */\r\n public actionManagers: AbstractActionManager[] = [];\r\n\r\n /**\r\n * Textures to keep.\r\n */\r\n public textures: BaseTexture[] = [];\r\n\r\n /** @internal */\r\n protected _environmentTexture: Nullable<BaseTexture> = null;\r\n /**\r\n * Texture used in all pbr material as the reflection texture.\r\n * As in the majority of the scene they are the same (exception for multi room and so on),\r\n * this is easier to reference from here than from all the materials.\r\n */\r\n public get environmentTexture(): Nullable<BaseTexture> {\r\n return this._environmentTexture;\r\n }\r\n\r\n public set environmentTexture(value: Nullable<BaseTexture>) {\r\n this._environmentTexture = value;\r\n }\r\n\r\n /**\r\n * The list of postprocesses added to the scene\r\n */\r\n public postProcesses: PostProcess[] = [];\r\n\r\n /**\r\n * @returns all meshes, lights, cameras, transformNodes and bones\r\n */\r\n public getNodes(): Array<Node> {\r\n let nodes: Node[] = [];\r\n nodes = nodes.concat(this.meshes);\r\n nodes = nodes.concat(this.lights);\r\n nodes = nodes.concat(this.cameras);\r\n nodes = nodes.concat(this.transformNodes); // dummies\r\n this.skeletons.forEach((skeleton) => (nodes = nodes.concat(skeleton.bones)));\r\n return nodes;\r\n }\r\n}\r\n\r\n// Register Class Name\r\nRegisterClass(\"BABYLON.AbstractScene\", AbstractScene);\r\n"]}