@gg-web-engine/matter 0.0.40 → 0.0.48
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 +0 -0
- package/dist/components/matter-rigid-body.component.d.ts +0 -0
- package/dist/components/matter-rigid-body.component.js +6 -6
- package/dist/components/matter-world.component.d.ts +0 -0
- package/dist/components/matter-world.component.js +10 -10
- package/dist/index.d.ts +0 -0
- package/dist/index.js +0 -0
- package/dist/matter-factory.d.ts +0 -0
- package/dist/matter-factory.js +0 -0
- package/dist/types.d.ts +1 -1
- package/dist/types.js +0 -0
- package/package.json +8 -8
- package/tsconfig.json +0 -0
package/README.md
CHANGED
|
File without changes
|
|
File without changes
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
import { Pnt2, } from '@gg-web-engine/core';
|
|
2
2
|
import { Body, Composite, Vector } from 'matter-js';
|
|
3
3
|
export class MatterRigidBodyComponent {
|
|
4
|
-
constructor(nativeBody, shape) {
|
|
5
|
-
this.nativeBody = nativeBody;
|
|
6
|
-
this.shape = shape;
|
|
7
|
-
this.name = '';
|
|
8
|
-
this.entity = null;
|
|
9
|
-
}
|
|
10
4
|
get position() {
|
|
11
5
|
return this.nativeBody.position;
|
|
12
6
|
}
|
|
@@ -39,6 +33,12 @@ export class MatterRigidBodyComponent {
|
|
|
39
33
|
return { shape: this.shape, type: 'RIGID_STATIC' };
|
|
40
34
|
}
|
|
41
35
|
}
|
|
36
|
+
constructor(nativeBody, shape) {
|
|
37
|
+
this.nativeBody = nativeBody;
|
|
38
|
+
this.shape = shape;
|
|
39
|
+
this.name = '';
|
|
40
|
+
this.entity = null;
|
|
41
|
+
}
|
|
42
42
|
get interactWithCollisionGroups() {
|
|
43
43
|
throw new Error('Collision groups not implemented for Matter.js');
|
|
44
44
|
}
|
|
File without changes
|
|
@@ -12,16 +12,6 @@ import { MatterFactory } from '../matter-factory';
|
|
|
12
12
|
import { Subject } from 'rxjs';
|
|
13
13
|
// TODO implement bindings for collision groups. Matter.js has elegant solution for that, read body.collisionFilter
|
|
14
14
|
export class MatterWorldComponent {
|
|
15
|
-
constructor() {
|
|
16
|
-
this.matterEngine = null;
|
|
17
|
-
this.factory = new MatterFactory();
|
|
18
|
-
this.added$ = new Subject();
|
|
19
|
-
this.removed$ = new Subject();
|
|
20
|
-
this.children = [];
|
|
21
|
-
this._gravity = { x: 0, y: 9.82 };
|
|
22
|
-
this.added$.subscribe(c => this.children.push(c));
|
|
23
|
-
this.removed$.subscribe(c => this.children.splice(this.children.indexOf(c), 1));
|
|
24
|
-
}
|
|
25
15
|
get matterWorld() {
|
|
26
16
|
return this.matterEngine && this.matterEngine.world;
|
|
27
17
|
}
|
|
@@ -35,6 +25,16 @@ export class MatterWorldComponent {
|
|
|
35
25
|
this.matterEngine.gravity.y = this._gravity.y;
|
|
36
26
|
}
|
|
37
27
|
}
|
|
28
|
+
constructor() {
|
|
29
|
+
this.matterEngine = null;
|
|
30
|
+
this.factory = new MatterFactory();
|
|
31
|
+
this.added$ = new Subject();
|
|
32
|
+
this.removed$ = new Subject();
|
|
33
|
+
this.children = [];
|
|
34
|
+
this._gravity = { x: 0, y: 9.82 };
|
|
35
|
+
this.added$.subscribe(c => this.children.push(c));
|
|
36
|
+
this.removed$.subscribe(c => this.children.splice(this.children.indexOf(c), 1));
|
|
37
|
+
}
|
|
38
38
|
init() {
|
|
39
39
|
return __awaiter(this, void 0, void 0, function* () {
|
|
40
40
|
this.matterEngine = Engine.create({ gravity: Object.assign(Object.assign({}, this._gravity), { scale: 0.0001 }) });
|
package/dist/index.d.ts
CHANGED
|
File without changes
|
package/dist/index.js
CHANGED
|
File without changes
|
package/dist/matter-factory.d.ts
CHANGED
|
File without changes
|
package/dist/matter-factory.js
CHANGED
|
File without changes
|
package/dist/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MatterFactory } from './matter-factory';
|
|
2
2
|
import { MatterRigidBodyComponent } from './components/matter-rigid-body.component';
|
|
3
|
-
export
|
|
3
|
+
export type MatterPhysicsTypeDocRepo = {
|
|
4
4
|
factory: MatterFactory;
|
|
5
5
|
rigidBody: MatterRigidBodyComponent;
|
|
6
6
|
trigger: never;
|
package/dist/types.js
CHANGED
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gg-web-engine/matter",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.48",
|
|
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",
|
|
@@ -29,16 +29,16 @@
|
|
|
29
29
|
"dependencies": {
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@types/matter-js": "0.19.
|
|
33
|
-
"@gg-web-engine/core": "0.0.
|
|
34
|
-
"matter-js": "0.
|
|
35
|
-
"prettier": "^
|
|
32
|
+
"@types/matter-js": "0.19.7",
|
|
33
|
+
"@gg-web-engine/core": "0.0.48",
|
|
34
|
+
"matter-js": "0.20.0",
|
|
35
|
+
"prettier": "^3.3.3",
|
|
36
36
|
"rxjs": "7.8.1",
|
|
37
|
-
"typescript": "~
|
|
37
|
+
"typescript": "~5.5.4"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
|
-
"@gg-web-engine/core": "0.0.
|
|
41
|
-
"matter-js": "0.
|
|
40
|
+
"@gg-web-engine/core": "0.0.48",
|
|
41
|
+
"matter-js": "0.20.0",
|
|
42
42
|
"rxjs": "7.8.1"
|
|
43
43
|
}
|
|
44
44
|
}
|
package/tsconfig.json
CHANGED
|
File without changes
|