@babylonjs/core 5.22.1 → 5.24.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/Actions/abstractActionManager.d.ts +6 -6
- package/Actions/abstractActionManager.js +1 -1
- package/Actions/abstractActionManager.js.map +1 -1
- package/Actions/actionManager.d.ts +5 -5
- package/Actions/actionManager.js +5 -5
- package/Actions/actionManager.js.map +1 -1
- package/Animations/animatable.js +2 -1
- package/Animations/animatable.js.map +1 -1
- package/Animations/animation.js +137 -139
- package/Animations/animation.js.map +1 -1
- package/Animations/animationGroup.d.ts +3 -3
- package/Animations/animationGroup.js +3 -3
- package/Animations/animationGroup.js.map +1 -1
- package/Animations/runtimeAnimation.js +6 -7
- package/Animations/runtimeAnimation.js.map +1 -1
- package/Audio/audioSceneComponent.d.ts +1 -1
- package/Audio/audioSceneComponent.js.map +1 -1
- package/Audio/sound.d.ts +2 -1
- package/Audio/sound.js +21 -9
- package/Audio/sound.js.map +1 -1
- package/Behaviors/Cameras/autoRotationBehavior.d.ts +1 -1
- package/Behaviors/Cameras/autoRotationBehavior.js +1 -1
- package/Behaviors/Cameras/autoRotationBehavior.js.map +1 -1
- package/Behaviors/Cameras/bouncingBehavior.d.ts +1 -1
- package/Behaviors/Cameras/bouncingBehavior.js +1 -1
- package/Behaviors/Cameras/bouncingBehavior.js.map +1 -1
- package/Behaviors/Cameras/framingBehavior.d.ts +1 -1
- package/Behaviors/Cameras/framingBehavior.js +1 -1
- package/Behaviors/Cameras/framingBehavior.js.map +1 -1
- package/Bones/bone.d.ts +1 -1
- package/Bones/bone.js +1 -1
- package/Bones/bone.js.map +1 -1
- package/Bones/skeleton.d.ts +2 -2
- package/Bones/skeleton.js +11 -5
- package/Bones/skeleton.js.map +1 -1
- package/Cameras/Inputs/BaseCameraMouseWheelInput.js +3 -22
- package/Cameras/Inputs/BaseCameraMouseWheelInput.js.map +1 -1
- package/Cameras/Inputs/BaseCameraPointersInput.js +3 -3
- package/Cameras/Inputs/BaseCameraPointersInput.js.map +1 -1
- package/Cameras/Inputs/arcRotateCameraMouseWheelInput.js +1 -11
- package/Cameras/Inputs/arcRotateCameraMouseWheelInput.js.map +1 -1
- package/Cameras/Inputs/flyCameraMouseInput.js +3 -3
- package/Cameras/Inputs/flyCameraMouseInput.js.map +1 -1
- package/Cameras/Inputs/followCameraMouseWheelInput.js +1 -4
- package/Cameras/Inputs/followCameraMouseWheelInput.js.map +1 -1
- package/Cameras/Inputs/freeCameraMouseInput.js +3 -3
- package/Cameras/Inputs/freeCameraMouseInput.js.map +1 -1
- package/Cameras/arcRotateCamera.d.ts +1 -1
- package/Cameras/arcRotateCamera.js +1 -1
- package/Cameras/arcRotateCamera.js.map +1 -1
- package/Cameras/camera.d.ts +2 -2
- package/Cameras/camera.js +2 -2
- package/Cameras/camera.js.map +1 -1
- package/Cameras/freeCamera.d.ts +1 -1
- package/Cameras/freeCamera.js +1 -1
- package/Cameras/freeCamera.js.map +1 -1
- package/Cameras/gamepadCamera.d.ts +1 -1
- package/Cameras/gamepadCamera.js +1 -1
- package/Cameras/gamepadCamera.js.map +1 -1
- package/Cameras/targetCamera.d.ts +1 -1
- package/Cameras/targetCamera.js +1 -1
- package/Cameras/targetCamera.js.map +1 -1
- package/Cameras/touchCamera.d.ts +1 -1
- package/Cameras/touchCamera.js +1 -1
- package/Cameras/touchCamera.js.map +1 -1
- package/Cameras/universalCamera.d.ts +1 -1
- package/Cameras/universalCamera.js +1 -1
- package/Cameras/universalCamera.js.map +1 -1
- package/Cameras/virtualJoysticksCamera.d.ts +1 -1
- package/Cameras/virtualJoysticksCamera.js +1 -1
- package/Cameras/virtualJoysticksCamera.js.map +1 -1
- package/Culling/boundingBox.d.ts +2 -2
- package/Culling/boundingBox.js +2 -2
- package/Culling/boundingBox.js.map +1 -1
- package/Culling/ray.d.ts +1 -1
- package/Culling/ray.js +1 -1
- package/Culling/ray.js.map +1 -1
- package/Debug/debugLayer.d.ts +1 -1
- package/Debug/debugLayer.js +1 -1
- package/Debug/debugLayer.js.map +1 -1
- package/DeviceInput/webDeviceInputSystem.js +20 -2
- package/DeviceInput/webDeviceInputSystem.js.map +1 -1
- package/Engines/Extensions/engine.multiRender.js +8 -10
- package/Engines/Extensions/engine.multiRender.js.map +1 -1
- package/Engines/Extensions/engine.query.d.ts +2 -2
- package/Engines/Extensions/engine.query.js.map +1 -1
- package/Engines/ICanvas.d.ts +11 -0
- package/Engines/ICanvas.js.map +1 -1
- package/Engines/WebGL/webGLPipelineContext.d.ts +29 -19
- package/Engines/WebGL/webGLPipelineContext.js +99 -311
- package/Engines/WebGL/webGLPipelineContext.js.map +1 -1
- package/Engines/WebGL/webGLRenderTargetWrapper.js +1 -1
- package/Engines/WebGL/webGLRenderTargetWrapper.js.map +1 -1
- package/Engines/engine.d.ts +2 -2
- package/Engines/engine.js +2 -2
- package/Engines/engine.js.map +1 -1
- package/Engines/nativeEngine.d.ts +2 -2
- package/Engines/nativeEngine.js +2 -2
- package/Engines/nativeEngine.js.map +1 -1
- package/Engines/renderTargetWrapper.d.ts +1 -0
- package/Engines/renderTargetWrapper.js +5 -2
- package/Engines/renderTargetWrapper.js.map +1 -1
- package/Engines/thinEngine.d.ts +6 -5
- package/Engines/thinEngine.js +11 -7
- package/Engines/thinEngine.js.map +1 -1
- package/Engines/webgpuEngine.js +4 -1
- package/Engines/webgpuEngine.js.map +1 -1
- package/Events/clipboardEvents.d.ts +1 -1
- package/Events/clipboardEvents.js +1 -1
- package/Events/clipboardEvents.js.map +1 -1
- package/Events/deviceInputEvents.d.ts +11 -4
- package/Events/deviceInputEvents.js.map +1 -1
- package/Gamepads/Controllers/windowsMotionController.d.ts +1 -1
- package/Gamepads/Controllers/windowsMotionController.js +1 -1
- package/Gamepads/Controllers/windowsMotionController.js.map +1 -1
- package/Gizmos/boundingBoxGizmo.d.ts +4 -0
- package/Gizmos/boundingBoxGizmo.js +6 -0
- package/Gizmos/boundingBoxGizmo.js.map +1 -1
- package/Inputs/scene.inputManager.js +4 -4
- package/Inputs/scene.inputManager.js.map +1 -1
- package/Layers/effectLayer.d.ts +3 -3
- package/Layers/effectLayer.js +1 -1
- package/Layers/effectLayer.js.map +1 -1
- package/Layers/glowLayer.d.ts +3 -3
- package/Layers/glowLayer.js +2 -2
- package/Layers/glowLayer.js.map +1 -1
- package/Layers/highlightLayer.d.ts +3 -3
- package/Layers/highlightLayer.js +2 -2
- package/Layers/highlightLayer.js.map +1 -1
- package/Lights/directionalLight.d.ts +2 -2
- package/Lights/directionalLight.js +2 -2
- package/Lights/directionalLight.js.map +1 -1
- package/Lights/hemisphericLight.d.ts +3 -3
- package/Lights/hemisphericLight.js +3 -3
- package/Lights/hemisphericLight.js.map +1 -1
- package/Lights/light.d.ts +2 -2
- package/Lights/light.js +2 -2
- package/Lights/light.js.map +1 -1
- package/Lights/lightConstants.d.ts +1 -1
- package/Lights/lightConstants.js +1 -1
- package/Lights/lightConstants.js.map +1 -1
- package/Loading/Plugins/babylonFileLoader.js +3 -0
- package/Loading/Plugins/babylonFileLoader.js.map +1 -1
- package/Loading/sceneLoader.d.ts +1 -1
- package/Loading/sceneLoader.js.map +1 -1
- package/Materials/Background/backgroundMaterial.js +4 -0
- package/Materials/Background/backgroundMaterial.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/perturbNormalBlock.js +4 -1
- package/Materials/Node/Blocks/Fragment/perturbNormalBlock.js.map +1 -1
- package/Materials/Node/nodeMaterial.d.ts +1 -1
- package/Materials/Node/nodeMaterial.js +5 -1
- package/Materials/Node/nodeMaterial.js.map +1 -1
- package/Materials/PBR/pbrBaseMaterial.js +4 -1
- package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
- package/Materials/Textures/Filtering/hdrFiltering.d.ts +1 -1
- package/Materials/Textures/Filtering/hdrFiltering.js +1 -1
- package/Materials/Textures/Filtering/hdrFiltering.js.map +1 -1
- package/Materials/Textures/Procedurals/customProceduralTexture.d.ts +2 -1
- package/Materials/Textures/Procedurals/customProceduralTexture.js +9 -3
- package/Materials/Textures/Procedurals/customProceduralTexture.js.map +1 -1
- package/Materials/Textures/Procedurals/proceduralTexture.d.ts +9 -9
- package/Materials/Textures/Procedurals/proceduralTexture.js +9 -9
- package/Materials/Textures/Procedurals/proceduralTexture.js.map +1 -1
- package/Materials/Textures/colorGradingTexture.d.ts +1 -1
- package/Materials/Textures/colorGradingTexture.js +1 -1
- package/Materials/Textures/colorGradingTexture.js.map +1 -1
- package/Materials/Textures/cubeTexture.d.ts +2 -2
- package/Materials/Textures/cubeTexture.js +2 -2
- package/Materials/Textures/cubeTexture.js.map +1 -1
- package/Materials/Textures/rawCubeTexture.d.ts +1 -1
- package/Materials/Textures/rawCubeTexture.js +1 -1
- package/Materials/Textures/rawCubeTexture.js.map +1 -1
- package/Materials/Textures/renderTargetTexture.d.ts +3 -5
- package/Materials/Textures/renderTargetTexture.js +19 -19
- package/Materials/Textures/renderTargetTexture.js.map +1 -1
- package/Materials/colorCurves.d.ts +3 -3
- package/Materials/colorCurves.js +3 -3
- package/Materials/colorCurves.js.map +1 -1
- package/Materials/effect.d.ts +27 -27
- package/Materials/effect.js +22 -288
- package/Materials/effect.js.map +1 -1
- package/Materials/fresnelParameters.d.ts +1 -1
- package/Materials/fresnelParameters.js +1 -1
- package/Materials/fresnelParameters.js.map +1 -1
- package/Materials/imageProcessingConfiguration.d.ts +4 -4
- package/Materials/imageProcessingConfiguration.js +4 -4
- package/Materials/imageProcessingConfiguration.js.map +1 -1
- package/Materials/shaderMaterial.d.ts +25 -25
- package/Materials/shaderMaterial.js +25 -25
- package/Materials/shaderMaterial.js.map +1 -1
- package/Materials/standardMaterial.js +4 -1
- package/Materials/standardMaterial.js.map +1 -1
- package/Maths/index.d.ts +1 -0
- package/Maths/index.js +1 -0
- package/Maths/index.js.map +1 -1
- package/Maths/math.functions.d.ts +2 -2
- package/Maths/math.functions.js +2 -2
- package/Maths/math.functions.js.map +1 -1
- package/Maths/math.polar.d.ts +77 -0
- package/Maths/math.polar.js +114 -0
- package/Maths/math.polar.js.map +1 -0
- package/Maths/math.scalar.d.ts +2 -2
- package/Maths/math.scalar.js +2 -2
- package/Maths/math.scalar.js.map +1 -1
- package/Maths/math.vector.d.ts +13 -12
- package/Maths/math.vector.js +13 -12
- package/Maths/math.vector.js.map +1 -1
- package/Meshes/abstractMesh.d.ts +1 -1
- package/Meshes/abstractMesh.js +13 -2
- package/Meshes/abstractMesh.js.map +1 -1
- package/Meshes/geometry.d.ts +3 -3
- package/Meshes/geometry.js +3 -3
- package/Meshes/geometry.js.map +1 -1
- package/Meshes/groundMesh.d.ts +5 -4
- package/Meshes/groundMesh.js +5 -4
- package/Meshes/groundMesh.js.map +1 -1
- package/Meshes/instancedMesh.d.ts +1 -1
- package/Meshes/instancedMesh.js +1 -1
- package/Meshes/instancedMesh.js.map +1 -1
- package/Meshes/mesh.d.ts +3 -3
- package/Meshes/mesh.js +7 -3
- package/Meshes/mesh.js.map +1 -1
- package/Meshes/subMesh.d.ts +1 -1
- package/Meshes/subMesh.js +1 -1
- package/Meshes/subMesh.js.map +1 -1
- package/Meshes/thinInstanceMesh.d.ts +1 -1
- package/Meshes/thinInstanceMesh.js.map +1 -1
- package/Meshes/transformNode.js +6 -0
- package/Meshes/transformNode.js.map +1 -1
- package/Misc/HighDynamicRange/cubemapToSphericalPolynomial.d.ts +2 -2
- package/Misc/HighDynamicRange/cubemapToSphericalPolynomial.js +2 -2
- package/Misc/HighDynamicRange/cubemapToSphericalPolynomial.js.map +1 -1
- package/Misc/HighDynamicRange/hdr.d.ts +3 -3
- package/Misc/HighDynamicRange/hdr.js +3 -3
- package/Misc/HighDynamicRange/hdr.js.map +1 -1
- package/Misc/HighDynamicRange/panoramaToCubemap.d.ts +1 -1
- package/Misc/HighDynamicRange/panoramaToCubemap.js +1 -1
- package/Misc/HighDynamicRange/panoramaToCubemap.js.map +1 -1
- package/Misc/arrayTools.d.ts +13 -12
- package/Misc/arrayTools.js +70 -39
- package/Misc/arrayTools.js.map +1 -1
- package/Misc/assetsManager.d.ts +3 -3
- package/Misc/assetsManager.js +3 -3
- package/Misc/assetsManager.js.map +1 -1
- package/Misc/basis.js +17 -3
- package/Misc/basis.js.map +1 -1
- package/Misc/environmentTextureTools.d.ts +4 -4
- package/Misc/environmentTextureTools.js +5 -5
- package/Misc/environmentTextureTools.js.map +1 -1
- package/Misc/fileTools.d.ts +3 -3
- package/Misc/fileTools.js +19 -12
- package/Misc/fileTools.js.map +1 -1
- package/Misc/logger.js +1 -1
- package/Misc/logger.js.map +1 -1
- package/Misc/observable.d.ts +1 -1
- package/Misc/observable.js +1 -1
- package/Misc/observable.js.map +1 -1
- package/Misc/performanceMonitor.d.ts +3 -3
- package/Misc/performanceMonitor.js +3 -3
- package/Misc/performanceMonitor.js.map +1 -1
- package/Misc/rgbdTextureTools.d.ts +1 -1
- package/Misc/rgbdTextureTools.js +1 -1
- package/Misc/rgbdTextureTools.js.map +1 -1
- package/Misc/sceneOptimizer.d.ts +7 -7
- package/Misc/sceneOptimizer.js +7 -7
- package/Misc/sceneOptimizer.js.map +1 -1
- package/Misc/stringDictionary.d.ts +6 -6
- package/Misc/stringDictionary.js +6 -6
- package/Misc/stringDictionary.js.map +1 -1
- package/Misc/textureTools.d.ts +4 -4
- package/Misc/textureTools.js +4 -4
- package/Misc/textureTools.js.map +1 -1
- package/Misc/tools.d.ts +6 -6
- package/Misc/tools.js +6 -6
- package/Misc/tools.js.map +1 -1
- package/Misc/videoRecorder.d.ts +1 -1
- package/Misc/videoRecorder.js +1 -1
- package/Misc/videoRecorder.js.map +1 -1
- package/Offline/database.js +3 -3
- package/Offline/database.js.map +1 -1
- package/Particles/IParticleSystem.d.ts +1 -1
- package/Particles/IParticleSystem.js.map +1 -1
- package/Particles/gpuParticleSystem.d.ts +1 -1
- package/Particles/gpuParticleSystem.js +1 -1
- package/Particles/gpuParticleSystem.js.map +1 -1
- package/Particles/particleSystem.d.ts +1 -1
- package/Particles/particleSystem.js +1 -1
- package/Particles/particleSystem.js.map +1 -1
- package/Particles/solidParticleSystem.d.ts +4 -0
- package/Particles/solidParticleSystem.js +25 -3
- package/Particles/solidParticleSystem.js.map +1 -1
- package/Physics/Plugins/ammoJSPlugin.d.ts +1 -1
- package/Physics/Plugins/ammoJSPlugin.js +1 -1
- package/Physics/Plugins/ammoJSPlugin.js.map +1 -1
- package/Physics/Plugins/oimoJSPlugin.js +1 -1
- package/Physics/Plugins/oimoJSPlugin.js.map +1 -1
- package/Physics/physicsEngineComponent.d.ts +1 -1
- package/Physics/physicsEngineComponent.js +1 -1
- package/Physics/physicsEngineComponent.js.map +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.js +3 -3
- package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.js.map +1 -1
- package/PostProcesses/RenderPipeline/postProcessRenderPipeline.js +1 -2
- package/PostProcesses/RenderPipeline/postProcessRenderPipeline.js.map +1 -1
- package/PostProcesses/blurPostProcess.d.ts +3 -3
- package/PostProcesses/blurPostProcess.js +3 -3
- package/PostProcesses/blurPostProcess.js.map +1 -1
- package/PostProcesses/volumetricLightScatteringPostProcess.d.ts +3 -3
- package/PostProcesses/volumetricLightScatteringPostProcess.js +3 -3
- package/PostProcesses/volumetricLightScatteringPostProcess.js.map +1 -1
- package/Rendering/depthPeelingRenderer.d.ts +1 -0
- package/Rendering/depthPeelingRenderer.js +32 -5
- package/Rendering/depthPeelingRenderer.js.map +1 -1
- package/Rendering/edgesRenderer.d.ts +2 -2
- package/Rendering/edgesRenderer.js +1 -1
- package/Rendering/edgesRenderer.js.map +1 -1
- package/Rendering/geometryBufferRenderer.d.ts +4 -2
- package/Rendering/geometryBufferRenderer.js +5 -3
- package/Rendering/geometryBufferRenderer.js.map +1 -1
- package/Rendering/geometryBufferRendererSceneComponent.d.ts +2 -1
- package/Rendering/geometryBufferRendererSceneComponent.js +3 -2
- package/Rendering/geometryBufferRendererSceneComponent.js.map +1 -1
- package/Rendering/prePassRenderer.d.ts +11 -3
- package/Rendering/prePassRenderer.js +18 -3
- package/Rendering/prePassRenderer.js.map +1 -1
- package/Rendering/subSurfaceConfiguration.d.ts +2 -2
- package/Rendering/subSurfaceConfiguration.js +2 -2
- package/Rendering/subSurfaceConfiguration.js.map +1 -1
- package/Sprites/spriteSceneComponent.js +4 -1
- package/Sprites/spriteSceneComponent.js.map +1 -1
- package/XR/features/WebXRControllerTeleportation.d.ts +4 -0
- package/XR/features/WebXRControllerTeleportation.js +24 -19
- package/XR/features/WebXRControllerTeleportation.js.map +1 -1
- package/XR/motionController/webXRAbstractMotionController.d.ts +2 -2
- package/XR/motionController/webXRAbstractMotionController.js +2 -2
- package/XR/motionController/webXRAbstractMotionController.js.map +1 -1
- package/XR/motionController/webXRControllerComponent.d.ts +1 -1
- package/XR/motionController/webXRControllerComponent.js +1 -1
- package/XR/motionController/webXRControllerComponent.js.map +1 -1
- package/XR/motionController/webXRMotionControllerManager.d.ts +3 -3
- package/XR/motionController/webXRMotionControllerManager.js +3 -3
- package/XR/motionController/webXRMotionControllerManager.js.map +1 -1
- package/node.d.ts +4 -4
- package/node.js +3 -3
- package/node.js.map +1 -1
- package/package.json +1 -1
- package/readme.md +0 -4
- package/scene.d.ts +80 -63
- package/scene.js +92 -46
- package/scene.js.map +1 -1
- package/sceneComponent.d.ts +1 -1
- package/sceneComponent.js.map +1 -1
|
@@ -121,6 +121,7 @@ export declare class SolidParticleSystem implements IDisposable {
|
|
|
121
121
|
private _computeParticleRotation;
|
|
122
122
|
private _computeParticleVertex;
|
|
123
123
|
private _computeBoundingBox;
|
|
124
|
+
private _autoFixFaceOrientation;
|
|
124
125
|
private _depthSortParticles;
|
|
125
126
|
private _camera;
|
|
126
127
|
private _mustUnrotateFixedNormals;
|
|
@@ -157,6 +158,7 @@ export declare class SolidParticleSystem implements IDisposable {
|
|
|
157
158
|
* * boundingSphereOnly (optional boolean, default false) : if the particle intersection must be computed only with the bounding sphere (no bounding box computation, so faster).
|
|
158
159
|
* * bSphereRadiusFactor (optional float, default 1.0) : a number to multiply the bounding sphere radius by in order to reduce it for instance.
|
|
159
160
|
* * 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.
|
|
161
|
+
* * autoFixFaceOrientation (optional boolean, default false): if the particle face orientations will be flipped for transformations that change orientation (scale (-1, 1, 1), for example)
|
|
160
162
|
* @param options.updatable
|
|
161
163
|
* @param options.isPickable
|
|
162
164
|
* @param options.enableDepthSort
|
|
@@ -167,6 +169,7 @@ export declare class SolidParticleSystem implements IDisposable {
|
|
|
167
169
|
* @param options.useModelMaterial
|
|
168
170
|
* @param options.enableMultiMaterial
|
|
169
171
|
* @param options.computeBoundingBox
|
|
172
|
+
* @param options.autoFixFaceOrientation
|
|
170
173
|
* @example bSphereRadiusFactor = 1.0 / Math.sqrt(3.0) => the bounding sphere exactly matches a spherical mesh.
|
|
171
174
|
*/
|
|
172
175
|
constructor(name: string, scene: Scene, options?: {
|
|
@@ -180,6 +183,7 @@ export declare class SolidParticleSystem implements IDisposable {
|
|
|
180
183
|
useModelMaterial?: boolean;
|
|
181
184
|
enableMultiMaterial?: boolean;
|
|
182
185
|
computeBoundingBox?: boolean;
|
|
186
|
+
autoFixFaceOrientation?: boolean;
|
|
183
187
|
});
|
|
184
188
|
/**
|
|
185
189
|
* Builds the SPS underlying mesh. Returns a standard Mesh.
|
|
@@ -36,6 +36,7 @@ export class SolidParticleSystem {
|
|
|
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
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.
|
|
39
|
+
* * autoFixFaceOrientation (optional boolean, default false): if the particle face orientations will be flipped for transformations that change orientation (scale (-1, 1, 1), for example)
|
|
39
40
|
* @param options.updatable
|
|
40
41
|
* @param options.isPickable
|
|
41
42
|
* @param options.enableDepthSort
|
|
@@ -46,6 +47,7 @@ export class SolidParticleSystem {
|
|
|
46
47
|
* @param options.useModelMaterial
|
|
47
48
|
* @param options.enableMultiMaterial
|
|
48
49
|
* @param options.computeBoundingBox
|
|
50
|
+
* @param options.autoFixFaceOrientation
|
|
49
51
|
* @example bSphereRadiusFactor = 1.0 / Math.sqrt(3.0) => the bounding sphere exactly matches a spherical mesh.
|
|
50
52
|
*/
|
|
51
53
|
constructor(name, scene, options) {
|
|
@@ -105,6 +107,7 @@ export class SolidParticleSystem {
|
|
|
105
107
|
this._computeParticleRotation = true;
|
|
106
108
|
this._computeParticleVertex = false;
|
|
107
109
|
this._computeBoundingBox = false;
|
|
110
|
+
this._autoFixFaceOrientation = false;
|
|
108
111
|
this._depthSortParticles = true;
|
|
109
112
|
this._mustUnrotateFixedNormals = false;
|
|
110
113
|
this._particlesIntersect = false;
|
|
@@ -131,6 +134,7 @@ export class SolidParticleSystem {
|
|
|
131
134
|
this._bSphereOnly = options ? options.boundingSphereOnly : false;
|
|
132
135
|
this._bSphereRadiusFactor = options && options.bSphereRadiusFactor ? options.bSphereRadiusFactor : 1.0;
|
|
133
136
|
this._computeBoundingBox = options?.computeBoundingBox ? options.computeBoundingBox : false;
|
|
137
|
+
this._autoFixFaceOrientation = options?.autoFixFaceOrientation ? options.autoFixFaceOrientation : false;
|
|
134
138
|
if (options && options.updatable !== undefined) {
|
|
135
139
|
this._updatable = options.updatable;
|
|
136
140
|
}
|
|
@@ -218,7 +222,7 @@ export class SolidParticleSystem {
|
|
|
218
222
|
}
|
|
219
223
|
if (!this._expandable) {
|
|
220
224
|
// free memory
|
|
221
|
-
if (!this._depthSort && !this._multimaterialEnabled) {
|
|
225
|
+
if (!this._depthSort && !this._multimaterialEnabled && !this._autoFixFaceOrientation) {
|
|
222
226
|
this._indices = null;
|
|
223
227
|
}
|
|
224
228
|
this._positions = null;
|
|
@@ -865,6 +869,7 @@ export class SolidParticleSystem {
|
|
|
865
869
|
const indices32 = this._indices32;
|
|
866
870
|
const indices = this._indices;
|
|
867
871
|
const fixedNormal32 = this._fixedNormal32;
|
|
872
|
+
const depthSortParticles = this._depthSort && this._depthSortParticles;
|
|
868
873
|
const tempVectors = TmpVectors.Vector3;
|
|
869
874
|
const camAxisX = tempVectors[5].copyFromFloats(1.0, 0.0, 0.0);
|
|
870
875
|
const camAxisY = tempVectors[6].copyFromFloats(0.0, 1.0, 0.0);
|
|
@@ -938,7 +943,7 @@ export class SolidParticleSystem {
|
|
|
938
943
|
const particleScaling = particle.scaling;
|
|
939
944
|
const particleGlobalPosition = particle._globalPosition;
|
|
940
945
|
// camera-particle distance for depth sorting
|
|
941
|
-
if (
|
|
946
|
+
if (depthSortParticles) {
|
|
942
947
|
const dsp = this.depthSortedParticles[p];
|
|
943
948
|
dsp.idx = particle.idx;
|
|
944
949
|
dsp.ind = particle._ind;
|
|
@@ -1200,7 +1205,7 @@ export class SolidParticleSystem {
|
|
|
1200
1205
|
}
|
|
1201
1206
|
}
|
|
1202
1207
|
}
|
|
1203
|
-
if (
|
|
1208
|
+
if (depthSortParticles) {
|
|
1204
1209
|
const depthSortedParticles = this.depthSortedParticles;
|
|
1205
1210
|
depthSortedParticles.sort(this._depthSortFunction);
|
|
1206
1211
|
const dspl = depthSortedParticles.length;
|
|
@@ -1224,6 +1229,23 @@ export class SolidParticleSystem {
|
|
|
1224
1229
|
}
|
|
1225
1230
|
}
|
|
1226
1231
|
}
|
|
1232
|
+
}
|
|
1233
|
+
if (this._autoFixFaceOrientation) {
|
|
1234
|
+
let particleInd = 0;
|
|
1235
|
+
for (let particleIdx = 0; particleIdx < this.particles.length; particleIdx++) {
|
|
1236
|
+
const particle = depthSortParticles ? this.particles[this.depthSortedParticles[particleIdx].idx] : this.particles[particleIdx];
|
|
1237
|
+
const flipFaces = particle.scale.x * particle.scale.y * particle.scale.z < 0;
|
|
1238
|
+
if (flipFaces) {
|
|
1239
|
+
for (let faceInd = 0; faceInd < particle._model._indicesLength; faceInd += 3) {
|
|
1240
|
+
const tmp = indices[particle._ind + faceInd];
|
|
1241
|
+
indices32[particleInd + faceInd] = indices[particle._ind + faceInd + 1];
|
|
1242
|
+
indices32[particleInd + faceInd + 1] = tmp;
|
|
1243
|
+
}
|
|
1244
|
+
}
|
|
1245
|
+
particleInd += particle._model._indicesLength;
|
|
1246
|
+
}
|
|
1247
|
+
}
|
|
1248
|
+
if (depthSortParticles || this._autoFixFaceOrientation) {
|
|
1227
1249
|
mesh.updateIndices(indices32);
|
|
1228
1250
|
}
|
|
1229
1251
|
}
|