@onerjs/core 8.25.7 → 8.25.8

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.
@@ -4,7 +4,7 @@ import { Node } from "../node.js";
4
4
  import { Vector3 } from "../Maths/math.vector.js";
5
5
  import { Camera } from "./camera.js";
6
6
  import "../Gamepads/gamepadSceneComponent.js";
7
- import { serializeAsVector3 } from "../Misc.js";
7
+ import { serializeAsVector3 } from "../Misc/decorators.js";
8
8
  Node.AddNodeConstructor("FreeCamera", (name, scene) => {
9
9
  // Forcing to use the Universal camera
10
10
  return () => new UniversalCamera(name, Vector3.Zero(), scene);
@@ -1 +1 @@
1
- {"version":3,"file":"universalCamera.js","sourceRoot":"","sources":["../../../../dev/core/src/Cameras/universalCamera.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAG/B,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,OAAO,mCAAmC,CAAC;AAC3C,OAAO,EAAE,kBAAkB,EAAE,mBAAkB;AAE/C,IAAI,CAAC,kBAAkB,CAAC,YAAY,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;IAClD,sCAAsC;IACtC,OAAO,GAAG,EAAE,CAAC,IAAI,eAAe,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,EAAE,KAAK,CAAC,CAAC;AAClE,CAAC,CAAC,CAAC;AAEH;;;;GAIG;AACH,MAAM,OAAO,eAAgB,SAAQ,WAAW;IAI5C;;;OAGG;IACH,IAAoB,MAAM;QACtB,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;IACD,IAAoB,MAAM,CAAC,KAAc;QACrC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IAC1B,CAAC;IACD;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,CAAC,MAAM,CAAC,CAAC;QACxB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IAC1B,CAAC;IACD;;;OAGG;IACM,SAAS;QACd,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;CACJ;AAxFa;IADT,kBAAkB,CAAC,QAAQ,CAAC;gDACe;AA0FhD,MAAM,CAAC,0BAA0B,GAAG,CAAC,IAAY,EAAE,KAAY,EAAE,EAAE;IAC/D,OAAO,IAAI,eAAe,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,EAAE,KAAK,CAAC,CAAC;AAC5D,CAAC,CAAC","sourcesContent":["import { TouchCamera } from \"./touchCamera\";\r\nimport { Node } from \"../node\";\r\nimport type { FreeCameraGamepadInput } from \"../Cameras/Inputs/freeCameraGamepadInput\";\r\nimport type { Scene } from \"../scene\";\r\nimport { Vector3 } from \"../Maths/math.vector\";\r\nimport { Camera } from \"./camera\";\r\n\r\nimport \"../Gamepads/gamepadSceneComponent\";\r\nimport { serializeAsVector3 } from \"core/Misc\";\r\n\r\nNode.AddNodeConstructor(\"FreeCamera\", (name, scene) => {\r\n // Forcing to use the Universal camera\r\n return () => new UniversalCamera(name, Vector3.Zero(), scene);\r\n});\r\n\r\n/**\r\n * The Universal Camera is the one to choose for first person shooter type games, and works with all the keyboard, mouse, touch and gamepads. This replaces the earlier Free Camera,\r\n * which still works and will still be found in many Playgrounds.\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/camera_introduction#universal-camera\r\n */\r\nexport class UniversalCamera extends TouchCamera {\r\n @serializeAsVector3(\"target\")\r\n protected _target: Vector3 = Vector3.Zero();\r\n\r\n /**\r\n * Defines the target point of the camera.\r\n * The camera looks towards it from the radius distance.\r\n */\r\n public override get target(): Vector3 {\r\n return this._target;\r\n }\r\n public override set target(value: Vector3) {\r\n this.setTarget(value);\r\n }\r\n /**\r\n * Defines the gamepad rotation sensibility.\r\n * This is the threshold from when rotation starts to be accounted for to prevent jittering.\r\n */\r\n public get gamepadAngularSensibility(): number {\r\n const gamepad = <FreeCameraGamepadInput>this.inputs.attached[\"gamepad\"];\r\n if (gamepad) {\r\n return gamepad.gamepadAngularSensibility;\r\n }\r\n\r\n return 0;\r\n }\r\n\r\n public set gamepadAngularSensibility(value: number) {\r\n const gamepad = <FreeCameraGamepadInput>this.inputs.attached[\"gamepad\"];\r\n if (gamepad) {\r\n gamepad.gamepadAngularSensibility = value;\r\n }\r\n }\r\n\r\n /**\r\n * Defines the gamepad move sensibility.\r\n * This is the threshold from when moving starts to be accounted for to prevent jittering.\r\n */\r\n public get gamepadMoveSensibility(): number {\r\n const gamepad = <FreeCameraGamepadInput>this.inputs.attached[\"gamepad\"];\r\n if (gamepad) {\r\n return gamepad.gamepadMoveSensibility;\r\n }\r\n\r\n return 0;\r\n }\r\n\r\n public set gamepadMoveSensibility(value: number) {\r\n const gamepad = <FreeCameraGamepadInput>this.inputs.attached[\"gamepad\"];\r\n if (gamepad) {\r\n gamepad.gamepadMoveSensibility = value;\r\n }\r\n }\r\n\r\n /**\r\n * The Universal Camera is the one to choose for first person shooter type games, and works with all the keyboard, mouse, touch and gamepads. This replaces the earlier Free Camera,\r\n * which still works and will still be found in many Playgrounds.\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.addGamepad();\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 \"UniversalCamera\";\r\n }\r\n\r\n /**\r\n * Defines the target the camera should look at.\r\n * @param target Defines the new target as a Vector\r\n */\r\n override setTarget(target: Vector3) {\r\n super.setTarget(target);\r\n this._target = target;\r\n }\r\n /**\r\n * Return the current target position of the camera. This value is expressed in local space.\r\n * @returns the target position\r\n */\r\n override getTarget(): Vector3 {\r\n return this._target;\r\n }\r\n}\r\n\r\nCamera._CreateDefaultParsedCamera = (name: string, scene: Scene) => {\r\n return new UniversalCamera(name, Vector3.Zero(), scene);\r\n};\r\n"]}
1
+ {"version":3,"file":"universalCamera.js","sourceRoot":"","sources":["../../../../dev/core/src/Cameras/universalCamera.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAG/B,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,OAAO,mCAAmC,CAAC;AAC3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAExD,IAAI,CAAC,kBAAkB,CAAC,YAAY,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;IAClD,sCAAsC;IACtC,OAAO,GAAG,EAAE,CAAC,IAAI,eAAe,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,EAAE,KAAK,CAAC,CAAC;AAClE,CAAC,CAAC,CAAC;AAEH;;;;GAIG;AACH,MAAM,OAAO,eAAgB,SAAQ,WAAW;IAI5C;;;OAGG;IACH,IAAoB,MAAM;QACtB,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;IACD,IAAoB,MAAM,CAAC,KAAc;QACrC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IAC1B,CAAC;IACD;;;OAGG;IACH,IAAW,yBAAyB;QAChC,MAAM,OAAO,GAA2B,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;QACxE,IAAI,OAAO,EAAE,CAAC;YACV,OAAO,OAAO,CAAC,yBAAyB,CAAC;QAC7C,CAAC;QAED,OAAO,CAAC,CAAC;IACb,CAAC;IAED,IAAW,yBAAyB,CAAC,KAAa;QAC9C,MAAM,OAA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AE;IAC/D,OAAO,IAAI,eAAe,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,EAAE,KAAK,CAAC,CAAC;AAC5D,CAAC,CAAC","sourcesContent":["import { TouchCamera } from \"./touchCamera\";\r\nimport { Node } from \"../node\";\r\nimport type { FreeCameraGamepadInput } from \"../Cameras/Inputs/freeCameraGamepadInput\";\r\nimport type { Scene } from \"../scene\";\r\nimport { Vector3 } from \"../Maths/math.vector\";\r\nimport { Camera } from \"./camera\";\r\n\r\nimport \"../Gamepads/gamepadSceneComponent\";\r\nimport { serializeAsVector3 } from \"../Misc/decorators\";\r\n\r\nNode.AddNodeConstructor(\"FreeCamera\", (name, scene) => {\r\n // Forcing to use the Universal camera\r\n return () => new UniversalCamera(name, Vector3.Zero(), scene);\r\n});\r\n\r\n/**\r\n * The Universal Camera is the one to choose for first person shooter type games, and works with all the keyboard, mouse, touch and gamepads. This replaces the earlier Free Camera,\r\n * which still works and will still be found in many Playgrounds.\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/camera_introduction#universal-camera\r\n */\r\nexport class UniversalCamera extends TouchCamera {\r\n @serializeAsVector3(\"target\")\r\n protected _target: Vector3 = Vector3.Zero();\r\n\r\n /**\r\n * Defines the target point of the camera.\r\n * The camera looks towards it from the radius distance.\r\n */\r\n public override get target(): Vector3 {\r\n return this._target;\r\n }\r\n public override set target(value: Vector3) {\r\n this.setTarget(value);\r\n }\r\n /**\r\n * Defines the gamepad rotation sensibility.\r\n * This is the threshold from when rotation starts to be accounted for to prevent jittering.\r\n */\r\n public get gamepadAngularSensibility(): number {\r\n const gamepad = <FreeCameraGamepadInput>this.inputs.attached[\"gamepad\"];\r\n if (gamepad) {\r\n return gamepad.gamepadAngularSensibility;\r\n }\r\n\r\n return 0;\r\n }\r\n\r\n public set gamepadAngularSensibility(value: number) {\r\n const gamepad = <FreeCameraGamepadInput>this.inputs.attached[\"gamepad\"];\r\n if (gamepad) {\r\n gamepad.gamepadAngularSensibility = value;\r\n }\r\n }\r\n\r\n /**\r\n * Defines the gamepad move sensibility.\r\n * This is the threshold from when moving starts to be accounted for to prevent jittering.\r\n */\r\n public get gamepadMoveSensibility(): number {\r\n const gamepad = <FreeCameraGamepadInput>this.inputs.attached[\"gamepad\"];\r\n if (gamepad) {\r\n return gamepad.gamepadMoveSensibility;\r\n }\r\n\r\n return 0;\r\n }\r\n\r\n public set gamepadMoveSensibility(value: number) {\r\n const gamepad = <FreeCameraGamepadInput>this.inputs.attached[\"gamepad\"];\r\n if (gamepad) {\r\n gamepad.gamepadMoveSensibility = value;\r\n }\r\n }\r\n\r\n /**\r\n * The Universal Camera is the one to choose for first person shooter type games, and works with all the keyboard, mouse, touch and gamepads. This replaces the earlier Free Camera,\r\n * which still works and will still be found in many Playgrounds.\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.addGamepad();\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 \"UniversalCamera\";\r\n }\r\n\r\n /**\r\n * Defines the target the camera should look at.\r\n * @param target Defines the new target as a Vector\r\n */\r\n override setTarget(target: Vector3) {\r\n super.setTarget(target);\r\n this._target = target;\r\n }\r\n /**\r\n * Return the current target position of the camera. This value is expressed in local space.\r\n * @returns the target position\r\n */\r\n override getTarget(): Vector3 {\r\n return this._target;\r\n }\r\n}\r\n\r\nCamera._CreateDefaultParsedCamera = (name: string, scene: Scene) => {\r\n return new UniversalCamera(name, Vector3.Zero(), scene);\r\n};\r\n"]}
@@ -113,7 +113,7 @@ export declare function CreateGreasedLineMaterial(name: string, options: Greased
113
113
  * @param scene scene where the mesh will be created
114
114
  * @returns instance of GreasedLineMesh
115
115
  */
116
- export declare function CreateGreasedLine(name: string, options: GreasedLineMeshBuilderOptions, materialOptions?: Nullable<GreasedLineMaterialBuilderOptions>, scene?: Nullable<Scene>): GreasedLineMesh | import("../GreasedLine/greasedLineBaseMesh.js").GreasedLineBaseMesh | GreasedLineRibbonMesh;
116
+ export declare function CreateGreasedLine(name: string, options: GreasedLineMeshBuilderOptions, materialOptions?: Nullable<GreasedLineMaterialBuilderOptions>, scene?: Nullable<Scene>): import("../GreasedLine/greasedLineBaseMesh.js").GreasedLineBaseMesh | GreasedLineMesh | GreasedLineRibbonMesh;
117
117
  /**
118
118
  * Counts the number of points
119
119
  * @param allPoints Array of points [[x, y, z], [x, y, z], ...] or Array of points [x, y, z, x, y, z, ...]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onerjs/core",
3
- "version": "8.25.7",
3
+ "version": "8.25.8",
4
4
  "main": "index.js",
5
5
  "module": "index.js",
6
6
  "types": "index.d.ts",