@gg-web-engine/ammo 0.0.18 → 0.0.20

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.
@@ -1,3 +1,4 @@
1
+ import { Pnt3, Qtrn, } from '@gg-web-engine/core';
1
2
  import { Gg3dBody } from './bodies/gg-3d-body';
2
3
  import { Gg3dTrigger } from './bodies/gg-3d-trigger';
3
4
  export class Gg3dBodyFactory {
@@ -30,8 +31,8 @@ export class Gg3dBodyFactory {
30
31
  continue;
31
32
  }
32
33
  const subShapeTransform = new this.world.ammo.btTransform();
33
- const pos = item.position || { x: 0, y: 0, z: 0 };
34
- const rot = item.rotation || { x: 0, y: 0, z: 0, w: 1 };
34
+ const pos = item.position || Pnt3.O;
35
+ const rot = item.rotation || Qtrn.O;
35
36
  subShapeTransform.setOrigin(new this.world.ammo.btVector3(pos.x, pos.y, pos.z));
36
37
  subShapeTransform.setRotation(new this.world.ammo.btQuaternion(rot.x, rot.y, rot.z, rot.w));
37
38
  compoundShape.addChildShape(subShapeTransform, subShape);
@@ -71,8 +72,8 @@ export class Gg3dBodyFactory {
71
72
  if (options.dynamic === false) {
72
73
  options.mass = 0;
73
74
  }
74
- const pos = (transform === null || transform === void 0 ? void 0 : transform.position) || { x: 0, y: 0, z: 0 };
75
- const rot = (transform === null || transform === void 0 ? void 0 : transform.rotation) || { x: 0, y: 0, z: 0, w: 1 };
75
+ const pos = (transform === null || transform === void 0 ? void 0 : transform.position) || Pnt3.O;
76
+ const rot = (transform === null || transform === void 0 ? void 0 : transform.rotation) || Qtrn.O;
76
77
  const ammo = this.world.ammo;
77
78
  const ammoTransform = new ammo.btTransform();
78
79
  ammoTransform.setOrigin(new ammo.btVector3(pos.x, pos.y, pos.z));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gg-web-engine/ammo",
3
- "version": "0.0.18",
3
+ "version": "0.0.20",
4
4
  "description": "An attempt to create open source game engine for browser",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -34,14 +34,14 @@
34
34
  "dependencies": {
35
35
  },
36
36
  "devDependencies": {
37
- "@gg-web-engine/core": "^0.0.18",
37
+ "@gg-web-engine/core": "^0.0.20",
38
38
  "ammojs-typed": "^1.0.6",
39
39
  "mini-signals": "^1.2.0",
40
40
  "prettier": "^2.8.6",
41
41
  "typescript": "~4.7.2"
42
42
  },
43
43
  "peerDependencies": {
44
- "@gg-web-engine/core": "^0.0.18",
44
+ "@gg-web-engine/core": "^0.0.20",
45
45
  "ammojs-typed": "^1.0.6",
46
46
  "mini-signals": "^1.2.0"
47
47
  }