@gg-web-engine/ammo 0.0.2 → 0.0.4
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
CHANGED
|
@@ -9,7 +9,13 @@
|
|
|
9
9
|
1) `npm install --save @gg-web-engine/ammo`
|
|
10
10
|
1) Add to your `tsconfig.json` in the record `compilerOptions.paths`:
|
|
11
11
|
```json lines
|
|
12
|
-
"mini-signals": ["./node_modules/mini-signals/index.js"]
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
"mini-signals": ["./node_modules/mini-signals/index.js"]
|
|
13
|
+
```
|
|
14
|
+
1) Add to your `package.json`:
|
|
15
|
+
```json lines
|
|
16
|
+
"browser": {
|
|
17
|
+
"fs": false,
|
|
18
|
+
"os": false,
|
|
19
|
+
"path": false
|
|
20
|
+
}
|
|
15
21
|
```
|
package/dist/ammo-debugger.d.ts
CHANGED
|
@@ -22,9 +22,9 @@ export declare enum AmmoDebugMode {
|
|
|
22
22
|
MAX_DEBUG_DRAW_MODE = 4294967295
|
|
23
23
|
}
|
|
24
24
|
export declare class AmmoDebugger implements Ammo.btIDebugDraw {
|
|
25
|
-
|
|
25
|
+
protected readonly world: Gg3dPhysicsWorld;
|
|
26
26
|
private readonly drawer;
|
|
27
|
-
|
|
27
|
+
protected debugMode: AmmoDebugMode;
|
|
28
28
|
constructor(world: Gg3dPhysicsWorld, drawer: GgDebugPhysicsDrawer<Point3, Point4>);
|
|
29
29
|
readonly ammoInstance: Ammo.btIDebugDraw;
|
|
30
30
|
draw3dText(location: Ammo.btVector3, textString: string): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Gg3dTriggerEntity, GgPositionable3dEntity, IGg3dTrigger } from '@gg-web-engine/core';
|
|
2
2
|
import { Gg3dPhysicsWorld } from '../gg-3d-physics-world';
|
|
3
|
-
import { Observable } from 'rxjs';
|
|
3
|
+
import { Observable, Subject } from 'rxjs';
|
|
4
4
|
import Ammo from 'ammojs-typed';
|
|
5
5
|
import { BaseAmmoGGBody } from './base-ammo-gg-body';
|
|
6
6
|
export declare class Gg3dTrigger extends BaseAmmoGGBody<Ammo.btPairCachingGhostObject> implements IGg3dTrigger {
|
|
@@ -10,9 +10,9 @@ export declare class Gg3dTrigger extends BaseAmmoGGBody<Ammo.btPairCachingGhostO
|
|
|
10
10
|
get onEntityEntered(): Observable<GgPositionable3dEntity>;
|
|
11
11
|
get onEntityLeft(): Observable<GgPositionable3dEntity | null>;
|
|
12
12
|
constructor(world: Gg3dPhysicsWorld, _nativeBody: Ammo.btPairCachingGhostObject);
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
protected readonly onEnter$: Subject<number>;
|
|
14
|
+
protected readonly onLeft$: Subject<number>;
|
|
15
|
+
protected readonly overlaps: Set<Ammo.btCollisionObject>;
|
|
16
16
|
checkOverlaps(): void;
|
|
17
17
|
clone(): Gg3dTrigger;
|
|
18
18
|
addToWorld(world: Gg3dPhysicsWorld): void;
|
|
@@ -4,7 +4,7 @@ import { Gg3dPhysicsWorld } from './gg-3d-physics-world';
|
|
|
4
4
|
import Ammo from 'ammojs-typed';
|
|
5
5
|
import { Gg3dTrigger } from './bodies/gg-3d-trigger';
|
|
6
6
|
export declare class Gg3dBodyFactory implements IGg3dBodyFactory<Gg3dBody, Gg3dTrigger> {
|
|
7
|
-
|
|
7
|
+
protected readonly world: Gg3dPhysicsWorld;
|
|
8
8
|
constructor(world: Gg3dPhysicsWorld);
|
|
9
9
|
createRigidBody(descriptor: BodyShape3DDescriptor, transform?: {
|
|
10
10
|
position?: Point3;
|
|
@@ -14,7 +14,7 @@ export declare class Gg3dBodyFactory implements IGg3dBodyFactory<Gg3dBody, Gg3dT
|
|
|
14
14
|
position?: Point3;
|
|
15
15
|
rotation?: Point4;
|
|
16
16
|
}): Gg3dTrigger;
|
|
17
|
-
|
|
17
|
+
protected createShape(descriptor: Shape3DDescriptor): Ammo.btCollisionShape;
|
|
18
18
|
createRigidBodyFromShape(shape: Ammo.btCollisionShape, options: Partial<Body3DOptions>, transform?: {
|
|
19
19
|
position?: Point3;
|
|
20
20
|
rotation?: Point4;
|
|
@@ -25,7 +25,7 @@ export declare class Gg3dPhysicsWorld implements IGg3dPhysicsWorld {
|
|
|
25
25
|
private broadphase;
|
|
26
26
|
private solver;
|
|
27
27
|
private gravityVector;
|
|
28
|
-
|
|
28
|
+
protected _dynamicAmmoWorld: Ammo.btDiscreteDynamicsWorld | undefined;
|
|
29
29
|
init(): Promise<void>;
|
|
30
30
|
simulate(delta: number): void;
|
|
31
31
|
startDebugger(world: Gg3dWorld, drawer: GgDebugPhysicsDrawer<Point3, Point4>): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gg-web-engine/ammo",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.04",
|
|
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",
|
|
@@ -26,12 +26,15 @@
|
|
|
26
26
|
"url": "https://github.com/AndyGura/gg-web-engine/issues"
|
|
27
27
|
},
|
|
28
28
|
"homepage": "https://github.com/AndyGura/gg-web-engine#readme",
|
|
29
|
+
"browser": {
|
|
30
|
+
"fs": false,
|
|
31
|
+
"os": false,
|
|
32
|
+
"path": false
|
|
33
|
+
},
|
|
29
34
|
"dependencies": {
|
|
30
|
-
"@gg-web-engine/core": "^0.0.
|
|
35
|
+
"@gg-web-engine/core": "^0.0.4",
|
|
31
36
|
"ammojs-typed": "^1.0.6",
|
|
32
|
-
"fs-web": "^1.0.1",
|
|
33
37
|
"mini-signals": "^1.2.0",
|
|
34
|
-
"path-browserify": "^1.0.1",
|
|
35
38
|
"rxjs": "~7.5.0"
|
|
36
39
|
},
|
|
37
40
|
"devDependencies": {
|