@babylonjs/core 7.8.1 → 7.9.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.
@@ -70,10 +70,12 @@ export class TouchCamera extends FreeCamera {
70
70
  const touch = this.inputs.attached["touch"];
71
71
  const mouse = this.inputs.attached["mouse"];
72
72
  if (mouse) {
73
- mouse.touchEnabled = false;
73
+ // enable touch in mouse input if touch module is not enabled
74
+ mouse.touchEnabled = !touch;
74
75
  }
75
76
  else {
76
- touch.allowMouse = true;
77
+ // allow mouse in touch input if mouse module is not available
78
+ touch.allowMouse = !mouse;
77
79
  }
78
80
  }
79
81
  }
@@ -1 +1 @@
1
- {"version":3,"file":"touchCamera.js","sourceRoot":"","sources":["../../../../dev/core/src/Cameras/touchCamera.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAI1C,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAE/B,IAAI,CAAC,kBAAkB,CAAC,aAAa,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;IACnD,OAAO,GAAG,EAAE,CAAC,IAAI,WAAW,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,EAAE,KAAK,CAAC,CAAC;AAC9D,CAAC,CAAC,CAAC;AAEH;;;;GAIG;AACH,MAAM,OAAO,WAAY,SAAQ,UAAU;IACvC;;;OAGG;IACH,IAAW,uBAAuB;QAC9B,MAAM,KAAK,GAAyB,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAClE,IAAI,KAAK,EAAE;YACP,OAAO,KAAK,CAAC,uBAAuB,CAAC;SACxC;QAED,OAAO,CAAC,CAAC;IACb,CAAC;IAED,IAAW,uBAAuB,CAAC,KAAa;QAC5C,MAAM,KAAK,GAAyB,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAClE,IAAI,KAAK,EAAE;YACP,KAAK,CAAC,uBAAuB,GAAG,KAAK,CAAC;SACzC;IACL,CAAC;IAED;;;OAGG;IACH,IAAW,oBAAoB;QAC3B,MAAM,KAAK,GAAyB,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAClE,IAAI,KAAK,EAAE;YACP,OAAO,KAAK,CAAC,oBAAoB,CAAC;SACrC;QAED,OAAO,CAAC,CAAC;IACb,CAAC;IAED,IAAW,oBAAoB,CAAC,KAAa;QACzC,MAAM,KAAK,GAAyB,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAClE,IAAI,KAAK,EAAE;YACP,KAAK,CAAC,oBAAoB,GAAG,KAAK,CAAC;SACtC;IACL,CAAC;IAED;;;;;;;;OAQG;IACH,YAAY,IAAY,EAAE,QAAiB,EAAE,KAAa;QACtD,KAAK,CAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;QAC7B,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;QAEvB,IAAI,CAAC,YAAY,EAAE,CAAC;IACxB,CAAC;IAED;;;OAGG;IACa,YAAY;QACxB,OAAO,aAAa,CAAC;IACzB,CAAC;IAED,gBAAgB;IACA,YAAY;QACxB,MAAM,KAAK,GAAyB,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAClE,MAAM,KAAK,GAAyB,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAClE,IAAI,KAAK,EAAE;YACP,KAAK,CAAC,YAAY,GAAG,KAAK,CAAC;SAC9B;aAAM;YACH,KAAK,CAAC,UAAU,GAAG,IAAI,CAAC;SAC3B;IACL,CAAC;CACJ","sourcesContent":["import { FreeCamera } from \"./freeCamera\";\r\nimport type { FreeCameraTouchInput } from \"../Cameras/Inputs/freeCameraTouchInput\";\r\nimport type { FreeCameraMouseInput } from \"../Cameras/Inputs/freeCameraMouseInput\";\r\nimport type { Scene } from \"../scene\";\r\nimport { Vector3 } from \"../Maths/math.vector\";\r\nimport { Node } from \"../node\";\r\n\r\nNode.AddNodeConstructor(\"TouchCamera\", (name, scene) => {\r\n return () => new TouchCamera(name, Vector3.Zero(), scene);\r\n});\r\n\r\n/**\r\n * This represents a FPS type of camera controlled by touch.\r\n * This is like a universal camera minus the Gamepad controls.\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/camera_introduction#universal-camera\r\n */\r\nexport class TouchCamera extends FreeCamera {\r\n /**\r\n * Defines the touch sensibility for rotation.\r\n * The higher the faster.\r\n */\r\n public get touchAngularSensibility(): number {\r\n const touch = <FreeCameraTouchInput>this.inputs.attached[\"touch\"];\r\n if (touch) {\r\n return touch.touchAngularSensibility;\r\n }\r\n\r\n return 0;\r\n }\r\n\r\n public set touchAngularSensibility(value: number) {\r\n const touch = <FreeCameraTouchInput>this.inputs.attached[\"touch\"];\r\n if (touch) {\r\n touch.touchAngularSensibility = value;\r\n }\r\n }\r\n\r\n /**\r\n * Defines the touch sensibility for move.\r\n * The higher the faster.\r\n */\r\n public get touchMoveSensibility(): number {\r\n const touch = <FreeCameraTouchInput>this.inputs.attached[\"touch\"];\r\n if (touch) {\r\n return touch.touchMoveSensibility;\r\n }\r\n\r\n return 0;\r\n }\r\n\r\n public set touchMoveSensibility(value: number) {\r\n const touch = <FreeCameraTouchInput>this.inputs.attached[\"touch\"];\r\n if (touch) {\r\n touch.touchMoveSensibility = value;\r\n }\r\n }\r\n\r\n /**\r\n * Instantiates a new touch camera.\r\n * This represents a FPS type of camera controlled by touch.\r\n * This is like a universal camera minus the Gamepad controls.\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/camera_introduction#universal-camera\r\n * @param name Define the name of the camera in the scene\r\n * @param position Define the start position of the camera in the scene\r\n * @param scene Define the scene the camera belongs to\r\n */\r\n constructor(name: string, position: Vector3, scene?: Scene) {\r\n super(name, position, scene);\r\n this.inputs.addTouch();\r\n\r\n this._setupInputs();\r\n }\r\n\r\n /**\r\n * Gets the current object class name.\r\n * @returns the class name\r\n */\r\n public override getClassName(): string {\r\n return \"TouchCamera\";\r\n }\r\n\r\n /** @internal */\r\n public override _setupInputs() {\r\n const touch = <FreeCameraTouchInput>this.inputs.attached[\"touch\"];\r\n const mouse = <FreeCameraMouseInput>this.inputs.attached[\"mouse\"];\r\n if (mouse) {\r\n mouse.touchEnabled = false;\r\n } else {\r\n touch.allowMouse = true;\r\n }\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"touchCamera.js","sourceRoot":"","sources":["../../../../dev/core/src/Cameras/touchCamera.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAI1C,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAE/B,IAAI,CAAC,kBAAkB,CAAC,aAAa,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;IACnD,OAAO,GAAG,EAAE,CAAC,IAAI,WAAW,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,EAAE,KAAK,CAAC,CAAC;AAC9D,CAAC,CAAC,CAAC;AAEH;;;;GAIG;AACH,MAAM,OAAO,WAAY,SAAQ,UAAU;IACvC;;;OAGG;IACH,IAAW,uBAAuB;QAC9B,MAAM,KAAK,GAAyB,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAClE,IAAI,KAAK,EAAE;YACP,OAAO,KAAK,CAAC,uBAAuB,CAAC;SACxC;QAED,OAAO,CAAC,CAAC;IACb,CAAC;IAED,IAAW,uBAAuB,CAAC,KAAa;QAC5C,MAAM,KAAK,GAAyB,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAClE,IAAI,KAAK,EAAE;YACP,KAAK,CAAC,uBAAuB,GAAG,KAAK,CAAC;SACzC;IACL,CAAC;IAED;;;OAGG;IACH,IAAW,oBAAoB;QAC3B,MAAM,KAAK,GAAyB,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAClE,IAAI,KAAK,EAAE;YACP,OAAO,KAAK,CAAC,oBAAoB,CAAC;SACrC;QAED,OAAO,CAAC,CAAC;IACb,CAAC;IAED,IAAW,oBAAoB,CAAC,KAAa;QACzC,MAAM,KAAK,GAAyB,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAClE,IAAI,KAAK,EAAE;YACP,KAAK,CAAC,oBAAoB,GAAG,KAAK,CAAC;SACtC;IACL,CAAC;IAED;;;;;;;;OAQG;IACH,YAAY,IAAY,EAAE,QAAiB,EAAE,KAAa;QACtD,KAAK,CAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;QAC7B,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;QAEvB,IAAI,CAAC,YAAY,EAAE,CAAC;IACxB,CAAC;IAED;;;OAGG;IACa,YAAY;QACxB,OAAO,aAAa,CAAC;IACzB,CAAC;IAED,gBAAgB;IACA,YAAY;QACxB,MAAM,KAAK,GAAyB,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAClE,MAAM,KAAK,GAAyB,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAClE,IAAI,KAAK,EAAE;YACP,6DAA6D;YAC7D,KAAK,CAAC,YAAY,GAAG,CAAC,KAAK,CAAC;SAC/B;aAAM;YACH,8DAA8D;YAC9D,KAAK,CAAC,UAAU,GAAG,CAAC,KAAK,CAAC;SAC7B;IACL,CAAC;CACJ","sourcesContent":["import { FreeCamera } from \"./freeCamera\";\r\nimport type { FreeCameraTouchInput } from \"../Cameras/Inputs/freeCameraTouchInput\";\r\nimport type { FreeCameraMouseInput } from \"../Cameras/Inputs/freeCameraMouseInput\";\r\nimport type { Scene } from \"../scene\";\r\nimport { Vector3 } from \"../Maths/math.vector\";\r\nimport { Node } from \"../node\";\r\n\r\nNode.AddNodeConstructor(\"TouchCamera\", (name, scene) => {\r\n return () => new TouchCamera(name, Vector3.Zero(), scene);\r\n});\r\n\r\n/**\r\n * This represents a FPS type of camera controlled by touch.\r\n * This is like a universal camera minus the Gamepad controls.\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/camera_introduction#universal-camera\r\n */\r\nexport class TouchCamera extends FreeCamera {\r\n /**\r\n * Defines the touch sensibility for rotation.\r\n * The higher the faster.\r\n */\r\n public get touchAngularSensibility(): number {\r\n const touch = <FreeCameraTouchInput>this.inputs.attached[\"touch\"];\r\n if (touch) {\r\n return touch.touchAngularSensibility;\r\n }\r\n\r\n return 0;\r\n }\r\n\r\n public set touchAngularSensibility(value: number) {\r\n const touch = <FreeCameraTouchInput>this.inputs.attached[\"touch\"];\r\n if (touch) {\r\n touch.touchAngularSensibility = value;\r\n }\r\n }\r\n\r\n /**\r\n * Defines the touch sensibility for move.\r\n * The higher the faster.\r\n */\r\n public get touchMoveSensibility(): number {\r\n const touch = <FreeCameraTouchInput>this.inputs.attached[\"touch\"];\r\n if (touch) {\r\n return touch.touchMoveSensibility;\r\n }\r\n\r\n return 0;\r\n }\r\n\r\n public set touchMoveSensibility(value: number) {\r\n const touch = <FreeCameraTouchInput>this.inputs.attached[\"touch\"];\r\n if (touch) {\r\n touch.touchMoveSensibility = value;\r\n }\r\n }\r\n\r\n /**\r\n * Instantiates a new touch camera.\r\n * This represents a FPS type of camera controlled by touch.\r\n * This is like a universal camera minus the Gamepad controls.\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/camera_introduction#universal-camera\r\n * @param name Define the name of the camera in the scene\r\n * @param position Define the start position of the camera in the scene\r\n * @param scene Define the scene the camera belongs to\r\n */\r\n constructor(name: string, position: Vector3, scene?: Scene) {\r\n super(name, position, scene);\r\n this.inputs.addTouch();\r\n\r\n this._setupInputs();\r\n }\r\n\r\n /**\r\n * Gets the current object class name.\r\n * @returns the class name\r\n */\r\n public override getClassName(): string {\r\n return \"TouchCamera\";\r\n }\r\n\r\n /** @internal */\r\n public override _setupInputs() {\r\n const touch = <FreeCameraTouchInput>this.inputs.attached[\"touch\"];\r\n const mouse = <FreeCameraMouseInput>this.inputs.attached[\"mouse\"];\r\n if (mouse) {\r\n // enable touch in mouse input if touch module is not enabled\r\n mouse.touchEnabled = !touch;\r\n } else {\r\n // allow mouse in touch input if mouse module is not available\r\n touch.allowMouse = !mouse;\r\n }\r\n }\r\n}\r\n"]}
@@ -745,13 +745,13 @@ export class AbstractEngine {
745
745
  */
746
746
  // Not mixed with Version for tooling purpose.
747
747
  static get NpmPackage() {
748
- return "babylonjs@7.8.1";
748
+ return "babylonjs@7.9.0";
749
749
  }
750
750
  /**
751
751
  * Returns the current version of the framework
752
752
  */
753
753
  static get Version() {
754
- return "7.8.1";
754
+ return "7.9.0";
755
755
  }
756
756
  /**
757
757
  * Gets the HTML canvas attached with the current webGL context
@@ -1444,6 +1444,7 @@ export class AbstractEngine {
1444
1444
  // no more engines left in the engine store? Notify!
1445
1445
  if (!EngineStore.Instances.length) {
1446
1446
  EngineStore.OnEnginesDisposedObservable.notifyObservers(this);
1447
+ EngineStore.OnEnginesDisposedObservable.clear();
1447
1448
  }
1448
1449
  // Observables
1449
1450
  this.onBeginFrameObservable.clear();