babylonjs-toolkit 9.6.2 → 9.9.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/README.md CHANGED
@@ -1,13 +1,11 @@
1
1
  # Classic Edition
2
2
  The <a href="https://www.babylontoolkit.com">Babylon Toolkit</a> is a runtime library extension for BabylonJS development that provides modern programming mechanics with a familiar Unity like scripting model to fast track native web game development.
3
3
 
4
- **We recommend using the modern ES6 supported edition**
5
-
6
- <a href="https://www.npmjs.com/package/@babylonjs-toolkit/next">Next Edition (ES6)</a>
4
+ <a href="https://github.com/babylontoolkit/StarterAssets">Demo React Project (TSX)</a>
7
5
  <br/>
8
6
  <a href="https://github.com/BabylonJS/BabylonToolkit/tree/master/Runtime">Browser Library (CDN)</a>
9
7
  <br/>
10
- <a href="https://github.com/codewrxai/Starter-Project">Demo React Project (TSX)</a>
8
+ <a href="https://www.npmjs.com/package/@babylonjs-toolkit/next">Next Edition (ES6)</a>
11
9
 
12
10
 
13
11
  ## Basic Installation
@@ -15,10 +13,9 @@ The <a href="https://www.babylontoolkit.com">Babylon Toolkit</a> is a runtime li
15
13
  npm install babylonjs-toolkit
16
14
  ```
17
15
 
18
-
19
16
  ## Default Installation (UMD)
20
17
  ```bash
21
- npm install babylonjs babylonjs-gui babylonjs-loaders babylonjs-materials babylonjs-toolkit
18
+ npm install babylonjs babylonjs-gui babylonjs-addons babylonjs-loaders babylonjs-materials babylonjs-inspector babylonjs-toolkit
22
19
  ```
23
20
 
24
21
  * Global Import Side Effects (main.ts)
@@ -41,23 +38,22 @@ import 'babylonjs-toolkit';
41
38
  "babylonjs-toolkit"
42
39
  ]
43
40
  ```
41
+ ### Vite Configuration (UMD)
44
42
 
45
- Note: The **BABYLON** and **TOOLKIT** namespaces are globally accessible. Navigation is now bundled within the toolkit.
46
-
43
+ The Vite bundle services behave differently in devmode than production. To preserve some required classes during devmode, these `exclude` and `include` settings are strongly recommended in your vite.config.js settings file.
47
44
 
48
- ## Navigation Mesh And Pathfinding ([Navigation](https://github.com/MackeyK24/babylon-navigation-mesh))
49
-
50
- Access Navigation from the babylon-toolkit:
51
- ```
52
- TOOLKIT.Navigation
53
- ```
54
-
55
- Or access Navigation from the global window:
56
- ```
57
- window.Navigation
45
+ ```json
46
+ optimizeDeps: {
47
+ exclude: ["babylonjs-inspector"],
48
+ include: mode === 'development' ? [
49
+ "babylonjs",
50
+ "babylonjs-gui",
51
+ "babylonjs-addons",
52
+ "babylonjs-loaders",
53
+ "babylonjs-materials",
54
+ "babylonjs-toolkit",
55
+ ] : [],
56
+ },
58
57
  ```
59
58
 
60
- Or access Navigation using shorthand globals:
61
- ```
62
- Navigation;
63
- ```
59
+ Note: The **BABYLON** and **TOOLKIT** namespaces are globally accessible. Navigation is now bundled within the toolkit.
@@ -7,7 +7,7 @@ declare namespace TOOLKIT {
7
7
  * @class SceneManager - All rights reserved (c) 2024 Mackey Kinard
8
8
  */
9
9
  class SceneManager {
10
- /** Gets the toolkit framework version string (9.6.2 - R1) */
10
+ /** Gets the toolkit framework version string (9.9.1 - R1) */
11
11
  static get Version(): string;
12
12
  /** Gets the toolkit framework copyright notice */
13
13
  static get Copyright(): string;
@@ -25,6 +25,10 @@ declare namespace TOOLKIT {
25
25
  static RenderLoopReady: boolean;
26
26
  /** Pauses the main page render loop */
27
27
  static PauseRenderLoop: boolean;
28
+ /** Defines whether the toolkit scene simulation is currently playing (true) or paused for editing (false). Defaults to true so shipped runtimes are unaffected. The editor sets this false for a static edit mode and true to enter live play mode. Use SetScenePlaying() to also freeze/resume the physics world. */
29
+ static ScenePlaying: boolean;
30
+ /** Cached physics engine time step used to resume the simulation after a pause. */
31
+ private static PhysicsTimeStep;
28
32
  /** The webgl render context has been lost flag */
29
33
  static LostRenderContext: boolean;
30
34
  /** Set the preload auto update progress flag */
@@ -259,6 +263,15 @@ declare namespace TOOLKIT {
259
263
  static GetTimeMilliseconds(): number;
260
264
  /** Get the delta time animation ratio for 60 fps */
261
265
  static GetAnimationRatio(scene: BABYLON.Scene): number;
266
+ /**
267
+ * Sets whether the toolkit scene simulation is playing (true) or paused for editing (false).
268
+ * When paused: the script component life-cycle (awake/start/update/late/step/fixed) is halted and the
269
+ * physics world simulation is frozen (time step set to 0). When resumed: the physics time step is
270
+ * restored and the game time baseline is reset. Shipped runtimes default to playing so are unaffected.
271
+ * @param playing defines whether the scene simulation should run.
272
+ * @param scene defines the optional target scene (defaults to the last created scene).
273
+ */
274
+ static SetScenePlaying(playing: boolean, scene?: BABYLON.Scene): void;
262
275
  /** Run a function on the next render loop. */
263
276
  static RunOnce(scene: BABYLON.Scene, func: () => void, timeout?: number): void;
264
277
  /** Disposes entire scene and release all resources */