@gg-web-engine/ammo 0.0.40 → 0.0.49
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/build_gg_ammo/Makefile +2 -2
- package/build_gg_ammo/README.md +0 -0
- package/build_gg_ammo/ammo_patches.txt +0 -0
- package/build_gg_ammo/bullet_patches.txt +0 -0
- package/build_gg_ammo/patch_files/ammo.idl +0 -0
- package/dist/ammo-factory.d.ts +0 -0
- package/dist/ammo-factory.js +30 -15
- package/dist/ammo-loader.d.ts +0 -0
- package/dist/ammo-loader.js +0 -0
- package/dist/ammo.js/ammo-ambient.d.ts +0 -0
- package/dist/ammo.js/ammo.d.ts +0 -0
- package/dist/ammo.js/ammo.js +22 -22
- package/dist/ammo.js/ammo.wasm.js +1299 -1300
- package/dist/ammo.js/ammo.wasm.wasm +0 -0
- package/dist/components/ammo-body.component.d.ts +0 -0
- package/dist/components/ammo-body.component.js +10 -10
- package/dist/components/ammo-raycast-vehicle.component.d.ts +0 -0
- package/dist/components/ammo-raycast-vehicle.component.js +14 -14
- package/dist/components/ammo-rigid-body.component.d.ts +0 -0
- package/dist/components/ammo-rigid-body.component.js +7 -7
- package/dist/components/ammo-trigger.component.d.ts +0 -0
- package/dist/components/ammo-trigger.component.js +9 -9
- package/dist/components/ammo-world.component.d.ts +2 -0
- package/dist/components/ammo-world.component.js +15 -13
- package/dist/index.d.ts +0 -0
- package/dist/index.js +0 -0
- package/dist/types.d.ts +1 -1
- package/dist/types.js +0 -0
- package/package.json +9 -9
- package/test/components/ammo-trigger.component.spec.ts +0 -0
- package/tsconfig.json +0 -0
package/README.md
CHANGED
|
File without changes
|
package/build_gg_ammo/Makefile
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Define variables
|
|
2
|
-
AMMOJS_GIT_REPO=https://github.com/
|
|
3
|
-
AMMOJS_GIT_COMMIT=
|
|
2
|
+
AMMOJS_GIT_REPO=https://github.com/AndyGura/ammo.js.git
|
|
3
|
+
AMMOJS_GIT_COMMIT=c3d7c801e49c0f41273874e643da4794e1915bf8
|
|
4
4
|
BULLET_GIT_REPO=https://github.com/bulletphysics/bullet3.git
|
|
5
5
|
BULLET_GIT_COMMIT=2c204c49e56ed15ec5fcfa71d199ab6d6570b3f5 # 3.25 release
|
|
6
6
|
REPLACE_SRC_DIR=./patch_files
|
package/build_gg_ammo/README.md
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/ammo-factory.d.ts
CHANGED
|
File without changes
|
package/dist/ammo-factory.js
CHANGED
|
@@ -17,21 +17,28 @@ export class AmmoFactory {
|
|
|
17
17
|
return new AmmoRaycastVehicleComponent(this.world, chassis);
|
|
18
18
|
}
|
|
19
19
|
createShape(descriptor) {
|
|
20
|
+
let shape;
|
|
20
21
|
switch (descriptor.shape) {
|
|
21
22
|
case 'PLANE':
|
|
22
|
-
|
|
23
|
+
shape = new Ammo.btStaticPlaneShape(new Ammo.btVector3(0, 0, 1), 0);
|
|
24
|
+
break;
|
|
23
25
|
case 'BOX':
|
|
24
|
-
|
|
26
|
+
shape = new Ammo.btBoxShape(new Ammo.btVector3(descriptor.dimensions.x / 2, descriptor.dimensions.y / 2, descriptor.dimensions.z / 2));
|
|
27
|
+
break;
|
|
25
28
|
case 'CAPSULE':
|
|
26
|
-
|
|
29
|
+
shape = new Ammo.btCapsuleShapeZ(descriptor.radius, descriptor.centersDistance);
|
|
30
|
+
break;
|
|
27
31
|
case 'CYLINDER':
|
|
28
|
-
|
|
32
|
+
shape = new Ammo.btCylinderShapeZ(new Ammo.btVector3(descriptor.radius, descriptor.radius, descriptor.height / 2));
|
|
33
|
+
break;
|
|
29
34
|
case 'CONE':
|
|
30
|
-
|
|
35
|
+
shape = new Ammo.btConeShapeZ(descriptor.radius, descriptor.height);
|
|
36
|
+
break;
|
|
31
37
|
case 'SPHERE':
|
|
32
|
-
|
|
38
|
+
shape = new Ammo.btSphereShape(descriptor.radius);
|
|
39
|
+
break;
|
|
33
40
|
case 'COMPOUND':
|
|
34
|
-
|
|
41
|
+
let cs = new Ammo.btCompoundShape();
|
|
35
42
|
for (const item of descriptor.children) {
|
|
36
43
|
const subShape = this.createShape(item.shape);
|
|
37
44
|
if (!subShape) {
|
|
@@ -42,19 +49,21 @@ export class AmmoFactory {
|
|
|
42
49
|
const rot = item.rotation || Qtrn.O;
|
|
43
50
|
subShapeTransform.setOrigin(new Ammo.btVector3(pos.x, pos.y, pos.z));
|
|
44
51
|
subShapeTransform.setRotation(new Ammo.btQuaternion(rot.x, rot.y, rot.z, rot.w));
|
|
45
|
-
|
|
52
|
+
cs.addChildShape(subShapeTransform, subShape);
|
|
46
53
|
}
|
|
47
|
-
|
|
54
|
+
shape = cs;
|
|
55
|
+
break;
|
|
48
56
|
case 'CONVEX_HULL':
|
|
49
|
-
const
|
|
57
|
+
const s = new Ammo.btConvexHullShape();
|
|
50
58
|
const tmpVector = new Ammo.btVector3();
|
|
51
59
|
for (const v of descriptor.vertices) {
|
|
52
60
|
tmpVector.setValue(v.x, v.y, v.z);
|
|
53
|
-
|
|
61
|
+
s.addPoint(tmpVector);
|
|
54
62
|
}
|
|
55
63
|
Ammo.destroy(tmpVector);
|
|
56
|
-
|
|
57
|
-
|
|
64
|
+
s.recalcLocalAabb();
|
|
65
|
+
shape = s;
|
|
66
|
+
break;
|
|
58
67
|
case 'MESH':
|
|
59
68
|
const mesh = new Ammo.btTriangleMesh(true, true);
|
|
60
69
|
const tmpVectors = [
|
|
@@ -71,9 +80,15 @@ export class AmmoFactory {
|
|
|
71
80
|
tmpVectors.forEach(v => {
|
|
72
81
|
Ammo.destroy(v);
|
|
73
82
|
});
|
|
74
|
-
|
|
83
|
+
shape = new Ammo.btBvhTriangleMeshShape(mesh, false, true);
|
|
84
|
+
break;
|
|
85
|
+
default:
|
|
86
|
+
throw new Error(`Shape "${descriptor.shape}" not implemented for Ammo.js`);
|
|
75
87
|
}
|
|
76
|
-
|
|
88
|
+
if (descriptor.collisionMargin) {
|
|
89
|
+
shape.setMargin(descriptor.collisionMargin);
|
|
90
|
+
}
|
|
91
|
+
return shape;
|
|
77
92
|
}
|
|
78
93
|
createRigidBodyFromShape(nativeShape, shapeDescr, options, transform) {
|
|
79
94
|
if (options.dynamic === false) {
|
package/dist/ammo-loader.d.ts
CHANGED
|
File without changes
|
package/dist/ammo-loader.js
CHANGED
|
File without changes
|
|
File without changes
|
package/dist/ammo.js/ammo.d.ts
CHANGED
|
File without changes
|