@babylonjs/core 5.16.0 → 5.18.0
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.
- package/Animations/animatable.js +1 -1
- package/Animations/animatable.js.map +1 -1
- package/Animations/animation.d.ts +8 -1
- package/Animations/animation.js +8 -1
- package/Animations/animation.js.map +1 -1
- package/Animations/animationGroup.js +5 -4
- package/Animations/animationGroup.js.map +1 -1
- package/Bones/skeleton.js +1 -1
- package/Bones/skeleton.js.map +1 -1
- package/Cameras/Inputs/arcRotateCameraKeyboardMoveInput.js +2 -2
- package/Cameras/Inputs/arcRotateCameraKeyboardMoveInput.js.map +1 -1
- package/Cameras/Inputs/flyCameraKeyboardInput.js +3 -3
- package/Cameras/Inputs/flyCameraKeyboardInput.js.map +1 -1
- package/Cameras/Inputs/followCameraKeyboardMoveInput.js +2 -2
- package/Cameras/Inputs/followCameraKeyboardMoveInput.js.map +1 -1
- package/Cameras/Inputs/freeCameraKeyboardMoveInput.js +3 -3
- package/Cameras/Inputs/freeCameraKeyboardMoveInput.js.map +1 -1
- package/Cameras/Inputs/freeCameraTouchInput.js +1 -1
- package/Cameras/Inputs/freeCameraTouchInput.js.map +1 -1
- package/Cameras/VR/vrExperienceHelper.js +1 -1
- package/Cameras/VR/vrExperienceHelper.js.map +1 -1
- package/Cameras/VR/webVRCamera.js +1 -1
- package/Cameras/VR/webVRCamera.js.map +1 -1
- package/Cameras/camera.js +3 -3
- package/Cameras/camera.js.map +1 -1
- package/Engines/Extensions/engine.views.d.ts +13 -0
- package/Engines/Extensions/engine.views.js +16 -1
- package/Engines/Extensions/engine.views.js.map +1 -1
- package/Engines/Processors/shaderCodeCursor.js +2 -1
- package/Engines/Processors/shaderCodeCursor.js.map +1 -1
- package/Engines/WebGPU/webgpuOcclusionQuery.js +1 -1
- package/Engines/WebGPU/webgpuOcclusionQuery.js.map +1 -1
- package/Engines/engine.d.ts +2 -10
- package/Engines/engine.js +0 -14
- package/Engines/engine.js.map +1 -1
- package/Engines/engineFeatures.d.ts +2 -0
- package/Engines/engineFeatures.js.map +1 -1
- package/Engines/nativeEngine.d.ts +6 -2
- package/Engines/nativeEngine.js +13 -6
- package/Engines/nativeEngine.js.map +1 -1
- package/Engines/nullEngine.js +1 -0
- package/Engines/nullEngine.js.map +1 -1
- package/Engines/thinEngine.d.ts +10 -0
- package/Engines/thinEngine.js +26 -6
- package/Engines/thinEngine.js.map +1 -1
- package/Engines/webgpuEngine.js +1 -0
- package/Engines/webgpuEngine.js.map +1 -1
- package/Gizmos/axisDragGizmo.d.ts +11 -8
- package/Gizmos/axisDragGizmo.js.map +1 -1
- package/Gizmos/axisScaleGizmo.d.ts +20 -13
- package/Gizmos/axisScaleGizmo.js.map +1 -1
- package/Gizmos/boundingBoxGizmo.d.ts +27 -18
- package/Gizmos/boundingBoxGizmo.js +6 -0
- package/Gizmos/boundingBoxGizmo.js.map +1 -1
- package/Gizmos/cameraGizmo.d.ts +8 -5
- package/Gizmos/cameraGizmo.js.map +1 -1
- package/Gizmos/gizmo.d.ts +48 -6
- package/Gizmos/gizmo.js.map +1 -1
- package/Gizmos/gizmoManager.d.ts +17 -9
- package/Gizmos/gizmoManager.js.map +1 -1
- package/Gizmos/lightGizmo.d.ts +12 -7
- package/Gizmos/lightGizmo.js.map +1 -1
- package/Gizmos/planeDragGizmo.d.ts +10 -8
- package/Gizmos/planeDragGizmo.js.map +1 -1
- package/Gizmos/planeRotationGizmo.d.ts +23 -14
- package/Gizmos/planeRotationGizmo.js.map +1 -1
- package/Gizmos/positionGizmo.d.ts +9 -7
- package/Gizmos/positionGizmo.js +1 -1
- package/Gizmos/positionGizmo.js.map +1 -1
- package/Gizmos/rotationGizmo.d.ts +6 -4
- package/Gizmos/rotationGizmo.js.map +1 -1
- package/Gizmos/scaleGizmo.d.ts +15 -12
- package/Gizmos/scaleGizmo.js.map +1 -1
- package/Inputs/scene.inputManager.js +0 -3
- package/Inputs/scene.inputManager.js.map +1 -1
- package/Loading/sceneLoader.js +5 -5
- package/Loading/sceneLoader.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/TBNBlock.d.ts +12 -0
- package/Materials/Node/Blocks/Fragment/TBNBlock.js +50 -0
- package/Materials/Node/Blocks/Fragment/TBNBlock.js.map +1 -1
- package/Materials/Node/Blocks/Vertex/lightInformationBlock.d.ts +18 -0
- package/Materials/Node/Blocks/Vertex/lightInformationBlock.js +85 -1
- package/Materials/Node/Blocks/Vertex/lightInformationBlock.js.map +1 -1
- package/Materials/Node/Blocks/gradientBlock.js +1 -1
- package/Materials/Node/Blocks/gradientBlock.js.map +1 -1
- package/Materials/Node/nodeMaterial.d.ts +18 -2
- package/Materials/Node/nodeMaterial.js +56 -27
- package/Materials/Node/nodeMaterial.js.map +1 -1
- package/Materials/Textures/baseTexture.d.ts +2 -1
- package/Materials/Textures/baseTexture.js +4 -1
- package/Materials/Textures/baseTexture.js.map +1 -1
- package/Materials/Textures/prePassRenderTarget.js +1 -1
- package/Materials/Textures/prePassRenderTarget.js.map +1 -1
- package/Materials/Textures/renderTargetTexture.js +11 -3
- package/Materials/Textures/renderTargetTexture.js.map +1 -1
- package/Materials/materialDefines.js +3 -1
- package/Materials/materialDefines.js.map +1 -1
- package/Materials/shaderMaterial.d.ts +10 -1
- package/Materials/shaderMaterial.js +10 -1
- package/Materials/shaderMaterial.js.map +1 -1
- package/Maths/math.color.d.ts +9 -1
- package/Maths/math.color.js +13 -1
- package/Maths/math.color.js.map +1 -1
- package/Maths/math.vector.d.ts +2 -2
- package/Maths/math.vector.js +18 -30
- package/Maths/math.vector.js.map +1 -1
- package/Meshes/Builders/icoSphereBuilder.js +2 -2
- package/Meshes/Builders/icoSphereBuilder.js.map +1 -1
- package/Meshes/Compression/dracoCompression.js +1 -1
- package/Meshes/Compression/dracoCompression.js.map +1 -1
- package/Meshes/abstractMesh.js +1 -1
- package/Meshes/abstractMesh.js.map +1 -1
- package/Meshes/geometry.js +1 -2
- package/Meshes/geometry.js.map +1 -1
- package/Meshes/thinInstanceMesh.js +5 -0
- package/Meshes/thinInstanceMesh.js.map +1 -1
- package/Misc/basis.js +3 -0
- package/Misc/basis.js.map +1 -1
- package/Misc/fileTools.js +2 -2
- package/Misc/fileTools.js.map +1 -1
- package/Misc/khronosTextureContainer2.js +1 -1
- package/Misc/khronosTextureContainer2.js.map +1 -1
- package/Misc/smartArray.js +0 -1
- package/Misc/smartArray.js.map +1 -1
- package/Misc/tools.d.ts +2 -2
- package/Misc/tools.js +4 -1
- package/Misc/tools.js.map +1 -1
- package/Offline/database.js +6 -8
- package/Offline/database.js.map +1 -1
- package/Particles/computeShaderParticleSystem.js +2 -2
- package/Particles/computeShaderParticleSystem.js.map +1 -1
- package/Particles/particleHelper.d.ts +12 -1
- package/Particles/particleHelper.js +12 -1
- package/Particles/particleHelper.js.map +1 -1
- package/Particles/particleSystem.js +2 -2
- package/Particles/particleSystem.js.map +1 -1
- package/Particles/particleSystemSet.js +1 -1
- package/Particles/particleSystemSet.js.map +1 -1
- package/Particles/solidParticleSystem.d.ts +3 -0
- package/Particles/solidParticleSystem.js +3 -0
- package/Particles/solidParticleSystem.js.map +1 -1
- package/Particles/webgl2ParticleSystem.js +2 -2
- package/Particles/webgl2ParticleSystem.js.map +1 -1
- package/Physics/Plugins/ammoJSPlugin.d.ts +2 -2
- package/Physics/Plugins/ammoJSPlugin.js +29 -29
- package/Physics/Plugins/ammoJSPlugin.js.map +1 -1
- package/Physics/Plugins/cannonJSPlugin.d.ts +2 -2
- package/Physics/Plugins/cannonJSPlugin.js +26 -26
- package/Physics/Plugins/cannonJSPlugin.js.map +1 -1
- package/Physics/Plugins/oimoJSPlugin.js +9 -11
- package/Physics/Plugins/oimoJSPlugin.js.map +1 -1
- package/Physics/physicsImpostor.d.ts +6 -6
- package/Physics/physicsImpostor.js +7 -6
- package/Physics/physicsImpostor.js.map +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/standardRenderingPipeline.js +3 -3
- package/PostProcesses/RenderPipeline/Pipelines/standardRenderingPipeline.js.map +1 -1
- package/Rendering/utilityLayerRenderer.js +1 -1
- package/Rendering/utilityLayerRenderer.js.map +1 -1
- package/Shaders/sprites.fragment.js +1 -1
- package/Shaders/sprites.fragment.js.map +1 -1
- package/Sprites/spriteManager.d.ts +10 -1
- package/Sprites/spriteManager.js +10 -1
- package/Sprites/spriteManager.js.map +1 -1
- package/Sprites/spriteRenderer.js +1 -1
- package/Sprites/spriteRenderer.js.map +1 -1
- package/XR/features/WebXRLayers.js +1 -1
- package/XR/features/WebXRLayers.js.map +1 -1
- package/assetContainer.js +12 -12
- package/assetContainer.js.map +1 -1
- package/node.js +1 -1
- package/node.js.map +1 -1
- package/package.json +1 -1
- package/scene.d.ts +2 -0
- package/scene.js +15 -8
- package/scene.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"particleSystemSet.js","sourceRoot":"","sources":["../../../../../lts/core/generated/Particles/particleSystemSet.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAEhE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAE7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAGjE,uDAAuD;AACvD;IAAA;IAIA,CAAC;IAAD,8CAAC;AAAD,CAAC,AAJD,IAIC;AAED;;GAEG;AACH;IAAA;QAQY,wBAAmB,GAAG,IAAI,CAAC;QAEnC;;WAEG;QACI,YAAO,GAAG,IAAI,KAAK,EAAmB,CAAC;IAsJlD,CAAC;IAjJG,sBAAW,0CAAW;QAHtB;;WAEG;aACH;YACI,OAAO,IAAI,CAAC,YAAY,CAAC;QAC7B,CAAC;aAED,UAAuB,KAAuC;YAC1D,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CAAC,gBAAgB,EAC7B,KAAK,CACR,CAAC;oBACF,MAAM;aACb;SACJ;QAED,OAAO,MAAM,CAAC;IAClB,CAAC;IAjKD;;OAEG;IACW,+BAAa,GAAG,wCAAwC,CAAC;IA+J3E,wBAAC;CAAA,AAnKD,IAmKC;SAnKY,iBAAiB","sourcesContent":["import type { Nullable } from \"../types\";\r\nimport { Color3 } from \"../Maths/math.color\";\r\nimport type { AbstractMesh } from \"../Meshes/abstractMesh\";\r\nimport { CreateSphere } from \"../Meshes/Builders/sphereBuilder\";\r\nimport type { IParticleSystem } from \"./IParticleSystem\";\r\nimport { GPUParticleSystem } from \"./gpuParticleSystem\";\r\nimport { EngineStore } from \"../Engines/engineStore\";\r\nimport { ParticleSystem } from \"../Particles/particleSystem\";\r\nimport type { Scene, IDisposable } from \"../scene\";\r\nimport { StandardMaterial } from \"../Materials/standardMaterial\";\r\nimport type { Vector3 } from \"../Maths/math.vector\";\r\n\r\n/** Internal class used to store shapes for emitters */\r\nclass ParticleSystemSetEmitterCreationOptions {\r\n public kind: string;\r\n public options: any;\r\n public renderingGroupId: number;\r\n}\r\n\r\n/**\r\n * Represents a set of particle systems working together to create a specific effect\r\n */\r\nexport class ParticleSystemSet implements IDisposable {\r\n /**\r\n * Gets or sets base Assets URL\r\n */\r\n public static BaseAssetsUrl = \"https://assets.babylonjs.com/particles\";\r\n\r\n private _emitterCreationOptions: ParticleSystemSetEmitterCreationOptions;\r\n private _emitterNode: Nullable<AbstractMesh | Vector3>;\r\n private _emitterNodeIsOwned = true;\r\n\r\n /**\r\n * Gets the particle system list\r\n */\r\n public systems = new Array<IParticleSystem>();\r\n\r\n /**\r\n * Gets or sets the emitter node used with this set\r\n */\r\n public get emitterNode(): Nullable<AbstractMesh | Vector3> {\r\n return this._emitterNode;\r\n }\r\n\r\n public set emitterNode(value: Nullable<AbstractMesh | Vector3>) {\r\n if (this._emitterNodeIsOwned && this._emitterNode) {\r\n if ((this._emitterNode as AbstractMesh).dispose) {\r\n (this._emitterNode as AbstractMesh).dispose();\r\n }\r\n this._emitterNodeIsOwned = false;\r\n }\r\n\r\n for (const system of this.systems) {\r\n system.emitter = value;\r\n }\r\n\r\n this._emitterNode = value;\r\n }\r\n\r\n /**\r\n * Creates a new emitter mesh as a sphere\r\n * @param options defines the options used to create the sphere\r\n * @param options.diameter\r\n * @param options.segments\r\n * @param options.color\r\n * @param renderingGroupId defines the renderingGroupId to use for the sphere\r\n * @param scene defines the hosting scene\r\n */\r\n public setEmitterAsSphere(options: { diameter: number; segments: number; color: Color3 }, renderingGroupId: number, scene: Scene) {\r\n if (this._emitterNodeIsOwned && this._emitterNode) {\r\n if ((this._emitterNode as AbstractMesh).dispose) {\r\n (this._emitterNode as AbstractMesh).dispose();\r\n }\r\n }\r\n\r\n this._emitterNodeIsOwned = true;\r\n\r\n this._emitterCreationOptions = {\r\n kind: \"Sphere\",\r\n options: options,\r\n renderingGroupId: renderingGroupId,\r\n };\r\n\r\n const emitterMesh = CreateSphere(\"emitterSphere\", { diameter: options.diameter, segments: options.segments }, scene);\r\n emitterMesh.renderingGroupId = renderingGroupId;\r\n\r\n const material = new StandardMaterial(\"emitterSphereMaterial\", scene);\r\n material.emissiveColor = options.color;\r\n emitterMesh.material = material;\r\n\r\n for (const system of this.systems) {\r\n system.emitter = emitterMesh;\r\n }\r\n\r\n this._emitterNode = emitterMesh;\r\n }\r\n\r\n /**\r\n * Starts all particle systems of the set\r\n * @param emitter defines an optional mesh to use as emitter for the particle systems\r\n */\r\n public start(emitter?: AbstractMesh): void {\r\n for (const system of this.systems) {\r\n if (emitter) {\r\n system.emitter = emitter;\r\n }\r\n system.start();\r\n }\r\n }\r\n\r\n /**\r\n * Release all associated resources\r\n */\r\n public dispose(): void {\r\n for (const system of this.systems) {\r\n system.dispose();\r\n }\r\n\r\n this.systems = [];\r\n\r\n if (this._emitterNode) {\r\n if ((this._emitterNode as AbstractMesh).dispose) {\r\n (this._emitterNode as AbstractMesh).dispose();\r\n }\r\n this._emitterNode = null;\r\n }\r\n }\r\n\r\n /**\r\n * Serialize the set into a JSON compatible object\r\n * @param serializeTexture defines if the texture must be serialized as well\r\n * @returns a JSON compatible representation of the set\r\n */\r\n public serialize(serializeTexture = false): any {\r\n const result: any = {};\r\n\r\n result.systems = [];\r\n for (const system of this.systems) {\r\n result.systems.push(system.serialize(serializeTexture));\r\n }\r\n\r\n if (this._emitterNode) {\r\n result.emitter = this._emitterCreationOptions;\r\n }\r\n\r\n return result;\r\n }\r\n\r\n /**\r\n * Parse a new ParticleSystemSet from a serialized source\r\n * @param data defines a JSON compatible representation of the set\r\n * @param scene defines the hosting scene\r\n * @param gpu defines if we want GPU particles or CPU particles\r\n * @param capacity defines the system capacity (if null or undefined the sotred capacity will be used)\r\n * @returns a new ParticleSystemSet\r\n */\r\n public static Parse(data: any, scene: Scene, gpu = false, capacity?: number): ParticleSystemSet {\r\n const result = new ParticleSystemSet();\r\n const rootUrl = this.BaseAssetsUrl + \"/textures/\";\r\n\r\n scene = scene || EngineStore.LastCreatedScene;\r\n\r\n for (const system of data.systems) {\r\n result.systems.push(gpu ? GPUParticleSystem.Parse(system, scene, rootUrl, true, capacity) : ParticleSystem.Parse(system, scene, rootUrl, true, capacity));\r\n }\r\n\r\n if (data.emitter) {\r\n const options = data.emitter.options;\r\n switch (data.emitter.kind) {\r\n case \"Sphere\":\r\n result.setEmitterAsSphere(\r\n {\r\n diameter: options.diameter,\r\n segments: options.segments,\r\n color: Color3.FromArray(options.color),\r\n },\r\n data.emitter.renderingGroupId,\r\n scene\r\n );\r\n break;\r\n }\r\n }\r\n\r\n return result;\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"particleSystemSet.js","sourceRoot":"","sources":["../../../../../lts/core/generated/Particles/particleSystemSet.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAEhE,OAAO,EAAE,iBA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,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC;SAC7J;QAED,IAAI,IAAI,CAAC,OAAO,EAAE;YACd,IAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC;YACrC,QAAQ,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE;gBACvB,KAAK,QAAQ;oBACT,MAAM,CAAC,kBAAkB,CACrB;wBACI,QAAQ,EAAE,OAAO,CAAC,QAAQ;wBAC1B,QAAQ,EAAE,OAAO,CAAC,QAAQ;wBAC1B,KAAK,EAAE,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC;qBACzC,EACD,IAAI,CAAC,OAAO,CAAC,gBAAgB,EAC7B,KAAK,CACR,CAAC;oBACF,MAAM;aACb;SACJ;QAED,OAAO,MAAM,CAAC;IAClB,CAAC;IAjKD;;OAEG;IACW,+BAAa,GAAG,wCAAwC,CAAC;IA+J3E,wBAAC;CAAA,AAnKD,IAmKC;SAnKY,iBAAiB","sourcesContent":["import type { Nullable } from \"../types\";\r\nimport { Color3 } from \"../Maths/math.color\";\r\nimport type { AbstractMesh } from \"../Meshes/abstractMesh\";\r\nimport { CreateSphere } from \"../Meshes/Builders/sphereBuilder\";\r\nimport type { IParticleSystem } from \"./IParticleSystem\";\r\nimport { GPUParticleSystem } from \"./gpuParticleSystem\";\r\nimport { EngineStore } from \"../Engines/engineStore\";\r\nimport { ParticleSystem } from \"../Particles/particleSystem\";\r\nimport type { Scene, IDisposable } from \"../scene\";\r\nimport { StandardMaterial } from \"../Materials/standardMaterial\";\r\nimport type { Vector3 } from \"../Maths/math.vector\";\r\n\r\n/** Internal class used to store shapes for emitters */\r\nclass ParticleSystemSetEmitterCreationOptions {\r\n public kind: string;\r\n public options: any;\r\n public renderingGroupId: number;\r\n}\r\n\r\n/**\r\n * Represents a set of particle systems working together to create a specific effect\r\n */\r\nexport class ParticleSystemSet implements IDisposable {\r\n /**\r\n * Gets or sets base Assets URL\r\n */\r\n public static BaseAssetsUrl = \"https://assets.babylonjs.com/particles\";\r\n\r\n private _emitterCreationOptions: ParticleSystemSetEmitterCreationOptions;\r\n private _emitterNode: Nullable<AbstractMesh | Vector3>;\r\n private _emitterNodeIsOwned = true;\r\n\r\n /**\r\n * Gets the particle system list\r\n */\r\n public systems = new Array<IParticleSystem>();\r\n\r\n /**\r\n * Gets or sets the emitter node used with this set\r\n */\r\n public get emitterNode(): Nullable<AbstractMesh | Vector3> {\r\n return this._emitterNode;\r\n }\r\n\r\n public set emitterNode(value: Nullable<AbstractMesh | Vector3>) {\r\n if (this._emitterNodeIsOwned && this._emitterNode) {\r\n if ((this._emitterNode as AbstractMesh).dispose) {\r\n (this._emitterNode as AbstractMesh).dispose();\r\n }\r\n this._emitterNodeIsOwned = false;\r\n }\r\n\r\n for (const system of this.systems) {\r\n system.emitter = value;\r\n }\r\n\r\n this._emitterNode = value;\r\n }\r\n\r\n /**\r\n * Creates a new emitter mesh as a sphere\r\n * @param options defines the options used to create the sphere\r\n * @param options.diameter\r\n * @param options.segments\r\n * @param options.color\r\n * @param renderingGroupId defines the renderingGroupId to use for the sphere\r\n * @param scene defines the hosting scene\r\n */\r\n public setEmitterAsSphere(options: { diameter: number; segments: number; color: Color3 }, renderingGroupId: number, scene: Scene) {\r\n if (this._emitterNodeIsOwned && this._emitterNode) {\r\n if ((this._emitterNode as AbstractMesh).dispose) {\r\n (this._emitterNode as AbstractMesh).dispose();\r\n }\r\n }\r\n\r\n this._emitterNodeIsOwned = true;\r\n\r\n this._emitterCreationOptions = {\r\n kind: \"Sphere\",\r\n options: options,\r\n renderingGroupId: renderingGroupId,\r\n };\r\n\r\n const emitterMesh = CreateSphere(\"emitterSphere\", { diameter: options.diameter, segments: options.segments }, scene);\r\n emitterMesh.renderingGroupId = renderingGroupId;\r\n\r\n const material = new StandardMaterial(\"emitterSphereMaterial\", scene);\r\n material.emissiveColor = options.color;\r\n emitterMesh.material = material;\r\n\r\n for (const system of this.systems) {\r\n system.emitter = emitterMesh;\r\n }\r\n\r\n this._emitterNode = emitterMesh;\r\n }\r\n\r\n /**\r\n * Starts all particle systems of the set\r\n * @param emitter defines an optional mesh to use as emitter for the particle systems\r\n */\r\n public start(emitter?: AbstractMesh): void {\r\n for (const system of this.systems) {\r\n if (emitter) {\r\n system.emitter = emitter;\r\n }\r\n system.start();\r\n }\r\n }\r\n\r\n /**\r\n * Release all associated resources\r\n */\r\n public dispose(): void {\r\n for (const system of this.systems) {\r\n system.dispose();\r\n }\r\n\r\n this.systems.length = 0;\r\n\r\n if (this._emitterNode) {\r\n if ((this._emitterNode as AbstractMesh).dispose) {\r\n (this._emitterNode as AbstractMesh).dispose();\r\n }\r\n this._emitterNode = null;\r\n }\r\n }\r\n\r\n /**\r\n * Serialize the set into a JSON compatible object\r\n * @param serializeTexture defines if the texture must be serialized as well\r\n * @returns a JSON compatible representation of the set\r\n */\r\n public serialize(serializeTexture = false): any {\r\n const result: any = {};\r\n\r\n result.systems = [];\r\n for (const system of this.systems) {\r\n result.systems.push(system.serialize(serializeTexture));\r\n }\r\n\r\n if (this._emitterNode) {\r\n result.emitter = this._emitterCreationOptions;\r\n }\r\n\r\n return result;\r\n }\r\n\r\n /**\r\n * Parse a new ParticleSystemSet from a serialized source\r\n * @param data defines a JSON compatible representation of the set\r\n * @param scene defines the hosting scene\r\n * @param gpu defines if we want GPU particles or CPU particles\r\n * @param capacity defines the system capacity (if null or undefined the sotred capacity will be used)\r\n * @returns a new ParticleSystemSet\r\n */\r\n public static Parse(data: any, scene: Scene, gpu = false, capacity?: number): ParticleSystemSet {\r\n const result = new ParticleSystemSet();\r\n const rootUrl = this.BaseAssetsUrl + \"/textures/\";\r\n\r\n scene = scene || EngineStore.LastCreatedScene;\r\n\r\n for (const system of data.systems) {\r\n result.systems.push(gpu ? GPUParticleSystem.Parse(system, scene, rootUrl, true, capacity) : ParticleSystem.Parse(system, scene, rootUrl, true, capacity));\r\n }\r\n\r\n if (data.emitter) {\r\n const options = data.emitter.options;\r\n switch (data.emitter.kind) {\r\n case \"Sphere\":\r\n result.setEmitterAsSphere(\r\n {\r\n diameter: options.diameter,\r\n segments: options.segments,\r\n color: Color3.FromArray(options.color),\r\n },\r\n data.emitter.renderingGroupId,\r\n scene\r\n );\r\n break;\r\n }\r\n }\r\n\r\n return result;\r\n }\r\n}\r\n"]}
|
|
@@ -155,6 +155,7 @@ export declare class SolidParticleSystem implements IDisposable {
|
|
|
155
155
|
* * particleIntersection (optional boolean, default false) : if the solid particle intersections must be computed.
|
|
156
156
|
* * boundingSphereOnly (optional boolean, default false) : if the particle intersection must be computed only with the bounding sphere (no bounding box computation, so faster).
|
|
157
157
|
* * bSphereRadiusFactor (optional float, default 1.0) : a number to multiply the bounding sphere radius by in order to reduce it for instance.
|
|
158
|
+
* * computeBoundingBox (optional boolean, default false): if the bounding box of the entire SPS will be computed (for occlusion detection, for example). If it is false, the bounding box will be the bounding box of the first particle.
|
|
158
159
|
* @param options.updatable
|
|
159
160
|
* @param options.isPickable
|
|
160
161
|
* @param options.enableDepthSort
|
|
@@ -164,6 +165,7 @@ export declare class SolidParticleSystem implements IDisposable {
|
|
|
164
165
|
* @param options.expandable
|
|
165
166
|
* @param options.useModelMaterial
|
|
166
167
|
* @param options.enableMultiMaterial
|
|
168
|
+
* @param options.computeBoundingBox
|
|
167
169
|
* @example bSphereRadiusFactor = 1.0 / Math.sqrt(3.0) => the bounding sphere exactly matches a spherical mesh.
|
|
168
170
|
*/
|
|
169
171
|
constructor(name: string, scene: Scene, options?: {
|
|
@@ -176,6 +178,7 @@ export declare class SolidParticleSystem implements IDisposable {
|
|
|
176
178
|
expandable?: boolean;
|
|
177
179
|
useModelMaterial?: boolean;
|
|
178
180
|
enableMultiMaterial?: boolean;
|
|
181
|
+
computeBoundingBox?: boolean;
|
|
179
182
|
});
|
|
180
183
|
/**
|
|
181
184
|
* Builds the SPS underlying mesh. Returns a standard Mesh.
|
|
@@ -35,6 +35,7 @@ var SolidParticleSystem = /** @class */ (function () {
|
|
|
35
35
|
* * particleIntersection (optional boolean, default false) : if the solid particle intersections must be computed.
|
|
36
36
|
* * boundingSphereOnly (optional boolean, default false) : if the particle intersection must be computed only with the bounding sphere (no bounding box computation, so faster).
|
|
37
37
|
* * bSphereRadiusFactor (optional float, default 1.0) : a number to multiply the bounding sphere radius by in order to reduce it for instance.
|
|
38
|
+
* * computeBoundingBox (optional boolean, default false): if the bounding box of the entire SPS will be computed (for occlusion detection, for example). If it is false, the bounding box will be the bounding box of the first particle.
|
|
38
39
|
* @param options.updatable
|
|
39
40
|
* @param options.isPickable
|
|
40
41
|
* @param options.enableDepthSort
|
|
@@ -44,6 +45,7 @@ var SolidParticleSystem = /** @class */ (function () {
|
|
|
44
45
|
* @param options.expandable
|
|
45
46
|
* @param options.useModelMaterial
|
|
46
47
|
* @param options.enableMultiMaterial
|
|
48
|
+
* @param options.computeBoundingBox
|
|
47
49
|
* @example bSphereRadiusFactor = 1.0 / Math.sqrt(3.0) => the bounding sphere exactly matches a spherical mesh.
|
|
48
50
|
*/
|
|
49
51
|
function SolidParticleSystem(name, scene, options) {
|
|
@@ -127,6 +129,7 @@ var SolidParticleSystem = /** @class */ (function () {
|
|
|
127
129
|
this._particlesIntersect = options ? options.particleIntersection : false;
|
|
128
130
|
this._bSphereOnly = options ? options.boundingSphereOnly : false;
|
|
129
131
|
this._bSphereRadiusFactor = options && options.bSphereRadiusFactor ? options.bSphereRadiusFactor : 1.0;
|
|
132
|
+
this._computeBoundingBox = (options === null || options === void 0 ? void 0 : options.computeBoundingBox) ? options.computeBoundingBox : false;
|
|
130
133
|
if (options && options.updatable !== undefined) {
|
|
131
134
|
this._updatable = options.updatable;
|
|
132
135
|
}
|