@babylonjs/addons 8.30.0 → 8.30.1
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/navigation/factory/common.d.ts +7 -5
- package/navigation/factory/common.js +6 -4
- package/navigation/factory/common.js.map +1 -1
- package/navigation/factory/factory.single-thread.d.ts +6 -1
- package/navigation/factory/factory.single-thread.js +3 -2
- package/navigation/factory/factory.single-thread.js.map +1 -1
- package/package.json +2 -2
|
@@ -11,10 +11,12 @@ export declare function GetRecast(): RecastInjection;
|
|
|
11
11
|
*/
|
|
12
12
|
export declare function SetRecast(recast: RecastInjection): void;
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* @param options
|
|
14
|
+
* Initializes the Recast navigation library.
|
|
15
|
+
*
|
|
16
|
+
* @param options Optional configuration. options.version: The version of Recast to use. options.instance: A custom Recast instance to inject instead of loading one.
|
|
17
|
+
* @returns A promise that resolves when initialization is complete.
|
|
17
18
|
*/
|
|
18
|
-
export declare function InitRecast(
|
|
19
|
-
|
|
19
|
+
export declare function InitRecast(options?: {
|
|
20
|
+
version?: string;
|
|
21
|
+
instance?: RecastInjection;
|
|
20
22
|
}): Promise<void>;
|
|
@@ -27,11 +27,13 @@ let _Recast;
|
|
|
27
27
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
28
28
|
let _InitPromise = null;
|
|
29
29
|
/**
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
* @param options
|
|
30
|
+
* Initializes the Recast navigation library.
|
|
31
|
+
*
|
|
32
|
+
* @param options Optional configuration. options.version: The version of Recast to use. options.instance: A custom Recast instance to inject instead of loading one.
|
|
33
|
+
* @returns A promise that resolves when initialization is complete.
|
|
33
34
|
*/
|
|
34
|
-
export async function InitRecast(
|
|
35
|
+
export async function InitRecast(options) {
|
|
36
|
+
const version = options?.version ?? "0.43.0";
|
|
35
37
|
const localOptions = {
|
|
36
38
|
url: "https://unpkg.com/@recast-navigation",
|
|
37
39
|
version,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../../../../dev/addons/src/navigation/factory/common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,gDAAkC;AAKnE;;;;GAIG;AACH,MAAM,UAAU,SAAS;IACrB,IAAI,CAAC,OAAO,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CAAC,0DAA0D,CAAC,CAAC;IAChF,CAAC;IACD,OAAO,OAAO,CAAC;AACnB,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,SAAS,CAAC,MAAuB;IAC7C,OAAO,GAAG,MAAM,CAAC;AACrB,CAAC;AAED;;GAEG;AACH,IAAI,OAAwB,CAAC;AAE7B;;GAEG;AACH,gEAAgE;AAChE,IAAI,YAAY,GAAsD,IAAI,CAAC;AAE3E
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../../../../dev/addons/src/navigation/factory/common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,gDAAkC;AAKnE;;;;GAIG;AACH,MAAM,UAAU,SAAS;IACrB,IAAI,CAAC,OAAO,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CAAC,0DAA0D,CAAC,CAAC;IAChF,CAAC;IACD,OAAO,OAAO,CAAC;AACnB,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,SAAS,CAAC,MAAuB;IAC7C,OAAO,GAAG,MAAM,CAAC;AACrB,CAAC;AAED;;GAEG;AACH,IAAI,OAAwB,CAAC;AAE7B;;GAEG;AACH,gEAAgE;AAChE,IAAI,YAAY,GAAsD,IAAI,CAAC;AAE3E;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,OAA0D;IACvF,MAAM,OAAO,GAAG,OAAO,EAAE,OAAO,IAAI,QAAQ,CAAC;IAC7C,MAAM,YAAY,GAAG;QACjB,GAAG,EAAE,sCAAsC;QAC3C,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;;aAErE,CACR,CAAC;IACF,OAAO,MAAM,CAAC;AAClB,CAAC","sourcesContent":["import { _LoadScriptModuleAsync } from \"core/Misc/tools.internals\";\nimport type { Nullable } from \"core/types\";\n\nimport type { RecastInjection } from \"../types\";\n\n/**\n * Gets the RecastInjection instance (reference to the recast-navigation-js library).\n * @returns The RecastInjection instance\n * @throws Error if Recast is not initialized\n */\nexport function GetRecast(): RecastInjection {\n if (!_Recast) {\n throw new Error(\"Recast is not initialized. Please call InitRecast first.\");\n }\n return _Recast;\n}\n\n/**\n * Sets the RecastInjection instance (reference to the recast-navigation-js library).\n * @param recast The RecastInjection instance to set\n */\nexport function SetRecast(recast: RecastInjection) {\n _Recast = recast;\n}\n\n/**\n * Reference to the recast-navigation-js library\n */\nlet _Recast: RecastInjection;\n\n/**\n * Promise to wait for the recast-navigation-js library to be ready\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nlet _InitPromise: Nullable<Promise<{ core: any; generators: any }>> = null;\n\n/**\n * Initializes the Recast navigation library.\n *\n * @param options Optional configuration. options.version: The version of Recast to use. options.instance: A custom Recast instance to inject instead of loading one.\n * @returns A promise that resolves when initialization is complete.\n */\nexport async function InitRecast(options?: { version?: string; instance?: RecastInjection }) {\n const version = options?.version ?? \"0.43.0\";\n const localOptions = {\n url: \"https://unpkg.com/@recast-navigation\",\n version,\n ...options,\n };\n\n if (_Recast) {\n return; // Already initialized\n }\n\n if (_InitPromise) {\n await _InitPromise;\n return;\n }\n\n if (localOptions.instance) {\n _Recast = localOptions.instance;\n } else {\n _InitPromise = ImportRecast(localOptions.url, localOptions.version);\n\n const result = await _InitPromise;\n // eslint-disable-next-line require-atomic-updates\n _Recast = { ...result.core, ...result.generators };\n\n await _Recast.init();\n }\n}\n\nasync function ImportRecast(baseUrl: string, version: string) {\n const importMap = {\n imports: {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n \"@recast-navigation/core\": `${baseUrl}/core@${version}/dist/index.mjs`,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n \"@recast-navigation/wasm\": `${baseUrl}/wasm@${version}/dist/recast-navigation.wasm-compat.js`,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n \"@recast-navigation/generators\": `${baseUrl}/generators@${version}/dist/index.mjs`,\n },\n };\n\n const script = document.createElement(\"script\");\n script.type = \"importmap\";\n script.textContent = JSON.stringify(importMap);\n document.body.appendChild(script);\n\n const result = await _LoadScriptModuleAsync(\n `\n import * as CoreModule from '${baseUrl}/core@${version}/dist/index.mjs';\n import * as GeneratorsModule from '${baseUrl}/generators@${version}/dist/index.mjs';\n const returnedValue = {core: CoreModule, generators: GeneratorsModule};\n `\n );\n return result;\n}\n"]}
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import { RecastNavigationJSPluginV2 } from "../plugin/RecastNavigationJSPlugin.js";
|
|
2
|
+
import type { RecastInjection } from "../types.js";
|
|
2
3
|
/**
|
|
3
4
|
* Creates a navigation plugin for the given scene.
|
|
4
5
|
* @returns A promise that resolves to the created navigation plugin.
|
|
6
|
+
* @param options Optional configuration. options.version: The version of Recast to use. options.instance: A custom Recast instance to inject instead of loading one.
|
|
5
7
|
* @remarks This function initializes the Recast module and sets up the navigation plugin.
|
|
6
8
|
*/
|
|
7
|
-
export declare function CreateNavigationPluginAsync(
|
|
9
|
+
export declare function CreateNavigationPluginAsync(options?: {
|
|
10
|
+
version?: string;
|
|
11
|
+
instance?: RecastInjection;
|
|
12
|
+
}): Promise<RecastNavigationJSPluginV2>;
|
|
@@ -4,10 +4,11 @@ import { GetRecast, InitRecast } from "./common.js";
|
|
|
4
4
|
/**
|
|
5
5
|
* Creates a navigation plugin for the given scene.
|
|
6
6
|
* @returns A promise that resolves to the created navigation plugin.
|
|
7
|
+
* @param options Optional configuration. options.version: The version of Recast to use. options.instance: A custom Recast instance to inject instead of loading one.
|
|
7
8
|
* @remarks This function initializes the Recast module and sets up the navigation plugin.
|
|
8
9
|
*/
|
|
9
|
-
export async function CreateNavigationPluginAsync() {
|
|
10
|
-
await InitRecast();
|
|
10
|
+
export async function CreateNavigationPluginAsync(options) {
|
|
11
|
+
await InitRecast(options);
|
|
11
12
|
const navigationPlugin = new RecastNavigationJSPluginV2(GetRecast());
|
|
12
13
|
InjectGenerators(navigationPlugin);
|
|
13
14
|
return navigationPlugin;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factory.single-thread.js","sourceRoot":"","sources":["../../../../../dev/addons/src/navigation/factory/factory.single-thread.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,CAAC;
|
|
1
|
+
{"version":3,"file":"factory.single-thread.js","sourceRoot":"","sources":["../../../../../dev/addons/src/navigation/factory/factory.single-thread.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,CAAC;AAEhF,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEjD;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,2BAA2B,CAAC,OAA0D;IACxG,MAAM,UAAU,CAAC,OAAO,CAAC,CAAC;IAE1B,MAAM,gBAAgB,GAAG,IAAI,0BAA0B,CAAC,SAAS,EAAE,CAAC,CAAC;IACrE,gBAAgB,CAAC,gBAAgB,CAAC,CAAC;IAEnC,OAAO,gBAAgB,CAAC;AAC5B,CAAC","sourcesContent":["import { InjectGenerators } from \"../generator/injection\";\nimport { RecastNavigationJSPluginV2 } from \"../plugin/RecastNavigationJSPlugin\";\nimport type { RecastInjection } from \"../types\";\nimport { GetRecast, InitRecast } from \"./common\";\n\n/**\n * Creates a navigation plugin for the given scene.\n * @returns A promise that resolves to the created navigation plugin.\n * @param options Optional configuration. options.version: The version of Recast to use. options.instance: A custom Recast instance to inject instead of loading one.\n * @remarks This function initializes the Recast module and sets up the navigation plugin.\n */\nexport async function CreateNavigationPluginAsync(options?: { version?: string; instance?: RecastInjection }) {\n await InitRecast(options);\n\n const navigationPlugin = new RecastNavigationJSPluginV2(GetRecast());\n InjectGenerators(navigationPlugin);\n\n return navigationPlugin;\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@babylonjs/addons",
|
|
3
|
-
"version": "8.30.
|
|
3
|
+
"version": "8.30.1",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"module": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"postcompile": "build-tools -c add-js-to-es6"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"@babylonjs/core": "^8.30.
|
|
21
|
+
"@babylonjs/core": "^8.30.1",
|
|
22
22
|
"@dev/addons": "^1.0.0",
|
|
23
23
|
"@dev/build-tools": "^1.0.0"
|
|
24
24
|
},
|