@onerjs/core 8.42.7 → 8.42.9
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.core.js +1 -1
- package/Animations/animatable.core.js.map +1 -1
- package/Animations/animatorAvatar.js +2 -2
- package/Animations/animatorAvatar.js.map +1 -1
- package/Animations/runtimeAnimation.js +1 -1
- package/Animations/runtimeAnimation.js.map +1 -1
- package/Audio/audioSceneComponent.js +1 -2
- package/Audio/audioSceneComponent.js.map +1 -1
- package/AudioV2/audioUtils.d.ts +23 -0
- package/AudioV2/audioUtils.js +37 -0
- package/AudioV2/audioUtils.js.map +1 -1
- package/AudioV2/webAudio/subNodes/webAudioBusAndSoundSubGraph.js +3 -3
- package/AudioV2/webAudio/subNodes/webAudioBusAndSoundSubGraph.js.map +1 -1
- package/AudioV2/webAudio/webAudioEngine.js +1 -1
- package/AudioV2/webAudio/webAudioEngine.js.map +1 -1
- package/AudioV2/webAudio/webAudioStaticSound.js +3 -2
- package/AudioV2/webAudio/webAudioStaticSound.js.map +1 -1
- package/AudioV2/webAudio/webAudioStreamingSound.js +10 -3
- package/AudioV2/webAudio/webAudioStreamingSound.js.map +1 -1
- package/Behaviors/Meshes/followBehavior.js +1 -1
- package/Behaviors/Meshes/followBehavior.js.map +1 -1
- package/Behaviors/Meshes/pointerDragBehavior.js +1 -1
- package/Behaviors/Meshes/pointerDragBehavior.js.map +1 -1
- package/Bones/boneLookController.js +1 -1
- package/Bones/boneLookController.js.map +1 -1
- package/Buffers/buffer.js +1 -1
- package/Buffers/buffer.js.map +1 -1
- package/Cameras/Inputs/arcRotateCameraMouseWheelInput.js +2 -2
- package/Cameras/Inputs/arcRotateCameraMouseWheelInput.js.map +1 -1
- package/Cameras/camera.js +2 -2
- package/Cameras/camera.js.map +1 -1
- package/Engines/AbstractEngine/abstractEngine.renderPass.js +1 -0
- package/Engines/AbstractEngine/abstractEngine.renderPass.js.map +1 -1
- package/Engines/Extensions/engine.query.js +1 -1
- package/Engines/Extensions/engine.query.js.map +1 -1
- package/Engines/Processors/shaderProcessor.js +2 -3
- package/Engines/Processors/shaderProcessor.js.map +1 -1
- package/Engines/WebGL/webGLRenderTargetWrapper.js +1 -1
- package/Engines/WebGL/webGLRenderTargetWrapper.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.debugging.d.ts +87 -0
- package/Engines/WebGPU/Extensions/engine.debugging.js +123 -31
- package/Engines/WebGPU/Extensions/engine.debugging.js.map +1 -1
- package/Engines/WebGPU/webgpuBufferManager.js +1 -1
- package/Engines/WebGPU/webgpuBufferManager.js.map +1 -1
- package/Engines/WebGPU/webgpuShaderProcessor.js +1 -1
- package/Engines/WebGPU/webgpuShaderProcessor.js.map +1 -1
- package/Engines/WebGPU/webgpuShaderProcessorsGLSL.js +1 -1
- package/Engines/WebGPU/webgpuShaderProcessorsGLSL.js.map +1 -1
- package/Engines/WebGPU/webgpuShaderProcessorsWGSL.js +1 -1
- package/Engines/WebGPU/webgpuShaderProcessorsWGSL.js.map +1 -1
- package/Engines/WebGPU/webgpuTextureManager.js +20 -6
- package/Engines/WebGPU/webgpuTextureManager.js.map +1 -1
- package/Engines/abstractEngine.js +2 -2
- package/Engines/abstractEngine.js.map +1 -1
- package/Engines/engine.common.js +2 -2
- package/Engines/engine.common.js.map +1 -1
- package/Engines/engine.js +0 -1
- package/Engines/engine.js.map +1 -1
- package/Engines/thinEngine.functions.js +1 -1
- package/Engines/thinEngine.functions.js.map +1 -1
- package/Engines/thinEngine.js +4 -5
- package/Engines/thinEngine.js.map +1 -1
- package/Engines/thinNativeEngine.js +2 -5
- package/Engines/thinNativeEngine.js.map +1 -1
- package/Engines/thinWebGPUEngine.d.ts +6 -4
- package/Engines/thinWebGPUEngine.js +49 -25
- package/Engines/thinWebGPUEngine.js.map +1 -1
- package/Engines/webgpuEngine.d.ts +2 -1
- package/Engines/webgpuEngine.js +18 -16
- package/Engines/webgpuEngine.js.map +1 -1
- package/FlowGraph/flowGraph.d.ts +1 -0
- package/FlowGraph/flowGraph.js.map +1 -1
- package/FlowGraph/flowGraphBlock.d.ts +1 -0
- package/FlowGraph/flowGraphBlock.js.map +1 -1
- package/FlowGraph/flowGraphContext.d.ts +1 -0
- package/FlowGraph/flowGraphContext.js.map +1 -1
- package/FlowGraph/flowGraphCoordinator.d.ts +1 -0
- package/FlowGraph/flowGraphCoordinator.js.map +1 -1
- package/FrameGraph/Node/nodeRenderGraph.d.ts +12 -1
- package/FrameGraph/Node/nodeRenderGraph.js +36 -2
- package/FrameGraph/Node/nodeRenderGraph.js.map +1 -1
- package/FrameGraph/Tasks/Layers/baseLayerTask.js +1 -1
- package/FrameGraph/Tasks/Layers/baseLayerTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/ssao2RenderingPipelineTask.js +3 -0
- package/FrameGraph/Tasks/PostProcesses/ssao2RenderingPipelineTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/ssrRenderingPipelineTask.js +3 -0
- package/FrameGraph/Tasks/PostProcesses/ssrRenderingPipelineTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/volumetricLightingTask.d.ts +3 -1
- package/FrameGraph/Tasks/PostProcesses/volumetricLightingTask.js +14 -0
- package/FrameGraph/Tasks/PostProcesses/volumetricLightingTask.js.map +1 -1
- package/FrameGraph/Tasks/Rendering/csmShadowGeneratorTask.d.ts +2 -2
- package/FrameGraph/Tasks/Rendering/csmShadowGeneratorTask.js +20 -14
- package/FrameGraph/Tasks/Rendering/csmShadowGeneratorTask.js.map +1 -1
- package/FrameGraph/Tasks/Rendering/shadowGeneratorTask.d.ts +3 -2
- package/FrameGraph/Tasks/Rendering/shadowGeneratorTask.js +38 -14
- package/FrameGraph/Tasks/Rendering/shadowGeneratorTask.js.map +1 -1
- package/Layers/glowLayer.js +1 -1
- package/Layers/glowLayer.js.map +1 -1
- package/Layers/highlightLayer.js +1 -1
- package/Layers/highlightLayer.js.map +1 -1
- package/Layers/selectionOutlineLayer.js +8 -0
- package/Layers/selectionOutlineLayer.js.map +1 -1
- package/Layers/thinSelectionOutlineLayer.js +15 -0
- package/Layers/thinSelectionOutlineLayer.js.map +1 -1
- package/Lights/Shadows/cascadedShadowGenerator.js +0 -1
- package/Lights/Shadows/cascadedShadowGenerator.js.map +1 -1
- package/Lights/Shadows/shadowGenerator.d.ts +28 -1
- package/Lights/Shadows/shadowGenerator.js +77 -11
- package/Lights/Shadows/shadowGenerator.js.map +1 -1
- package/Lights/lightingVolume.d.ts +1 -0
- package/Lights/lightingVolume.js +10 -2
- package/Lights/lightingVolume.js.map +1 -1
- package/Loading/sceneLoader.js +1 -1
- package/Loading/sceneLoader.js.map +1 -1
- package/Materials/Node/Blocks/Dual/fogBlock.js +1 -1
- package/Materials/Node/Blocks/Dual/fogBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/imageSourceBlock.js +1 -1
- package/Materials/Node/Blocks/Dual/imageSourceBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/sheenBlock.js +1 -2
- package/Materials/Node/Blocks/PBR/sheenBlock.js.map +1 -1
- package/Materials/Node/Blocks/cloudBlock.js +1 -1
- package/Materials/Node/Blocks/cloudBlock.js.map +1 -1
- package/Materials/Node/Blocks/curveBlock.js +2 -3
- package/Materials/Node/Blocks/curveBlock.js.map +1 -1
- package/Materials/Node/nodeMaterial.js +1 -2
- package/Materials/Node/nodeMaterial.js.map +1 -1
- package/Materials/PBR/openpbrMaterial.js +3 -5
- package/Materials/PBR/openpbrMaterial.js.map +1 -1
- package/Materials/PBR/pbrBaseMaterial.js +2 -3
- package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
- package/Materials/Textures/Procedurals/proceduralTexture.js +0 -1
- package/Materials/Textures/Procedurals/proceduralTexture.js.map +1 -1
- package/Materials/Textures/cubeTexture.js +1 -1
- package/Materials/Textures/cubeTexture.js.map +1 -1
- package/Materials/Textures/htmlElementTexture.js +2 -2
- package/Materials/Textures/htmlElementTexture.js.map +1 -1
- package/Materials/Textures/multiRenderTarget.js +1 -1
- package/Materials/Textures/multiRenderTarget.js.map +1 -1
- package/Materials/Textures/renderTargetTexture.js +13 -2
- package/Materials/Textures/renderTargetTexture.js.map +1 -1
- package/Materials/effect.js +2 -1
- package/Materials/effect.js.map +1 -1
- package/Materials/materialHelper.functions.js +1 -1
- package/Materials/materialHelper.functions.js.map +1 -1
- package/Materials/multiMaterial.js +1 -1
- package/Materials/multiMaterial.js.map +1 -1
- package/Materials/standardMaterial.js +1 -2
- package/Materials/standardMaterial.js.map +1 -1
- package/Maths/math.geospatial.d.ts +17 -2
- package/Maths/math.geospatial.functions.d.ts +16 -2
- package/Maths/math.geospatial.functions.js +37 -4
- package/Maths/math.geospatial.functions.js.map +1 -1
- package/Maths/math.geospatial.js.map +1 -1
- package/Maths/math.path.js +1 -1
- package/Maths/math.path.js.map +1 -1
- package/Maths/math.scalar.functions.js +3 -3
- package/Maths/math.scalar.functions.js.map +1 -1
- package/Maths/math.vector.js +1 -1
- package/Maths/math.vector.js.map +1 -1
- package/Meshes/Builders/boxBuilder.js +1 -2
- package/Meshes/Builders/boxBuilder.js.map +1 -1
- package/Meshes/Builders/cylinderBuilder.js +2 -2
- package/Meshes/Builders/cylinderBuilder.js.map +1 -1
- package/Meshes/Builders/decalBuilder.js +1 -2
- package/Meshes/Builders/decalBuilder.js.map +1 -1
- package/Meshes/Builders/latheBuilder.js +2 -2
- package/Meshes/Builders/latheBuilder.js.map +1 -1
- package/Meshes/Builders/linesBuilder.js +11 -15
- package/Meshes/Builders/linesBuilder.js.map +1 -1
- package/Meshes/Builders/polygonBuilder.js +6 -6
- package/Meshes/Builders/polygonBuilder.js.map +1 -1
- package/Meshes/Builders/polyhedronBuilder.js +2 -2
- package/Meshes/Builders/polyhedronBuilder.js.map +1 -1
- package/Meshes/Builders/ribbonBuilder.js +6 -6
- package/Meshes/Builders/ribbonBuilder.js.map +1 -1
- package/Meshes/Builders/shapeBuilder.js +2 -3
- package/Meshes/Builders/shapeBuilder.js.map +1 -1
- package/Meshes/Builders/tiledBoxBuilder.js +1 -1
- package/Meshes/Builders/tiledBoxBuilder.js.map +1 -1
- package/Meshes/Builders/tiledPlaneBuilder.js +1 -1
- package/Meshes/Builders/tiledPlaneBuilder.js.map +1 -1
- package/Meshes/GreasedLine/greasedLineMesh.js +1 -2
- package/Meshes/GreasedLine/greasedLineMesh.js.map +1 -1
- package/Meshes/GreasedLine/greasedLineRibbonMesh.js +1 -1
- package/Meshes/GreasedLine/greasedLineRibbonMesh.js.map +1 -1
- package/Meshes/Node/Blocks/Instances/instantiateOnFacesBlock.js +1 -1
- package/Meshes/Node/Blocks/Instances/instantiateOnFacesBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Instances/instantiateOnVolumeBlock.js +1 -1
- package/Meshes/Node/Blocks/Instances/instantiateOnVolumeBlock.js.map +1 -1
- package/Meshes/Node/Blocks/extrudeGeometryBlock.d.ts +61 -0
- package/Meshes/Node/Blocks/extrudeGeometryBlock.js +297 -0
- package/Meshes/Node/Blocks/extrudeGeometryBlock.js.map +1 -0
- package/Meshes/Node/Blocks/mappingBlock.js +1 -1
- package/Meshes/Node/Blocks/mappingBlock.js.map +1 -1
- package/Meshes/Node/index.d.ts +1 -0
- package/Meshes/Node/index.js +1 -0
- package/Meshes/Node/index.js.map +1 -1
- package/Meshes/abstractMesh.d.ts +4 -0
- package/Meshes/abstractMesh.js +14 -10
- package/Meshes/abstractMesh.js.map +1 -1
- package/Meshes/csg.js +1 -1
- package/Meshes/csg.js.map +1 -1
- package/Meshes/csg2.js +1 -1
- package/Meshes/csg2.js.map +1 -1
- package/Meshes/geodesicMesh.js +11 -13
- package/Meshes/geodesicMesh.js.map +1 -1
- package/Meshes/geometry.js +2 -2
- package/Meshes/geometry.js.map +1 -1
- package/Meshes/groundMesh.js +7 -7
- package/Meshes/groundMesh.js.map +1 -1
- package/Meshes/mesh.d.ts +2 -0
- package/Meshes/mesh.js +21 -7
- package/Meshes/mesh.js.map +1 -1
- package/Meshes/mesh.vertexData.js +22 -22
- package/Meshes/mesh.vertexData.js.map +1 -1
- package/Meshes/meshSimplification.js +1 -1
- package/Meshes/meshSimplification.js.map +1 -1
- package/Meshes/polygonMesh.js +1 -1
- package/Meshes/polygonMesh.js.map +1 -1
- package/Meshes/trailMesh.js +1 -1
- package/Meshes/trailMesh.js.map +1 -1
- package/Misc/HighDynamicRange/hdr.js +4 -6
- package/Misc/HighDynamicRange/hdr.js.map +1 -1
- package/Misc/HighDynamicRange/panoramaToCubemap.js +1 -1
- package/Misc/HighDynamicRange/panoramaToCubemap.js.map +1 -1
- package/Misc/basisWorker.js +1 -1
- package/Misc/basisWorker.js.map +1 -1
- package/Misc/environmentTextureTools.js +1 -1
- package/Misc/environmentTextureTools.js.map +1 -1
- package/Misc/meshExploder.js +1 -2
- package/Misc/meshExploder.js.map +1 -1
- package/Misc/tga.js +2 -2
- package/Misc/tga.js.map +1 -1
- package/Misc/timer.js +4 -2
- package/Misc/timer.js.map +1 -1
- package/Misc/tools.d.ts +7 -0
- package/Misc/tools.js +25 -7
- package/Misc/tools.js.map +1 -1
- package/Misc/webRequest.d.ts +34 -3
- package/Misc/webRequest.js +107 -24
- package/Misc/webRequest.js.map +1 -1
- package/Morph/morphTargetManager.js +1 -1
- package/Morph/morphTargetManager.js.map +1 -1
- package/Particles/Node/Blocks/Update/updateNoiseBlock.js +1 -1
- package/Particles/Node/Blocks/Update/updateNoiseBlock.js.map +1 -1
- package/Particles/Node/Blocks/particleSourceTextureBlock.d.ts +11 -1
- package/Particles/Node/Blocks/particleSourceTextureBlock.js +25 -11
- package/Particles/Node/Blocks/particleSourceTextureBlock.js.map +1 -1
- package/Particles/Node/nodeParticleSystemSet.helper.js +3 -3
- package/Particles/Node/nodeParticleSystemSet.helper.js.map +1 -1
- package/Particles/Node/nodeParticleSystemSet.js +1 -1
- package/Particles/Node/nodeParticleSystemSet.js.map +1 -1
- package/Particles/computeShaderParticleSystem.js +2 -0
- package/Particles/computeShaderParticleSystem.js.map +1 -1
- package/Particles/gpuParticleSystem.d.ts +14 -0
- package/Particles/gpuParticleSystem.js +94 -12
- package/Particles/gpuParticleSystem.js.map +1 -1
- package/Particles/particleSystem.js +4 -1
- package/Particles/particleSystem.js.map +1 -1
- package/Particles/pointsCloudSystem.js +46 -47
- package/Particles/pointsCloudSystem.js.map +1 -1
- package/Particles/solidParticleSystem.js +5 -6
- package/Particles/solidParticleSystem.js.map +1 -1
- package/Particles/thinParticleSystem.js +3 -4
- package/Particles/thinParticleSystem.js.map +1 -1
- package/Particles/webgl2ParticleSystem.js +2 -1
- package/Particles/webgl2ParticleSystem.js.map +1 -1
- package/Physics/v1/Plugins/ammoJSPlugin.js +0 -8
- package/Physics/v1/Plugins/ammoJSPlugin.js.map +1 -1
- package/Physics/v2/characterController.js +4 -8
- package/Physics/v2/characterController.js.map +1 -1
- package/Physics/v2/ragdoll.js +1 -2
- package/Physics/v2/ragdoll.js.map +1 -1
- package/PostProcesses/postProcess.js +3 -3
- package/PostProcesses/postProcess.js.map +1 -1
- package/PostProcesses/thinDepthOfFieldEffect.js +2 -2
- package/PostProcesses/thinDepthOfFieldEffect.js.map +1 -1
- package/Probes/reflectionProbe.js +0 -1
- package/Probes/reflectionProbe.js.map +1 -1
- package/Rendering/IBLShadows/iblShadowsRenderPipeline.js +0 -5
- package/Rendering/IBLShadows/iblShadowsRenderPipeline.js.map +1 -1
- package/Rendering/depthRenderer.js +0 -11
- package/Rendering/depthRenderer.js.map +1 -1
- package/Rendering/depthRendererSceneComponent.js +1 -1
- package/Rendering/depthRendererSceneComponent.js.map +1 -1
- package/Rendering/geometryBufferRenderer.js +0 -1
- package/Rendering/geometryBufferRenderer.js.map +1 -1
- package/Rendering/objectRenderer.js +7 -5
- package/Rendering/objectRenderer.js.map +1 -1
- package/Rendering/thinDepthPeelingRenderer.js +1 -1
- package/Rendering/thinDepthPeelingRenderer.js.map +1 -1
- package/Rendering/utilityLayerRenderer.js +1 -1
- package/Rendering/utilityLayerRenderer.js.map +1 -1
- package/Shaders/ShadersInclude/screenSpaceRayTrace.js +18 -8
- package/Shaders/ShadersInclude/screenSpaceRayTrace.js.map +1 -1
- package/Shaders/gpuRenderParticles.vertex.js +4 -0
- package/Shaders/gpuRenderParticles.vertex.js.map +1 -1
- package/Shaders/gpuUpdateParticles.vertex.js +15 -3
- package/Shaders/gpuUpdateParticles.vertex.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/screenSpaceRayTrace.js +18 -7
- package/ShadersWGSL/ShadersInclude/screenSpaceRayTrace.js.map +1 -1
- package/ShadersWGSL/gpuUpdateParticles.compute.js +16 -1
- package/ShadersWGSL/gpuUpdateParticles.compute.js.map +1 -1
- package/ShadersWGSL/lightingVolume.compute.js +1 -1
- package/ShadersWGSL/lightingVolume.compute.js.map +1 -1
- package/Sprites/spriteManager.js +4 -4
- package/Sprites/spriteManager.js.map +1 -1
- package/XR/features/WebXRAnchorSystem.js +2 -2
- package/XR/features/WebXRAnchorSystem.js.map +1 -1
- package/XR/features/WebXRHandTracking.js +1 -1
- package/XR/features/WebXRHandTracking.js.map +1 -1
- package/XR/features/WebXRNearInteraction.js +1 -1
- package/XR/features/WebXRNearInteraction.js.map +1 -1
- package/XR/motionController/webXRMicrosoftMixedRealityController.js +1 -1
- package/XR/motionController/webXRMicrosoftMixedRealityController.js.map +1 -1
- package/XR/motionController/webXROculusTouchMotionController.js +1 -1
- package/XR/motionController/webXROculusTouchMotionController.js.map +1 -1
- package/XR/webXRFeaturesManager.js +1 -1
- package/XR/webXRFeaturesManager.js.map +1 -1
- package/assetContainer.js +1 -1
- package/assetContainer.js.map +1 -1
- package/package.json +1 -1
- package/scene.d.ts +16 -0
- package/scene.js +28 -0
- package/scene.js.map +1 -1
- package/sceneComponent.js +1 -1
- package/sceneComponent.js.map +1 -1
|
@@ -5,8 +5,23 @@ export interface ILatLonLike {
|
|
|
5
5
|
/** Longitude in radians. */
|
|
6
6
|
lon: number;
|
|
7
7
|
}
|
|
8
|
-
/** Latitude and longitude in radians, and altitude
|
|
8
|
+
/** Latitude and longitude in radians, and altitude, typically meters. */
|
|
9
9
|
export interface ILatLonAltLike extends ILatLonLike {
|
|
10
|
-
/** The height above the surface
|
|
10
|
+
/** The height above the surface, typically meters. */
|
|
11
11
|
alt: number;
|
|
12
12
|
}
|
|
13
|
+
/**
|
|
14
|
+
* A reference ellipsoid used for geospatial functions.
|
|
15
|
+
*/
|
|
16
|
+
export interface IEllipsoidLike {
|
|
17
|
+
/** The larger radius for the ellipsoid. */
|
|
18
|
+
semiMajorAxis: number;
|
|
19
|
+
/** The smaller radius for the ellipsoid. */
|
|
20
|
+
semiMinorAxis: number;
|
|
21
|
+
/** The flattening for the ellipsoid. Zero for a sphere. */
|
|
22
|
+
flattening: number;
|
|
23
|
+
/** The first eccentricity, squared. */
|
|
24
|
+
firstEccentricitySquared: number;
|
|
25
|
+
/** The second eccentricity, squared. */
|
|
26
|
+
secondEccentricitySquared: number;
|
|
27
|
+
}
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import type { DeepImmutable } from "../types.js";
|
|
2
|
-
import type { ILatLonLike } from "./math.geospatial.js";
|
|
2
|
+
import type { IEllipsoidLike, ILatLonAltLike, ILatLonLike } from "./math.geospatial.js";
|
|
3
3
|
import type { IVector3Like } from "./math.like.js";
|
|
4
|
+
/**
|
|
5
|
+
* The WGS84 reference ellipsoid used for Earth-related geospatial functions.
|
|
6
|
+
* Derived from the semi-major axis (meters) and the inverse flattening.
|
|
7
|
+
*/
|
|
8
|
+
export declare const Wgs84Ellipsoid: DeepImmutable<IEllipsoidLike>;
|
|
4
9
|
/**
|
|
5
10
|
* Converts the latitude and longitude specified in degrees to an {@link ILatLonLike} in radians.
|
|
6
11
|
* @param lat - The latitude in degrees
|
|
@@ -11,9 +16,18 @@ import type { IVector3Like } from "./math.like.js";
|
|
|
11
16
|
export declare function LatLonFromDegreesToRef<T extends ILatLonLike>(lat: number, lon: number, result: T): T;
|
|
12
17
|
/**
|
|
13
18
|
* Computes the normal (up direction) in ECEF (Earth-Centered, Earth-Fixed) coordinates from the specified latitude and longitude in radians.
|
|
14
|
-
*
|
|
19
|
+
* For the calculation, latitude is clamped to -PI/2 to PI/2.
|
|
15
20
|
* @param latLon - The latitude and longitude in radians
|
|
16
21
|
* @param result - The resulting normal
|
|
17
22
|
* @returns The resulting normal
|
|
18
23
|
*/
|
|
19
24
|
export declare function LatLonToNormalToRef<T extends IVector3Like>(latLon: DeepImmutable<ILatLonLike>, result: T): T;
|
|
25
|
+
/**
|
|
26
|
+
* Converts latitude, longitude, and altitude to an ECEF (Earth-Centered, Earth-Fixed) position using the specified ellipsoid.
|
|
27
|
+
* For the calculation, latitude is clamped to -PI/2 to PI/2.
|
|
28
|
+
* @param latLonAlt - The latitude and longitude in radians, and the altitude relative to the reference ellipsoid's surface.
|
|
29
|
+
* @param ellipsoid - Parameters for a reference ellipsoid (e.g., the {@link Wgs84Ellipsoid}).
|
|
30
|
+
* @param result - The resulting ECEF position
|
|
31
|
+
* @returns The resulting ECEF position
|
|
32
|
+
*/
|
|
33
|
+
export declare function EcefFromLatLonAltToRef<T extends IVector3Like>(latLonAlt: DeepImmutable<ILatLonAltLike>, ellipsoid: DeepImmutable<Pick<IEllipsoidLike, "semiMajorAxis" | "firstEccentricitySquared">>, result: T): T;
|
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
import { Clamp } from "./math.scalar.functions.js";
|
|
2
2
|
import { Vector3FromFloatsToRef } from "./math.vector.functions.js";
|
|
3
|
+
const HalfPi = Math.PI / 2;
|
|
4
|
+
const DegreesToRadians = Math.PI / 180;
|
|
5
|
+
const EllipsoidFromSemiMajorAxisAndInverseFlattening = (semiMajorAxis, inverseFlattening) => {
|
|
6
|
+
const flattening = 1 / inverseFlattening;
|
|
7
|
+
const semiMinorAxis = semiMajorAxis * (1 - flattening);
|
|
8
|
+
const firstEccentricitySquared = 2 * flattening - flattening * flattening;
|
|
9
|
+
const secondEccentricitySquared = firstEccentricitySquared / (1 - firstEccentricitySquared);
|
|
10
|
+
return { semiMajorAxis, semiMinorAxis, flattening, firstEccentricitySquared, secondEccentricitySquared };
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* The WGS84 reference ellipsoid used for Earth-related geospatial functions.
|
|
14
|
+
* Derived from the semi-major axis (meters) and the inverse flattening.
|
|
15
|
+
*/
|
|
16
|
+
export const Wgs84Ellipsoid = Object.freeze(EllipsoidFromSemiMajorAxisAndInverseFlattening(6378137.0, 298.257223563));
|
|
3
17
|
/**
|
|
4
18
|
* Converts the latitude and longitude specified in degrees to an {@link ILatLonLike} in radians.
|
|
5
19
|
* @param lat - The latitude in degrees
|
|
@@ -8,20 +22,39 @@ import { Vector3FromFloatsToRef } from "./math.vector.functions.js";
|
|
|
8
22
|
* @returns The resulting {@link ILatLonLike} in radians
|
|
9
23
|
*/
|
|
10
24
|
export function LatLonFromDegreesToRef(lat, lon, result) {
|
|
11
|
-
result.lat =
|
|
12
|
-
result.lon =
|
|
25
|
+
result.lat = lat * DegreesToRadians;
|
|
26
|
+
result.lon = lon * DegreesToRadians;
|
|
13
27
|
return result;
|
|
14
28
|
}
|
|
15
29
|
/**
|
|
16
30
|
* Computes the normal (up direction) in ECEF (Earth-Centered, Earth-Fixed) coordinates from the specified latitude and longitude in radians.
|
|
17
|
-
*
|
|
31
|
+
* For the calculation, latitude is clamped to -PI/2 to PI/2.
|
|
18
32
|
* @param latLon - The latitude and longitude in radians
|
|
19
33
|
* @param result - The resulting normal
|
|
20
34
|
* @returns The resulting normal
|
|
21
35
|
*/
|
|
22
36
|
export function LatLonToNormalToRef(latLon, result) {
|
|
23
|
-
const lat = Clamp(latLon.lat, -
|
|
37
|
+
const lat = Clamp(latLon.lat, -HalfPi, HalfPi);
|
|
24
38
|
const cosLat = Math.cos(lat);
|
|
25
39
|
return Vector3FromFloatsToRef(cosLat * Math.cos(latLon.lon), cosLat * Math.sin(latLon.lon), Math.sin(lat), result);
|
|
26
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* Converts latitude, longitude, and altitude to an ECEF (Earth-Centered, Earth-Fixed) position using the specified ellipsoid.
|
|
43
|
+
* For the calculation, latitude is clamped to -PI/2 to PI/2.
|
|
44
|
+
* @param latLonAlt - The latitude and longitude in radians, and the altitude relative to the reference ellipsoid's surface.
|
|
45
|
+
* @param ellipsoid - Parameters for a reference ellipsoid (e.g., the {@link Wgs84Ellipsoid}).
|
|
46
|
+
* @param result - The resulting ECEF position
|
|
47
|
+
* @returns The resulting ECEF position
|
|
48
|
+
*/
|
|
49
|
+
export function EcefFromLatLonAltToRef(latLonAlt, ellipsoid, result) {
|
|
50
|
+
const lat = Clamp(latLonAlt.lat, -HalfPi, HalfPi);
|
|
51
|
+
const { lon, alt } = latLonAlt;
|
|
52
|
+
const { semiMajorAxis, firstEccentricitySquared } = ellipsoid;
|
|
53
|
+
const sinLat = Math.sin(lat);
|
|
54
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
55
|
+
const N = semiMajorAxis / Math.sqrt(1 - firstEccentricitySquared * sinLat * sinLat);
|
|
56
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
57
|
+
const NPlusAltTimesCosLat = (N + alt) * Math.cos(lat);
|
|
58
|
+
return Vector3FromFloatsToRef(NPlusAltTimesCosLat * Math.cos(lon), NPlusAltTimesCosLat * Math.sin(lon), (N * (1 - firstEccentricitySquared) + alt) * sinLat, result);
|
|
59
|
+
}
|
|
27
60
|
//# sourceMappingURL=math.geospatial.functions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"math.geospatial.functions.js","sourceRoot":"","sources":["../../../../dev/core/src/Maths/math.geospatial.functions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAIhD,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAEjE
|
|
1
|
+
{"version":3,"file":"math.geospatial.functions.js","sourceRoot":"","sources":["../../../../dev/core/src/Maths/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mutable } from \"../types\";\r\nimport type { IEllipsoidLike, ILatLonAltLike, ILatLonLike } from \"./math.geospatial\";\r\nimport type { IVector3Like } from \"./math.like\";\r\nimport { Vector3FromFloatsToRef } from \"./math.vector.functions\";\r\n\r\nconst HalfPi = Math.PI / 2;\r\nconst DegreesToRadians = Math.PI / 180;\r\n\r\nconst EllipsoidFromSemiMajorAxisAndInverseFlattening = (semiMajorAxis: number, inverseFlattening: number): IEllipsoidLike => {\r\n const flattening = 1 / inverseFlattening;\r\n const semiMinorAxis = semiMajorAxis * (1 - flattening);\r\n const firstEccentricitySquared = 2 * flattening - flattening * flattening;\r\n const secondEccentricitySquared = firstEccentricitySquared / (1 - firstEccentricitySquared);\r\n return { semiMajorAxis, semiMinorAxis, flattening, firstEccentricitySquared, secondEccentricitySquared };\r\n};\r\n\r\n/**\r\n * The WGS84 reference ellipsoid used for Earth-related geospatial functions.\r\n * Derived from the semi-major axis (meters) and the inverse flattening.\r\n */\r\nexport const Wgs84Ellipsoid: DeepImmutable<IEllipsoidLike> = Object.freeze(EllipsoidFromSemiMajorAxisAndInverseFlattening(6378137.0, 298.257223563));\r\n\r\n/**\r\n * Converts the latitude and longitude specified in degrees to an {@link ILatLonLike} in radians.\r\n * @param lat - The latitude in degrees\r\n * @param lon - The longitude in degrees\r\n * @param result - The resulting {@link ILatLonLike} in radians\r\n * @returns The resulting {@link ILatLonLike} in radians\r\n */\r\nexport function LatLonFromDegreesToRef<T extends ILatLonLike>(lat: number, lon: number, result: T): T {\r\n result.lat = lat * DegreesToRadians;\r\n result.lon = lon * DegreesToRadians;\r\n return result;\r\n}\r\n\r\n/**\r\n * Computes the normal (up direction) in ECEF (Earth-Centered, Earth-Fixed) coordinates from the specified latitude and longitude in radians.\r\n * For the calculation, latitude is clamped to -PI/2 to PI/2.\r\n * @param latLon - The latitude and longitude in radians\r\n * @param result - The resulting normal\r\n * @returns The resulting normal\r\n */\r\nexport function LatLonToNormalToRef<T extends IVector3Like>(latLon: DeepImmutable<ILatLonLike>, result: T): T {\r\n const lat = Clamp(latLon.lat, -HalfPi, HalfPi);\r\n const cosLat = Math.cos(lat);\r\n return Vector3FromFloatsToRef(cosLat * Math.cos(latLon.lon), cosLat * Math.sin(latLon.lon), Math.sin(lat), result);\r\n}\r\n\r\n/**\r\n * Converts latitude, longitude, and altitude to an ECEF (Earth-Centered, Earth-Fixed) position using the specified ellipsoid.\r\n * For the calculation, latitude is clamped to -PI/2 to PI/2.\r\n * @param latLonAlt - The latitude and longitude in radians, and the altitude relative to the reference ellipsoid's surface.\r\n * @param ellipsoid - Parameters for a reference ellipsoid (e.g., the {@link Wgs84Ellipsoid}).\r\n * @param result - The resulting ECEF position\r\n * @returns The resulting ECEF position\r\n */\r\nexport function EcefFromLatLonAltToRef<T extends IVector3Like>(\r\n latLonAlt: DeepImmutable<ILatLonAltLike>,\r\n ellipsoid: DeepImmutable<Pick<IEllipsoidLike, \"semiMajorAxis\" | \"firstEccentricitySquared\">>,\r\n result: T\r\n): T {\r\n const lat = Clamp(latLonAlt.lat, -HalfPi, HalfPi);\r\n const { lon, alt } = latLonAlt;\r\n const { semiMajorAxis, firstEccentricitySquared } = ellipsoid;\r\n const sinLat = Math.sin(lat);\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n const N = semiMajorAxis / Math.sqrt(1 - firstEccentricitySquared * sinLat * sinLat);\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n const NPlusAltTimesCosLat = (N + alt) * Math.cos(lat);\r\n return Vector3FromFloatsToRef(NPlusAltTimesCosLat * Math.cos(lon), NPlusAltTimesCosLat * Math.sin(lon), (N * (1 - firstEccentricitySquared) + alt) * sinLat, result);\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"math.geospatial.js","sourceRoot":"","sources":["../../../../dev/core/src/Maths/math.geospatial.ts"],"names":[],"mappings":"","sourcesContent":["/** Latitude and longitude in radians. */\r\nexport interface ILatLonLike {\r\n /** Latitude in radians. */\r\n lat: number;\r\n /** Longitude in radians. */\r\n lon: number;\r\n}\r\n\r\n/** Latitude and longitude in radians, and altitude
|
|
1
|
+
{"version":3,"file":"math.geospatial.js","sourceRoot":"","sources":["../../../../dev/core/src/Maths/math.geospatial.ts"],"names":[],"mappings":"","sourcesContent":["/** Latitude and longitude in radians. */\r\nexport interface ILatLonLike {\r\n /** Latitude in radians. */\r\n lat: number;\r\n /** Longitude in radians. */\r\n lon: number;\r\n}\r\n\r\n/** Latitude and longitude in radians, and altitude, typically meters. */\r\nexport interface ILatLonAltLike extends ILatLonLike {\r\n /** The height above the surface, typically meters. */\r\n alt: number;\r\n}\r\n\r\n/**\r\n * A reference ellipsoid used for geospatial functions.\r\n */\r\nexport interface IEllipsoidLike {\r\n /** The larger radius for the ellipsoid. */\r\n semiMajorAxis: number;\r\n /** The smaller radius for the ellipsoid. */\r\n semiMinorAxis: number;\r\n /** The flattening for the ellipsoid. Zero for a sphere. */\r\n flattening: number;\r\n /** The first eccentricity, squared. */\r\n firstEccentricitySquared: number;\r\n /** The second eccentricity, squared. */\r\n secondEccentricitySquared: number;\r\n}\r\n"]}
|
package/Maths/math.path.js
CHANGED
|
@@ -1067,7 +1067,7 @@ export class Curve3 {
|
|
|
1067
1067
|
else {
|
|
1068
1068
|
const dStep = 1 / steps;
|
|
1069
1069
|
let theta = 0;
|
|
1070
|
-
let point
|
|
1070
|
+
let point;
|
|
1071
1071
|
do {
|
|
1072
1072
|
point = center.add(xAxis.scale(radius * Math.cos(theta)).add(yAxis.scale(radius * Math.sin(theta))));
|
|
1073
1073
|
copyOrPush(point);
|