@gg-web-engine/matter 0.0.24 → 0.0.28

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.
@@ -7,6 +7,10 @@ export declare class MatterRigidBodyComponent implements IRigidBody2dComponent<M
7
7
  set position(value: Point2);
8
8
  get rotation(): number;
9
9
  set rotation(value: number);
10
+ get linearVelocity(): Point2;
11
+ set linearVelocity(value: Point2);
12
+ get angularVelocity(): number;
13
+ set angularVelocity(value: number);
10
14
  name: string;
11
15
  entity: Entity2d | null;
12
16
  constructor(nativeBody: Body);
@@ -18,6 +18,18 @@ export class MatterRigidBodyComponent {
18
18
  set rotation(value) {
19
19
  this.nativeBody.angle = value;
20
20
  }
21
+ get linearVelocity() {
22
+ return Pnt2.clone(this.nativeBody.velocity);
23
+ }
24
+ set linearVelocity(value) {
25
+ Body.setVelocity(this.nativeBody, Vector.create(value.x, value.y));
26
+ }
27
+ get angularVelocity() {
28
+ return this.nativeBody.angularVelocity;
29
+ }
30
+ set angularVelocity(value) {
31
+ Body.setAngularVelocity(this.nativeBody, value);
32
+ }
21
33
  clone() {
22
34
  // TODO
23
35
  throw new Error('Gg2dBody.clone() not implemented for Matter.js');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gg-web-engine/matter",
3
- "version": "0.0.24",
3
+ "version": "0.0.28",
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",
@@ -30,13 +30,13 @@
30
30
  },
31
31
  "devDependencies": {
32
32
  "@types/matter-js": "0.19.1",
33
- "@gg-web-engine/core": "0.0.24",
33
+ "@gg-web-engine/core": "0.0.28",
34
34
  "matter-js": "0.19.0",
35
35
  "prettier": "^2.8.6",
36
36
  "typescript": "~4.7.2"
37
37
  },
38
38
  "peerDependencies": {
39
- "@gg-web-engine/core": "0.0.24",
39
+ "@gg-web-engine/core": "0.0.28",
40
40
  "matter-js": "0.19.0"
41
41
  }
42
42
  }