@babylonjs/core 6.29.0 → 6.29.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.
- package/Actions/abstractActionManager.js +1 -1
- package/Actions/abstractActionManager.js.map +1 -1
- package/Actions/actionManager.js +3 -3
- package/Actions/actionManager.js.map +1 -1
- package/Animations/animatable.js +1 -1
- package/Animations/animatable.js.map +1 -1
- package/Animations/animation.js +2 -2
- package/Animations/animation.js.map +1 -1
- package/Animations/pathCursor.js +1 -1
- package/Animations/pathCursor.js.map +1 -1
- package/Audio/audioSceneComponent.js +2 -2
- package/Audio/audioSceneComponent.js.map +1 -1
- package/Audio/soundTrack.js +1 -1
- package/Audio/soundTrack.js.map +1 -1
- package/Behaviors/Meshes/fadeInOutBehavior.js +1 -2
- package/Behaviors/Meshes/fadeInOutBehavior.js.map +1 -1
- package/Bones/bone.js +2 -2
- package/Bones/bone.js.map +1 -1
- package/Bones/skeleton.js +2 -2
- package/Bones/skeleton.js.map +1 -1
- package/Cameras/arcRotateCamera.js +13 -37
- package/Cameras/arcRotateCamera.js.map +1 -1
- package/Cameras/camera.d.ts +0 -21
- package/Cameras/camera.js +1 -36
- package/Cameras/camera.js.map +1 -1
- package/Cameras/targetCamera.js +30 -51
- package/Cameras/targetCamera.js.map +1 -1
- package/Culling/Octrees/octree.js +1 -1
- package/Culling/Octrees/octree.js.map +1 -1
- package/Culling/Octrees/octreeBlock.js +1 -1
- package/Culling/Octrees/octreeBlock.js.map +1 -1
- package/Culling/ray.js +1 -1
- package/Culling/ray.js.map +1 -1
- package/Debug/axesViewer.d.ts +3 -1
- package/Debug/axesViewer.js +14 -11
- package/Debug/axesViewer.js.map +1 -1
- package/Engines/Extensions/engine.multiRender.js +8 -8
- package/Engines/Extensions/engine.multiRender.js.map +1 -1
- package/Engines/Extensions/engine.textureSelector.js +1 -1
- package/Engines/Extensions/engine.textureSelector.js.map +1 -1
- package/Engines/Processors/shaderCodeInliner.js +1 -1
- package/Engines/Processors/shaderCodeInliner.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.computeShader.js +2 -10
- package/Engines/WebGPU/Extensions/engine.computeShader.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.debugging.js +3 -6
- package/Engines/WebGPU/Extensions/engine.debugging.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.dynamicTexture.js +1 -1
- package/Engines/WebGPU/Extensions/engine.dynamicTexture.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.multiRender.js +9 -14
- package/Engines/WebGPU/Extensions/engine.multiRender.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.query.js +2 -6
- package/Engines/WebGPU/Extensions/engine.query.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.renderTarget.js +6 -10
- package/Engines/WebGPU/Extensions/engine.renderTarget.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.storageBuffer.js +1 -1
- package/Engines/WebGPU/Extensions/engine.storageBuffer.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.videoTexture.js +2 -2
- package/Engines/WebGPU/Extensions/engine.videoTexture.js.map +1 -1
- package/Engines/WebGPU/webgpuBundleList.js +2 -1
- package/Engines/WebGPU/webgpuBundleList.js.map +1 -1
- package/Engines/WebGPU/webgpuCacheBindGroups.js +1 -1
- package/Engines/WebGPU/webgpuCacheBindGroups.js.map +1 -1
- package/Engines/WebGPU/webgpuCacheRenderPipeline.d.ts +1 -1
- package/Engines/WebGPU/webgpuCacheRenderPipeline.js +4 -7
- package/Engines/WebGPU/webgpuCacheRenderPipeline.js.map +1 -1
- package/Engines/WebGPU/webgpuCacheRenderPipelineTree.d.ts +1 -1
- package/Engines/WebGPU/webgpuCacheRenderPipelineTree.js +2 -2
- package/Engines/WebGPU/webgpuCacheRenderPipelineTree.js.map +1 -1
- package/Engines/WebGPU/webgpuCacheSampler.d.ts +1 -1
- package/Engines/WebGPU/webgpuCacheSampler.js +5 -5
- package/Engines/WebGPU/webgpuCacheSampler.js.map +1 -1
- package/Engines/WebGPU/webgpuClearQuad.js +2 -2
- package/Engines/WebGPU/webgpuClearQuad.js.map +1 -1
- package/Engines/WebGPU/webgpuHardwareTexture.d.ts +0 -12
- package/Engines/WebGPU/webgpuHardwareTexture.js.map +1 -1
- package/Engines/WebGPU/webgpuMaterialContext.d.ts +3 -3
- package/Engines/WebGPU/webgpuMaterialContext.js +14 -10
- package/Engines/WebGPU/webgpuMaterialContext.js.map +1 -1
- package/Engines/WebGPU/webgpuOcclusionQuery.js +1 -12
- package/Engines/WebGPU/webgpuOcclusionQuery.js.map +1 -1
- package/Engines/WebGPU/webgpuSnapshotRendering.d.ts +5 -8
- package/Engines/WebGPU/webgpuSnapshotRendering.js +24 -33
- package/Engines/WebGPU/webgpuSnapshotRendering.js.map +1 -1
- package/Engines/WebGPU/webgpuTextureHelper.d.ts +2 -1
- package/Engines/WebGPU/webgpuTextureHelper.js +11 -16
- package/Engines/WebGPU/webgpuTextureHelper.js.map +1 -1
- package/Engines/constants.d.ts +2 -2
- package/Engines/constants.js +2 -2
- package/Engines/constants.js.map +1 -1
- package/Engines/engine.js +2 -2
- package/Engines/engine.js.map +1 -1
- package/Engines/engineCapabilities.d.ts +2 -0
- package/Engines/engineCapabilities.js.map +1 -1
- package/Engines/engineStore.js +1 -1
- package/Engines/engineStore.js.map +1 -1
- package/Engines/nativeEngine.js +1 -0
- package/Engines/nativeEngine.js.map +1 -1
- package/Engines/nullEngine.js +1 -0
- package/Engines/nullEngine.js.map +1 -1
- package/Engines/thinEngine.js +6 -2
- package/Engines/thinEngine.js.map +1 -1
- package/Engines/webgpuEngine.d.ts +27 -32
- package/Engines/webgpuEngine.js +237 -317
- package/Engines/webgpuEngine.js.map +1 -1
- package/Gizmos/boundingBoxGizmo.js +1 -1
- package/Gizmos/boundingBoxGizmo.js.map +1 -1
- package/Gizmos/cameraGizmo.d.ts +3 -1
- package/Gizmos/cameraGizmo.js +11 -8
- package/Gizmos/cameraGizmo.js.map +1 -1
- package/Layers/effectLayerSceneComponent.js +2 -2
- package/Layers/effectLayerSceneComponent.js.map +1 -1
- package/Layers/layerSceneComponent.js +1 -1
- package/Layers/layerSceneComponent.js.map +1 -1
- package/LensFlares/lensFlareSystem.js +1 -1
- package/LensFlares/lensFlareSystem.js.map +1 -1
- package/LensFlares/lensFlareSystemSceneComponent.js +2 -2
- package/LensFlares/lensFlareSystemSceneComponent.js.map +1 -1
- package/Lights/Shadows/shadowGenerator.js +1 -1
- package/Lights/Shadows/shadowGenerator.js.map +1 -1
- package/Lights/light.js +2 -2
- package/Lights/light.js.map +1 -1
- package/Loading/Plugins/babylonFileLoader.js +1 -1
- package/Loading/Plugins/babylonFileLoader.js.map +1 -1
- package/Loading/sceneLoader.js +3 -3
- package/Loading/sceneLoader.js.map +1 -1
- package/Materials/GreasedLine/greasedLineMaterialDefaults.d.ts +2 -2
- package/Materials/GreasedLine/greasedLineMaterialDefaults.js.map +1 -1
- package/Materials/GreasedLine/greasedLineSimpleMaterial.js +4 -1
- package/Materials/GreasedLine/greasedLineSimpleMaterial.js.map +1 -1
- package/Materials/Node/Blocks/Dual/lightBlock.js +1 -1
- package/Materials/Node/Blocks/Dual/lightBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js +1 -1
- package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js.map +1 -1
- package/Materials/Node/nodeMaterial.js +1 -1
- package/Materials/Node/nodeMaterial.js.map +1 -1
- package/Materials/Node/nodeMaterialBlockConnectionPoint.js +2 -2
- package/Materials/Node/nodeMaterialBlockConnectionPoint.js.map +1 -1
- package/Materials/Node/nodeMaterialBuildState.js +4 -4
- package/Materials/Node/nodeMaterialBuildState.js.map +1 -1
- package/Materials/Node/nodeMaterialBuildStateSharedData.js +12 -12
- package/Materials/Node/nodeMaterialBuildStateSharedData.js.map +1 -1
- package/Materials/Textures/Procedurals/proceduralTextureSceneComponent.js +1 -1
- package/Materials/Textures/Procedurals/proceduralTextureSceneComponent.js.map +1 -1
- package/Materials/Textures/baseTexture.js +1 -1
- package/Materials/Textures/baseTexture.js.map +1 -1
- package/Materials/Textures/dynamicTexture.d.ts +4 -3
- package/Materials/Textures/dynamicTexture.js +10 -6
- package/Materials/Textures/dynamicTexture.js.map +1 -1
- package/Materials/Textures/externalTexture.d.ts +4 -0
- package/Materials/Textures/externalTexture.js +4 -0
- package/Materials/Textures/externalTexture.js.map +1 -1
- package/Materials/Textures/internalTexture.d.ts +0 -4
- package/Materials/Textures/internalTexture.js.map +1 -1
- package/Materials/Textures/renderTargetTexture.js +1 -1
- package/Materials/Textures/renderTargetTexture.js.map +1 -1
- package/Materials/Textures/textureSampler.d.ts +4 -0
- package/Materials/Textures/textureSampler.js.map +1 -1
- package/Materials/material.js +1 -1
- package/Materials/material.js.map +1 -1
- package/Materials/multiMaterial.js +1 -1
- package/Materials/multiMaterial.js.map +1 -1
- package/Materials/shaderMaterial.js +1 -1
- package/Materials/shaderMaterial.js.map +1 -1
- package/Maths/math.path.d.ts +9 -1
- package/Maths/math.path.js +23 -7
- package/Maths/math.path.js.map +1 -1
- package/Maths/math.vector.d.ts +93 -0
- package/Maths/math.vector.js +157 -26
- package/Maths/math.vector.js.map +1 -1
- package/Meshes/Builders/cylinderBuilder.js +5 -5
- package/Meshes/Builders/cylinderBuilder.js.map +1 -1
- package/Meshes/Builders/decalBuilder.js +1 -1
- package/Meshes/Builders/decalBuilder.js.map +1 -1
- package/Meshes/Builders/discBuilder.js +4 -4
- package/Meshes/Builders/discBuilder.js.map +1 -1
- package/Meshes/Builders/goldbergBuilder.js +4 -4
- package/Meshes/Builders/goldbergBuilder.js.map +1 -1
- package/Meshes/Builders/groundBuilder.js +4 -4
- package/Meshes/Builders/groundBuilder.js.map +1 -1
- package/Meshes/Builders/icoSphereBuilder.js +4 -4
- package/Meshes/Builders/icoSphereBuilder.js.map +1 -1
- package/Meshes/Builders/latheBuilder.js +1 -1
- package/Meshes/Builders/latheBuilder.js.map +1 -1
- package/Meshes/Builders/linesBuilder.js +2 -2
- package/Meshes/Builders/linesBuilder.js.map +1 -1
- package/Meshes/Builders/polyhedronBuilder.js +6 -6
- package/Meshes/Builders/polyhedronBuilder.js.map +1 -1
- package/Meshes/Builders/shapeBuilder.js +1 -1
- package/Meshes/Builders/shapeBuilder.js.map +1 -1
- package/Meshes/Builders/textBuilder.js +13 -5
- package/Meshes/Builders/textBuilder.js.map +1 -1
- package/Meshes/Builders/torusKnotBuilder.js +4 -4
- package/Meshes/Builders/torusKnotBuilder.js.map +1 -1
- package/Meshes/Node/Blocks/Instances/instantiateOnVerticesBlock.js +1 -1
- package/Meshes/Node/Blocks/Instances/instantiateOnVerticesBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Sources/boxBlock.js +1 -0
- package/Meshes/Node/Blocks/Sources/boxBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Sources/capsuleBlock.js +1 -0
- package/Meshes/Node/Blocks/Sources/capsuleBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Sources/cylinderBlock.js +1 -0
- package/Meshes/Node/Blocks/Sources/cylinderBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Sources/discBlock.js +1 -0
- package/Meshes/Node/Blocks/Sources/discBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Sources/gridBlock.js +1 -0
- package/Meshes/Node/Blocks/Sources/gridBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Sources/icoSphereBlock.js +1 -0
- package/Meshes/Node/Blocks/Sources/icoSphereBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Sources/planeBlock.js +1 -0
- package/Meshes/Node/Blocks/Sources/planeBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Sources/sphereBlock.js +1 -0
- package/Meshes/Node/Blocks/Sources/sphereBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Sources/torusBlock.js +1 -0
- package/Meshes/Node/Blocks/Sources/torusBlock.js.map +1 -1
- package/Meshes/Node/nodeGeometry.js +1 -1
- package/Meshes/Node/nodeGeometry.js.map +1 -1
- package/Meshes/Node/nodeGeometryBlock.js +1 -0
- package/Meshes/Node/nodeGeometryBlock.js.map +1 -1
- package/Meshes/Node/nodeGeometryBlockConnectionPoint.d.ts +14 -0
- package/Meshes/Node/nodeGeometryBlockConnectionPoint.js +32 -5
- package/Meshes/Node/nodeGeometryBlockConnectionPoint.js.map +1 -1
- package/Meshes/abstractMesh.js +5 -5
- package/Meshes/abstractMesh.js.map +1 -1
- package/Meshes/csg.js +5 -5
- package/Meshes/csg.js.map +1 -1
- package/Meshes/geodesicMesh.js +1 -1
- package/Meshes/geodesicMesh.js.map +1 -1
- package/Meshes/mesh.js +14 -10
- package/Meshes/mesh.js.map +1 -1
- package/Meshes/mesh.vertexData.js +1 -1
- package/Meshes/mesh.vertexData.js.map +1 -1
- package/Meshes/meshSimplification.js +2 -2
- package/Meshes/meshSimplification.js.map +1 -1
- package/Meshes/polygonMesh.js +7 -7
- package/Meshes/polygonMesh.js.map +1 -1
- package/Meshes/thinInstanceMesh.js +1 -1
- package/Meshes/thinInstanceMesh.js.map +1 -1
- package/Misc/codeStringParsingTools.d.ts +2 -1
- package/Misc/codeStringParsingTools.js +3 -2
- package/Misc/codeStringParsingTools.js.map +1 -1
- package/Misc/dds.js +1 -1
- package/Misc/dds.js.map +1 -1
- package/Misc/filesInput.js +1 -1
- package/Misc/filesInput.js.map +1 -1
- package/Misc/greasedLineTools.d.ts +2 -1
- package/Misc/greasedLineTools.js +2 -0
- package/Misc/greasedLineTools.js.map +1 -1
- package/Misc/precisionDate.js +4 -2
- package/Misc/precisionDate.js.map +1 -1
- package/Misc/sceneOptimizer.js +2 -2
- package/Misc/sceneOptimizer.js.map +1 -1
- package/Morph/morphTarget.js +1 -1
- package/Morph/morphTarget.js.map +1 -1
- package/Particles/gpuParticleSystem.js +1 -1
- package/Particles/gpuParticleSystem.js.map +1 -1
- package/Particles/particleSystem.js +2 -2
- package/Particles/particleSystem.js.map +1 -1
- package/Particles/particleSystemComponent.js +2 -2
- package/Particles/particleSystemComponent.js.map +1 -1
- package/Particles/particleSystemSet.js +1 -1
- package/Particles/particleSystemSet.js.map +1 -1
- package/Physics/v1/Plugins/cannonJSPlugin.js +2 -2
- package/Physics/v1/Plugins/cannonJSPlugin.js.map +1 -1
- package/Physics/v2/Plugins/havokPlugin.js +3 -1
- package/Physics/v2/Plugins/havokPlugin.js.map +1 -1
- package/PostProcesses/postProcess.d.ts +1 -0
- package/PostProcesses/postProcess.js +30 -23
- package/PostProcesses/postProcess.js.map +1 -1
- package/PostProcesses/volumetricLightScatteringPostProcess.js +2 -2
- package/PostProcesses/volumetricLightScatteringPostProcess.js.map +1 -1
- package/Probes/reflectionProbe.js +1 -1
- package/Probes/reflectionProbe.js.map +1 -1
- package/Rendering/edgesRenderer.js +3 -3
- package/Rendering/edgesRenderer.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderingDepthTextureCopy.js +2 -1
- package/Rendering/fluidRenderer/fluidRenderingDepthTextureCopy.js.map +1 -1
- package/Rendering/prePassRenderer.js +8 -4
- package/Rendering/prePassRenderer.js.map +1 -1
- package/Shaders/ShadersInclude/hdrFilteringFunctions.js +2 -1
- package/Shaders/ShadersInclude/hdrFilteringFunctions.js.map +1 -1
- package/Sprites/spriteManager.js +1 -1
- package/Sprites/spriteManager.js.map +1 -1
- package/Sprites/spriteMap.js +4 -4
- package/Sprites/spriteMap.js.map +1 -1
- package/Sprites/spriteSceneComponent.js +2 -2
- package/Sprites/spriteSceneComponent.js.map +1 -1
- package/XR/features/WebXRFeaturePointSystem.js +2 -2
- package/XR/features/WebXRFeaturePointSystem.js.map +1 -1
- package/abstractScene.js +16 -16
- package/abstractScene.js.map +1 -1
- package/assetContainer.js +2 -2
- package/assetContainer.js.map +1 -1
- package/node.js +2 -2
- package/node.js.map +1 -1
- package/package.json +1 -1
- package/scene.d.ts +0 -4
- package/scene.js +6 -12
- package/scene.js.map +1 -1
- package/Engines/WebGPU/webgpuRenderPassWrapper.d.ts +0 -13
- package/Engines/WebGPU/webgpuRenderPassWrapper.js +0 -18
- package/Engines/WebGPU/webgpuRenderPassWrapper.js.map +0 -1
package/Maths/math.vector.d.ts
CHANGED
|
@@ -293,12 +293,36 @@ export declare class Vector2 {
|
|
|
293
293
|
* @returns the current updated Vector2
|
|
294
294
|
*/
|
|
295
295
|
normalize(): this;
|
|
296
|
+
/**
|
|
297
|
+
* Normalize the current Vector2 with the given input length.
|
|
298
|
+
* Please note that this is an in place operation.
|
|
299
|
+
* @param len the length of the vector
|
|
300
|
+
* @returns the current updated Vector2
|
|
301
|
+
*/
|
|
302
|
+
normalizeFromLength(len: number): this;
|
|
303
|
+
/**
|
|
304
|
+
* Normalize the current Vector2 to a new vector
|
|
305
|
+
* @returns the new Vector2
|
|
306
|
+
*/
|
|
307
|
+
normalizeToNew(): this;
|
|
308
|
+
/**
|
|
309
|
+
* Normalize the current Vector2 to the reference
|
|
310
|
+
* @param reference define the Vector2 to update
|
|
311
|
+
* @returns the updated Vector2
|
|
312
|
+
*/
|
|
313
|
+
normalizeToRef<T extends Vector2>(reference: T): T;
|
|
296
314
|
/**
|
|
297
315
|
* Gets a new Vector2 copied from the Vector2
|
|
298
316
|
* Example Playground https://playground.babylonjs.com/#QYBWV4#20
|
|
299
317
|
* @returns a new Vector2
|
|
300
318
|
*/
|
|
301
319
|
clone(): this;
|
|
320
|
+
/**
|
|
321
|
+
* Gets the dot product of the current vector and the vector "otherVector"
|
|
322
|
+
* @param otherVector defines second vector
|
|
323
|
+
* @returns the dot product (float)
|
|
324
|
+
*/
|
|
325
|
+
dot(otherVector: DeepImmutable<this>): number;
|
|
302
326
|
/**
|
|
303
327
|
* Gets a new Vector2(0, 0)
|
|
304
328
|
* @returns a new Vector2
|
|
@@ -1387,6 +1411,12 @@ export declare class Vector3 {
|
|
|
1387
1411
|
* @returns the dot product
|
|
1388
1412
|
*/
|
|
1389
1413
|
static Dot(left: DeepImmutable<Vector3>, right: DeepImmutable<Vector3>): number;
|
|
1414
|
+
/**
|
|
1415
|
+
* Returns the dot product (float) between the current vectors and "otherVector"
|
|
1416
|
+
* @param otherVector defines the right operand
|
|
1417
|
+
* @returns the dot product
|
|
1418
|
+
*/
|
|
1419
|
+
dot(otherVector: DeepImmutable<this>): number;
|
|
1390
1420
|
/**
|
|
1391
1421
|
* Returns a new Vector3 as the cross product of the vectors "left" and "right"
|
|
1392
1422
|
* The cross product is then orthogonal to both "left" and "right"
|
|
@@ -1870,6 +1900,24 @@ export declare class Vector4 {
|
|
|
1870
1900
|
* @returns the updated Vector4.
|
|
1871
1901
|
*/
|
|
1872
1902
|
normalize(): this;
|
|
1903
|
+
/**
|
|
1904
|
+
* Normalize the current Vector4 with the given input length.
|
|
1905
|
+
* Please note that this is an in place operation.
|
|
1906
|
+
* @param len the length of the vector
|
|
1907
|
+
* @returns the current updated Vector4
|
|
1908
|
+
*/
|
|
1909
|
+
normalizeFromLength(len: number): this;
|
|
1910
|
+
/**
|
|
1911
|
+
* Normalize the current Vector4 to a new vector
|
|
1912
|
+
* @returns the new Vector4
|
|
1913
|
+
*/
|
|
1914
|
+
normalizeToNew(): this;
|
|
1915
|
+
/**
|
|
1916
|
+
* Normalize the current Vector4 to the reference
|
|
1917
|
+
* @param reference define the Vector4 to update
|
|
1918
|
+
* @returns the updated Vector4
|
|
1919
|
+
*/
|
|
1920
|
+
normalizeToRef<T extends Vector4>(reference: T): T;
|
|
1873
1921
|
/**
|
|
1874
1922
|
* Returns a new Vector3 from the Vector4 (x, y, z) coordinates.
|
|
1875
1923
|
* @returns this converted to a new vector3
|
|
@@ -1910,6 +1958,12 @@ export declare class Vector4 {
|
|
|
1910
1958
|
* @returns the current updated Vector3
|
|
1911
1959
|
*/
|
|
1912
1960
|
setAll(v: number): this;
|
|
1961
|
+
/**
|
|
1962
|
+
* Returns the dot product (float) between the current vectors and "otherVector"
|
|
1963
|
+
* @param otherVector defines the right operand
|
|
1964
|
+
* @returns the dot product
|
|
1965
|
+
*/
|
|
1966
|
+
dot(otherVector: DeepImmutable<this>): number;
|
|
1913
1967
|
/**
|
|
1914
1968
|
* Returns a new Vector4 set from the starting index of the given array.
|
|
1915
1969
|
* @param array the array to pull values from
|
|
@@ -2087,6 +2141,13 @@ export declare class Vector4 {
|
|
|
2087
2141
|
* @returns a new Vector4
|
|
2088
2142
|
*/
|
|
2089
2143
|
static FromVector3(source: Vector3, w?: number): Vector4;
|
|
2144
|
+
/**
|
|
2145
|
+
* Returns the dot product (float) between the vectors "left" and "right"
|
|
2146
|
+
* @param left defines the left operand
|
|
2147
|
+
* @param right defines the right operand
|
|
2148
|
+
* @returns the dot product
|
|
2149
|
+
*/
|
|
2150
|
+
static Dot(left: DeepImmutable<Vector4>, right: DeepImmutable<Vector4>): number;
|
|
2090
2151
|
}
|
|
2091
2152
|
/**
|
|
2092
2153
|
* Class used to store quaternion data
|
|
@@ -2331,12 +2392,25 @@ export declare class Quaternion {
|
|
|
2331
2392
|
* @returns the current updated quaternion
|
|
2332
2393
|
*/
|
|
2333
2394
|
normalize(): this;
|
|
2395
|
+
/**
|
|
2396
|
+
* Normalize the current quaternion with the given input length.
|
|
2397
|
+
* Please note that this is an in place operation.
|
|
2398
|
+
* @param len the length of the quaternion
|
|
2399
|
+
* @returns the current updated Quaternion
|
|
2400
|
+
*/
|
|
2401
|
+
normalizeFromLength(len: number): this;
|
|
2334
2402
|
/**
|
|
2335
2403
|
* Normalize a copy of the current quaternion
|
|
2336
2404
|
* Example Playground https://playground.babylonjs.com/#L49EJ7#55
|
|
2337
2405
|
* @returns the normalized quaternion
|
|
2338
2406
|
*/
|
|
2339
2407
|
normalizeToNew(): this;
|
|
2408
|
+
/**
|
|
2409
|
+
* Normalize the current Quaternion to the reference
|
|
2410
|
+
* @param reference define the Quaternion to update
|
|
2411
|
+
* @returns the updated Quaternion
|
|
2412
|
+
*/
|
|
2413
|
+
normalizeToRef<T extends Quaternion>(reference: T): T;
|
|
2340
2414
|
/**
|
|
2341
2415
|
* Returns a new Vector3 set with the Euler angles translated from the current quaternion
|
|
2342
2416
|
* Example Playground https://playground.babylonjs.com/#L49EJ7#32
|
|
@@ -2366,6 +2440,12 @@ export declare class Quaternion {
|
|
|
2366
2440
|
* @returns the current updated quaternion
|
|
2367
2441
|
*/
|
|
2368
2442
|
fromRotationMatrix(matrix: DeepImmutable<Matrix>): this;
|
|
2443
|
+
/**
|
|
2444
|
+
* Returns the dot product (float) between the current quaternions and "other"
|
|
2445
|
+
* @param other defines the right operand
|
|
2446
|
+
* @returns the dot product
|
|
2447
|
+
*/
|
|
2448
|
+
dot(other: DeepImmutable<this>): number;
|
|
2369
2449
|
/**
|
|
2370
2450
|
* Creates a new quaternion from a rotation matrix
|
|
2371
2451
|
* Example Playground https://playground.babylonjs.com/#L49EJ7#101
|
|
@@ -2666,6 +2746,19 @@ export declare class Quaternion {
|
|
|
2666
2746
|
* @returns result input
|
|
2667
2747
|
*/
|
|
2668
2748
|
static Hermite1stDerivativeToRef<T extends Quaternion>(value1: DeepImmutable<Quaternion>, tangent1: DeepImmutable<Quaternion>, value2: DeepImmutable<Quaternion>, tangent2: DeepImmutable<Quaternion>, time: number, result: T): T;
|
|
2749
|
+
/**
|
|
2750
|
+
* Returns a new Quaternion as the normalization of the given Quaternion
|
|
2751
|
+
* @param quat defines the Quaternion to normalize
|
|
2752
|
+
* @returns the new Quaternion
|
|
2753
|
+
*/
|
|
2754
|
+
static Normalize(quat: DeepImmutable<Quaternion>): Quaternion;
|
|
2755
|
+
/**
|
|
2756
|
+
* Sets the given Quaternion "result" with the normalization of the given first Quaternion
|
|
2757
|
+
* @param quat defines the Quaternion to normalize
|
|
2758
|
+
* @param result defines the Quaternion where to store the result
|
|
2759
|
+
* @returns result input
|
|
2760
|
+
*/
|
|
2761
|
+
static NormalizeToRef<T extends Quaternion>(quat: DeepImmutable<Quaternion>, result: T): T;
|
|
2669
2762
|
}
|
|
2670
2763
|
/**
|
|
2671
2764
|
* Class used to store matrix data (4x4)
|
package/Maths/math.vector.js
CHANGED
|
@@ -82,7 +82,7 @@ export class Vector2 {
|
|
|
82
82
|
* @returns a new array with 2 elements: the Vector2 coordinates.
|
|
83
83
|
*/
|
|
84
84
|
asArray() {
|
|
85
|
-
const result =
|
|
85
|
+
const result = [];
|
|
86
86
|
this.toArray(result, 0);
|
|
87
87
|
return result;
|
|
88
88
|
}
|
|
@@ -412,8 +412,40 @@ export class Vector2 {
|
|
|
412
412
|
* @returns the current updated Vector2
|
|
413
413
|
*/
|
|
414
414
|
normalize() {
|
|
415
|
-
|
|
416
|
-
|
|
415
|
+
return this.normalizeFromLength(this.length());
|
|
416
|
+
}
|
|
417
|
+
/**
|
|
418
|
+
* Normalize the current Vector2 with the given input length.
|
|
419
|
+
* Please note that this is an in place operation.
|
|
420
|
+
* @param len the length of the vector
|
|
421
|
+
* @returns the current updated Vector2
|
|
422
|
+
*/
|
|
423
|
+
normalizeFromLength(len) {
|
|
424
|
+
if (len === 0 || len === 1.0) {
|
|
425
|
+
return this;
|
|
426
|
+
}
|
|
427
|
+
return this.scaleInPlace(1.0 / len);
|
|
428
|
+
}
|
|
429
|
+
/**
|
|
430
|
+
* Normalize the current Vector2 to a new vector
|
|
431
|
+
* @returns the new Vector2
|
|
432
|
+
*/
|
|
433
|
+
normalizeToNew() {
|
|
434
|
+
const normalized = new this.constructor(0, 0);
|
|
435
|
+
this.normalizeToRef(normalized);
|
|
436
|
+
return normalized;
|
|
437
|
+
}
|
|
438
|
+
/**
|
|
439
|
+
* Normalize the current Vector2 to the reference
|
|
440
|
+
* @param reference define the Vector2 to update
|
|
441
|
+
* @returns the updated Vector2
|
|
442
|
+
*/
|
|
443
|
+
normalizeToRef(reference) {
|
|
444
|
+
const len = this.length();
|
|
445
|
+
if (len === 0 || len === 1.0) {
|
|
446
|
+
return reference.copyFromFloats(this.x, this.y);
|
|
447
|
+
}
|
|
448
|
+
return this.scaleToRef(1.0 / len, reference);
|
|
417
449
|
}
|
|
418
450
|
/**
|
|
419
451
|
* Gets a new Vector2 copied from the Vector2
|
|
@@ -423,6 +455,14 @@ export class Vector2 {
|
|
|
423
455
|
clone() {
|
|
424
456
|
return new this.constructor(this.x, this.y);
|
|
425
457
|
}
|
|
458
|
+
/**
|
|
459
|
+
* Gets the dot product of the current vector and the vector "otherVector"
|
|
460
|
+
* @param otherVector defines second vector
|
|
461
|
+
* @returns the dot product (float)
|
|
462
|
+
*/
|
|
463
|
+
dot(otherVector) {
|
|
464
|
+
return this.x * otherVector.x + this.y * otherVector.y;
|
|
465
|
+
}
|
|
426
466
|
// Statics
|
|
427
467
|
/**
|
|
428
468
|
* Gets a new Vector2(0, 0)
|
|
@@ -603,9 +643,9 @@ export class Vector2 {
|
|
|
603
643
|
* @returns a new Vector2
|
|
604
644
|
*/
|
|
605
645
|
static Normalize(vector) {
|
|
606
|
-
const
|
|
607
|
-
|
|
608
|
-
return
|
|
646
|
+
const result = new vector.constructor();
|
|
647
|
+
Vector2.NormalizeToRef(vector, result);
|
|
648
|
+
return result;
|
|
609
649
|
}
|
|
610
650
|
/**
|
|
611
651
|
* Normalize a given vector into a second one
|
|
@@ -615,12 +655,7 @@ export class Vector2 {
|
|
|
615
655
|
* @returns result input
|
|
616
656
|
*/
|
|
617
657
|
static NormalizeToRef(vector, result) {
|
|
618
|
-
|
|
619
|
-
if (len === 0) {
|
|
620
|
-
return result;
|
|
621
|
-
}
|
|
622
|
-
result.x = vector.x / len;
|
|
623
|
-
result.y = vector.y / len;
|
|
658
|
+
vector.normalizeToRef(result);
|
|
624
659
|
return result;
|
|
625
660
|
}
|
|
626
661
|
/**
|
|
@@ -2149,6 +2184,14 @@ export class Vector3 {
|
|
|
2149
2184
|
static Dot(left, right) {
|
|
2150
2185
|
return left._x * right._x + left._y * right._y + left._z * right._z;
|
|
2151
2186
|
}
|
|
2187
|
+
/**
|
|
2188
|
+
* Returns the dot product (float) between the current vectors and "otherVector"
|
|
2189
|
+
* @param otherVector defines the right operand
|
|
2190
|
+
* @returns the dot product
|
|
2191
|
+
*/
|
|
2192
|
+
dot(otherVector) {
|
|
2193
|
+
return this._x * otherVector._x + this._y * otherVector._y + this._z * otherVector._z;
|
|
2194
|
+
}
|
|
2152
2195
|
/**
|
|
2153
2196
|
* Returns a new Vector3 as the cross product of the vectors "left" and "right"
|
|
2154
2197
|
* The cross product is then orthogonal to both "left" and "right"
|
|
@@ -2660,7 +2703,7 @@ export class Vector4 {
|
|
|
2660
2703
|
* @returns the resulting array
|
|
2661
2704
|
*/
|
|
2662
2705
|
asArray() {
|
|
2663
|
-
const result =
|
|
2706
|
+
const result = [];
|
|
2664
2707
|
this.toArray(result, 0);
|
|
2665
2708
|
return result;
|
|
2666
2709
|
}
|
|
@@ -3038,12 +3081,41 @@ export class Vector4 {
|
|
|
3038
3081
|
* @returns the updated Vector4.
|
|
3039
3082
|
*/
|
|
3040
3083
|
normalize() {
|
|
3041
|
-
|
|
3042
|
-
|
|
3084
|
+
return this.normalizeFromLength(this.length());
|
|
3085
|
+
}
|
|
3086
|
+
/**
|
|
3087
|
+
* Normalize the current Vector4 with the given input length.
|
|
3088
|
+
* Please note that this is an in place operation.
|
|
3089
|
+
* @param len the length of the vector
|
|
3090
|
+
* @returns the current updated Vector4
|
|
3091
|
+
*/
|
|
3092
|
+
normalizeFromLength(len) {
|
|
3093
|
+
if (len === 0 || len === 1.0) {
|
|
3043
3094
|
return this;
|
|
3044
3095
|
}
|
|
3045
3096
|
return this.scaleInPlace(1.0 / len);
|
|
3046
3097
|
}
|
|
3098
|
+
/**
|
|
3099
|
+
* Normalize the current Vector4 to a new vector
|
|
3100
|
+
* @returns the new Vector4
|
|
3101
|
+
*/
|
|
3102
|
+
normalizeToNew() {
|
|
3103
|
+
const normalized = new this.constructor(0, 0, 0, 0);
|
|
3104
|
+
this.normalizeToRef(normalized);
|
|
3105
|
+
return normalized;
|
|
3106
|
+
}
|
|
3107
|
+
/**
|
|
3108
|
+
* Normalize the current Vector4 to the reference
|
|
3109
|
+
* @param reference define the Vector4 to update
|
|
3110
|
+
* @returns the updated Vector4
|
|
3111
|
+
*/
|
|
3112
|
+
normalizeToRef(reference) {
|
|
3113
|
+
const len = this.length();
|
|
3114
|
+
if (len === 0 || len === 1.0) {
|
|
3115
|
+
return reference.copyFromFloats(this.x, this.y, this.z, this.w);
|
|
3116
|
+
}
|
|
3117
|
+
return this.scaleToRef(1.0 / len, reference);
|
|
3118
|
+
}
|
|
3047
3119
|
/**
|
|
3048
3120
|
* Returns a new Vector3 from the Vector4 (x, y, z) coordinates.
|
|
3049
3121
|
* @returns this converted to a new vector3
|
|
@@ -3105,6 +3177,14 @@ export class Vector4 {
|
|
|
3105
3177
|
this.x = this.y = this.z = this.w = v;
|
|
3106
3178
|
return this;
|
|
3107
3179
|
}
|
|
3180
|
+
/**
|
|
3181
|
+
* Returns the dot product (float) between the current vectors and "otherVector"
|
|
3182
|
+
* @param otherVector defines the right operand
|
|
3183
|
+
* @returns the dot product
|
|
3184
|
+
*/
|
|
3185
|
+
dot(otherVector) {
|
|
3186
|
+
return this.x * otherVector.x + this.y * otherVector.y + this.z * otherVector.z + this.w * otherVector.w;
|
|
3187
|
+
}
|
|
3108
3188
|
// Statics
|
|
3109
3189
|
/**
|
|
3110
3190
|
* Returns a new Vector4 set from the starting index of the given array.
|
|
@@ -3205,8 +3285,7 @@ export class Vector4 {
|
|
|
3205
3285
|
* @returns result input
|
|
3206
3286
|
*/
|
|
3207
3287
|
static NormalizeToRef(vector, result) {
|
|
3208
|
-
|
|
3209
|
-
result.normalize();
|
|
3288
|
+
vector.normalizeToRef(result);
|
|
3210
3289
|
return result;
|
|
3211
3290
|
}
|
|
3212
3291
|
/**
|
|
@@ -3382,6 +3461,15 @@ export class Vector4 {
|
|
|
3382
3461
|
static FromVector3(source, w = 0) {
|
|
3383
3462
|
return new Vector4(source._x, source._y, source._z, w);
|
|
3384
3463
|
}
|
|
3464
|
+
/**
|
|
3465
|
+
* Returns the dot product (float) between the vectors "left" and "right"
|
|
3466
|
+
* @param left defines the left operand
|
|
3467
|
+
* @param right defines the right operand
|
|
3468
|
+
* @returns the dot product
|
|
3469
|
+
*/
|
|
3470
|
+
static Dot(left, right) {
|
|
3471
|
+
return left.dot(right);
|
|
3472
|
+
}
|
|
3385
3473
|
}
|
|
3386
3474
|
Vector4._ZeroReadOnly = Vector4.Zero();
|
|
3387
3475
|
/**
|
|
@@ -3778,13 +3866,19 @@ export class Quaternion {
|
|
|
3778
3866
|
* @returns the current updated quaternion
|
|
3779
3867
|
*/
|
|
3780
3868
|
normalize() {
|
|
3781
|
-
|
|
3782
|
-
|
|
3869
|
+
return this.normalizeFromLength(this.length());
|
|
3870
|
+
}
|
|
3871
|
+
/**
|
|
3872
|
+
* Normalize the current quaternion with the given input length.
|
|
3873
|
+
* Please note that this is an in place operation.
|
|
3874
|
+
* @param len the length of the quaternion
|
|
3875
|
+
* @returns the current updated Quaternion
|
|
3876
|
+
*/
|
|
3877
|
+
normalizeFromLength(len) {
|
|
3878
|
+
if (len === 0 || len === 1.0) {
|
|
3783
3879
|
return this;
|
|
3784
3880
|
}
|
|
3785
|
-
|
|
3786
|
-
this.scaleInPlace(inv);
|
|
3787
|
-
return this;
|
|
3881
|
+
return this.scaleInPlace(1.0 / len);
|
|
3788
3882
|
}
|
|
3789
3883
|
/**
|
|
3790
3884
|
* Normalize a copy of the current quaternion
|
|
@@ -3792,12 +3886,21 @@ export class Quaternion {
|
|
|
3792
3886
|
* @returns the normalized quaternion
|
|
3793
3887
|
*/
|
|
3794
3888
|
normalizeToNew() {
|
|
3889
|
+
const normalized = new this.constructor(0, 0, 0, 1);
|
|
3890
|
+
this.normalizeToRef(normalized);
|
|
3891
|
+
return normalized;
|
|
3892
|
+
}
|
|
3893
|
+
/**
|
|
3894
|
+
* Normalize the current Quaternion to the reference
|
|
3895
|
+
* @param reference define the Quaternion to update
|
|
3896
|
+
* @returns the updated Quaternion
|
|
3897
|
+
*/
|
|
3898
|
+
normalizeToRef(reference) {
|
|
3795
3899
|
const len = this.length();
|
|
3796
|
-
if (len === 0) {
|
|
3797
|
-
return this.
|
|
3900
|
+
if (len === 0 || len === 1.0) {
|
|
3901
|
+
return reference.copyFromFloats(this._x, this._y, this._z, this._w);
|
|
3798
3902
|
}
|
|
3799
|
-
|
|
3800
|
-
return this.scale(inv);
|
|
3903
|
+
return this.scaleToRef(1.0 / len, reference);
|
|
3801
3904
|
}
|
|
3802
3905
|
/**
|
|
3803
3906
|
* Returns a new Vector3 set with the Euler angles translated from the current quaternion
|
|
@@ -3868,6 +3971,14 @@ export class Quaternion {
|
|
|
3868
3971
|
Quaternion.FromRotationMatrixToRef(matrix, this);
|
|
3869
3972
|
return this;
|
|
3870
3973
|
}
|
|
3974
|
+
/**
|
|
3975
|
+
* Returns the dot product (float) between the current quaternions and "other"
|
|
3976
|
+
* @param other defines the right operand
|
|
3977
|
+
* @returns the dot product
|
|
3978
|
+
*/
|
|
3979
|
+
dot(other) {
|
|
3980
|
+
return this._x * other._x + this._y * other._y + this._z * other._z + this._w * other._w;
|
|
3981
|
+
}
|
|
3871
3982
|
// Statics
|
|
3872
3983
|
/**
|
|
3873
3984
|
* Creates a new quaternion from a rotation matrix
|
|
@@ -4401,6 +4512,26 @@ export class Quaternion {
|
|
|
4401
4512
|
result._isDirty = true;
|
|
4402
4513
|
return result;
|
|
4403
4514
|
}
|
|
4515
|
+
/**
|
|
4516
|
+
* Returns a new Quaternion as the normalization of the given Quaternion
|
|
4517
|
+
* @param quat defines the Quaternion to normalize
|
|
4518
|
+
* @returns the new Quaternion
|
|
4519
|
+
*/
|
|
4520
|
+
static Normalize(quat) {
|
|
4521
|
+
const result = Quaternion.Zero();
|
|
4522
|
+
Quaternion.NormalizeToRef(quat, result);
|
|
4523
|
+
return result;
|
|
4524
|
+
}
|
|
4525
|
+
/**
|
|
4526
|
+
* Sets the given Quaternion "result" with the normalization of the given first Quaternion
|
|
4527
|
+
* @param quat defines the Quaternion to normalize
|
|
4528
|
+
* @param result defines the Quaternion where to store the result
|
|
4529
|
+
* @returns result input
|
|
4530
|
+
*/
|
|
4531
|
+
static NormalizeToRef(quat, result) {
|
|
4532
|
+
quat.normalizeToRef(result);
|
|
4533
|
+
return result;
|
|
4534
|
+
}
|
|
4404
4535
|
}
|
|
4405
4536
|
/**
|
|
4406
4537
|
* Class used to store matrix data (4x4)
|