@babylonjs/core 8.53.1 → 8.54.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/Engines/AbstractEngine/abstractEngine.renderPass.js +1 -0
- package/Engines/AbstractEngine/abstractEngine.renderPass.js.map +1 -1
- package/Engines/abstractEngine.js +2 -2
- package/Engines/abstractEngine.js.map +1 -1
- package/Loading/Plugins/babylonFileLoader.js +44 -14
- package/Loading/Plugins/babylonFileLoader.js.map +1 -1
- package/Maths/index.d.ts +2 -0
- package/Maths/index.js +2 -0
- package/Maths/index.js.map +1 -1
- package/Maths/math.geospatial.d.ts +12 -0
- package/Maths/math.geospatial.functions.d.ts +19 -0
- package/Maths/math.geospatial.functions.js +27 -0
- package/Maths/math.geospatial.functions.js.map +1 -0
- package/Maths/math.geospatial.js +2 -0
- package/Maths/math.geospatial.js.map +1 -0
- package/Meshes/abstractMesh.d.ts +4 -0
- package/Meshes/abstractMesh.js +4 -0
- package/Meshes/abstractMesh.js.map +1 -1
- package/Meshes/mesh.d.ts +2 -0
- package/Meshes/mesh.js +19 -2
- package/Meshes/mesh.js.map +1 -1
- package/Shaders/ShadersInclude/screenSpaceRayTrace.js +18 -8
- package/Shaders/ShadersInclude/screenSpaceRayTrace.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/screenSpaceRayTrace.js +18 -7
- package/ShadersWGSL/ShadersInclude/screenSpaceRayTrace.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** Latitude and longitude in radians. */
|
|
2
|
+
export interface ILatLonLike {
|
|
3
|
+
/** Latitude in radians. */
|
|
4
|
+
lat: number;
|
|
5
|
+
/** Longitude in radians. */
|
|
6
|
+
lon: number;
|
|
7
|
+
}
|
|
8
|
+
/** Latitude and longitude in radians, and altitude in meters. */
|
|
9
|
+
export interface ILatLonAltLike extends ILatLonLike {
|
|
10
|
+
/** The height above the surface in meters. */
|
|
11
|
+
alt: number;
|
|
12
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { DeepImmutable } from "../types.js";
|
|
2
|
+
import type { ILatLonLike } from "./math.geospatial.js";
|
|
3
|
+
import type { IVector3Like } from "./math.like.js";
|
|
4
|
+
/**
|
|
5
|
+
* Converts the latitude and longitude specified in degrees to an {@link ILatLonLike} in radians.
|
|
6
|
+
* @param lat - The latitude in degrees
|
|
7
|
+
* @param lon - The longitude in degrees
|
|
8
|
+
* @param result - The resulting {@link ILatLonLike} in radians
|
|
9
|
+
* @returns The resulting {@link ILatLonLike} in radians
|
|
10
|
+
*/
|
|
11
|
+
export declare function LatLonFromDegreesToRef<T extends ILatLonLike>(lat: number, lon: number, result: T): T;
|
|
12
|
+
/**
|
|
13
|
+
* Computes the normal (up direction) in ECEF (Earth-Centered, Earth-Fixed) coordinates from the specified latitude and longitude in radians.
|
|
14
|
+
* Will clamp the latitude to -PI/2 to PI/2.
|
|
15
|
+
* @param latLon - The latitude and longitude in radians
|
|
16
|
+
* @param result - The resulting normal
|
|
17
|
+
* @returns The resulting normal
|
|
18
|
+
*/
|
|
19
|
+
export declare function LatLonToNormalToRef<T extends IVector3Like>(latLon: DeepImmutable<ILatLonLike>, result: T): T;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Clamp } from "./math.scalar.functions.js";
|
|
2
|
+
import { Vector3FromFloatsToRef } from "./math.vector.functions.js";
|
|
3
|
+
/**
|
|
4
|
+
* Converts the latitude and longitude specified in degrees to an {@link ILatLonLike} in radians.
|
|
5
|
+
* @param lat - The latitude in degrees
|
|
6
|
+
* @param lon - The longitude in degrees
|
|
7
|
+
* @param result - The resulting {@link ILatLonLike} in radians
|
|
8
|
+
* @returns The resulting {@link ILatLonLike} in radians
|
|
9
|
+
*/
|
|
10
|
+
export function LatLonFromDegreesToRef(lat, lon, result) {
|
|
11
|
+
result.lat = (lat * Math.PI) / 180;
|
|
12
|
+
result.lon = (lon * Math.PI) / 180;
|
|
13
|
+
return result;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Computes the normal (up direction) in ECEF (Earth-Centered, Earth-Fixed) coordinates from the specified latitude and longitude in radians.
|
|
17
|
+
* Will clamp the latitude to -PI/2 to PI/2.
|
|
18
|
+
* @param latLon - The latitude and longitude in radians
|
|
19
|
+
* @param result - The resulting normal
|
|
20
|
+
* @returns The resulting normal
|
|
21
|
+
*/
|
|
22
|
+
export function LatLonToNormalToRef(latLon, result) {
|
|
23
|
+
const lat = Clamp(latLon.lat, -Math.PI / 2, Math.PI / 2);
|
|
24
|
+
const cosLat = Math.cos(lat);
|
|
25
|
+
return Vector3FromFloatsToRef(cosLat * Math.cos(latLon.lon), cosLat * Math.sin(latLon.lon), Math.sin(lat), result);
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=math.geospatial.functions.js.map
|
|
@@ -0,0 +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;;;;;;GAMG;AACH,MAAM,UAAU,sBAAsB,CAAwB,GAAW,EAAE,GAAW,EAAE,MAAS;IAC7F,MAAM,CAAC,GAAG,GAAG,CAAC,GAAG,GAAG,IAAI,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC;IACnC,MAAM,CAAC,GAAG,GAAG,CAAC,GAAG,GAAG,IAAI,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC;IACnC,OAAO,MAAM,CAAC;AAClB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,mBAAmB,CAAyB,MAAkC,EAAE,MAAS;IACrG,MAAM,GAAG,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,EAAE,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;IACzD,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC7B,OAAO,sBAAsB,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,CAAC;AACvH,CAAC","sourcesContent":["import { Clamp } from \"./math.scalar.functions\";\r\nimport type { DeepImmutable } from \"../types\";\r\nimport type { ILatLonLike } from \"./math.geospatial\";\r\nimport type { IVector3Like } from \"./math.like\";\r\nimport { Vector3FromFloatsToRef } from \"./math.vector.functions\";\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 * Math.PI) / 180;\r\n result.lon = (lon * Math.PI) / 180;\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 * Will clamp the latitude 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, -Math.PI / 2, Math.PI / 2);\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"]}
|
|
@@ -0,0 +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 in meters. */\r\nexport interface ILatLonAltLike extends ILatLonLike {\r\n /** The height above the surface in meters. */\r\n alt: number;\r\n}\r\n"]}
|
package/Meshes/abstractMesh.d.ts
CHANGED
|
@@ -574,6 +574,10 @@ export declare abstract class AbstractMesh extends TransformNode implements IDis
|
|
|
574
574
|
* @internal
|
|
575
575
|
*/
|
|
576
576
|
_getActionManagerForTrigger(trigger?: number, initialCall?: boolean): Nullable<AbstractActionManager>;
|
|
577
|
+
/**
|
|
578
|
+
* @internal
|
|
579
|
+
*/
|
|
580
|
+
_releaseRenderPassId(_id: number): void;
|
|
577
581
|
/**
|
|
578
582
|
* @internal
|
|
579
583
|
*/
|
package/Meshes/abstractMesh.js
CHANGED