@flighthq/physics3d 0.4.0-edge.1908.751021c
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/dist/broadphase.d.ts +4 -0
- package/dist/broadphase.d.ts.map +1 -0
- package/dist/broadphase.js +158 -0
- package/dist/broadphase.js.map +1 -0
- package/dist/colliderCollision.d.ts +5 -0
- package/dist/colliderCollision.d.ts.map +1 -0
- package/dist/colliderCollision.js +55 -0
- package/dist/colliderCollision.js.map +1 -0
- package/dist/colliderTransform.d.ts +5 -0
- package/dist/colliderTransform.d.ts.map +1 -0
- package/dist/colliderTransform.js +424 -0
- package/dist/colliderTransform.js.map +1 -0
- package/dist/contactIntake.d.ts +5 -0
- package/dist/contactIntake.d.ts.map +1 -0
- package/dist/contactIntake.js +237 -0
- package/dist/contactIntake.js.map +1 -0
- package/dist/contacts.d.ts +4 -0
- package/dist/contacts.d.ts.map +1 -0
- package/dist/contacts.js +64 -0
- package/dist/contacts.js.map +1 -0
- package/dist/continuous.d.ts +5 -0
- package/dist/continuous.d.ts.map +1 -0
- package/dist/continuous.js +829 -0
- package/dist/continuous.js.map +1 -0
- package/dist/contract.d.ts +28 -0
- package/dist/contract.d.ts.map +1 -0
- package/dist/contract.js +28 -0
- package/dist/contract.js.map +1 -0
- package/dist/debugGeometry.d.ts +4 -0
- package/dist/debugGeometry.d.ts.map +1 -0
- package/dist/debugGeometry.js +333 -0
- package/dist/debugGeometry.js.map +1 -0
- package/dist/enablePhysics3DGuards.d.ts +4 -0
- package/dist/enablePhysics3DGuards.d.ts.map +1 -0
- package/dist/enablePhysics3DGuards.js +155 -0
- package/dist/enablePhysics3DGuards.js.map +1 -0
- package/dist/explainPhysics3DCollision.d.ts +3 -0
- package/dist/explainPhysics3DCollision.d.ts.map +1 -0
- package/dist/explainPhysics3DCollision.js +30 -0
- package/dist/explainPhysics3DCollision.js.map +1 -0
- package/dist/explainPhysics3DJoints.d.ts +3 -0
- package/dist/explainPhysics3DJoints.d.ts.map +1 -0
- package/dist/explainPhysics3DJoints.js +32 -0
- package/dist/explainPhysics3DJoints.js.map +1 -0
- package/dist/explainPhysics3DStep.d.ts +3 -0
- package/dist/explainPhysics3DStep.d.ts.map +1 -0
- package/dist/explainPhysics3DStep.js +51 -0
- package/dist/explainPhysics3DStep.js.map +1 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +22 -0
- package/dist/index.js.map +1 -0
- package/dist/integrate.d.ts +6 -0
- package/dist/integrate.d.ts.map +1 -0
- package/dist/integrate.js +184 -0
- package/dist/integrate.js.map +1 -0
- package/dist/islands.d.ts +6 -0
- package/dist/islands.d.ts.map +1 -0
- package/dist/islands.js +333 -0
- package/dist/islands.js.map +1 -0
- package/dist/jointBreakage.d.ts +5 -0
- package/dist/jointBreakage.d.ts.map +1 -0
- package/dist/jointBreakage.js +44 -0
- package/dist/jointBreakage.js.map +1 -0
- package/dist/jointCollisionSuppression.d.ts +4 -0
- package/dist/jointCollisionSuppression.d.ts.map +1 -0
- package/dist/jointCollisionSuppression.js +40 -0
- package/dist/jointCollisionSuppression.js.map +1 -0
- package/dist/jointFactories.d.ts +9 -0
- package/dist/jointFactories.d.ts.map +1 -0
- package/dist/jointFactories.js +159 -0
- package/dist/jointFactories.js.map +1 -0
- package/dist/jointMath.d.ts +17 -0
- package/dist/jointMath.d.ts.map +1 -0
- package/dist/jointMath.js +361 -0
- package/dist/jointMath.js.map +1 -0
- package/dist/jointReaction.d.ts +8 -0
- package/dist/jointReaction.d.ts.map +1 -0
- package/dist/jointReaction.js +65 -0
- package/dist/jointReaction.js.map +1 -0
- package/dist/jointRegistry.d.ts +8 -0
- package/dist/jointRegistry.d.ts.map +1 -0
- package/dist/jointRegistry.js +144 -0
- package/dist/jointRegistry.js.map +1 -0
- package/dist/jointRows.d.ts +33 -0
- package/dist/jointRows.d.ts.map +1 -0
- package/dist/jointRows.js +352 -0
- package/dist/jointRows.js.map +1 -0
- package/dist/joints.d.ts +16 -0
- package/dist/joints.d.ts.map +1 -0
- package/dist/joints.js +1060 -0
- package/dist/joints.js.map +1 -0
- package/dist/massProperties.d.ts +13 -0
- package/dist/massProperties.d.ts.map +1 -0
- package/dist/massProperties.js +462 -0
- package/dist/massProperties.js.map +1 -0
- package/dist/material.d.ts +3 -0
- package/dist/material.d.ts.map +1 -0
- package/dist/material.js +13 -0
- package/dist/material.js.map +1 -0
- package/dist/nodeSync.d.ts +3 -0
- package/dist/nodeSync.d.ts.map +1 -0
- package/dist/nodeSync.js +16 -0
- package/dist/nodeSync.js.map +1 -0
- package/dist/ownership.d.ts +8 -0
- package/dist/ownership.d.ts.map +1 -0
- package/dist/ownership.js +26 -0
- package/dist/ownership.js.map +1 -0
- package/dist/physics3DBroadphasePublication.d.ts +5 -0
- package/dist/physics3DBroadphasePublication.d.ts.map +1 -0
- package/dist/physics3DBroadphasePublication.js +49 -0
- package/dist/physics3DBroadphasePublication.js.map +1 -0
- package/dist/physics3DSpatialIndexingGuards.d.ts +4 -0
- package/dist/physics3DSpatialIndexingGuards.d.ts.map +1 -0
- package/dist/physics3DSpatialIndexingGuards.js +11 -0
- package/dist/physics3DSpatialIndexingGuards.js.map +1 -0
- package/dist/registerBuiltInPhysics3DJointSolvers.d.ts +3 -0
- package/dist/registerBuiltInPhysics3DJointSolvers.d.ts.map +1 -0
- package/dist/registerBuiltInPhysics3DJointSolvers.js +15 -0
- package/dist/registerBuiltInPhysics3DJointSolvers.js.map +1 -0
- package/dist/solver.d.ts +8 -0
- package/dist/solver.d.ts.map +1 -0
- package/dist/solver.js +460 -0
- package/dist/solver.js.map +1 -0
- package/dist/step.d.ts +5 -0
- package/dist/step.d.ts.map +1 -0
- package/dist/step.js +302 -0
- package/dist/step.js.map +1 -0
- package/dist/stepValidation.d.ts +13 -0
- package/dist/stepValidation.d.ts.map +1 -0
- package/dist/stepValidation.js +284 -0
- package/dist/stepValidation.js.map +1 -0
- package/dist/symmetricTensor.d.ts +11 -0
- package/dist/symmetricTensor.d.ts.map +1 -0
- package/dist/symmetricTensor.js +150 -0
- package/dist/symmetricTensor.js.map +1 -0
- package/dist/world.d.ts +27 -0
- package/dist/world.d.ts.map +1 -0
- package/dist/world.js +762 -0
- package/dist/world.js.map +1 -0
- package/dist/worldQueries.d.ts +11 -0
- package/dist/worldQueries.d.ts.map +1 -0
- package/dist/worldQueries.js +409 -0
- package/dist/worldQueries.js.map +1 -0
- package/package.json +55 -0
- package/src/broadphase.test.ts +265 -0
- package/src/colliderCollision.test.ts +57 -0
- package/src/colliderTransform.test.ts +221 -0
- package/src/contactIntake.test.ts +370 -0
- package/src/contacts.test.ts +64 -0
- package/src/continuous.test.ts +679 -0
- package/src/debugGeometry.test.ts +288 -0
- package/src/enablePhysics3DGuards.test.ts +206 -0
- package/src/explainPhysics3DCollision.test.ts +78 -0
- package/src/explainPhysics3DJoints.test.ts +101 -0
- package/src/explainPhysics3DStep.test.ts +142 -0
- package/src/integrate.test.ts +279 -0
- package/src/islands.test.ts +384 -0
- package/src/jointBreakage.test.ts +143 -0
- package/src/jointCollisionSuppression.test.ts +94 -0
- package/src/jointFactories.test.ts +244 -0
- package/src/jointMath.test.ts +646 -0
- package/src/jointReaction.test.ts +241 -0
- package/src/jointRegistry.test.ts +229 -0
- package/src/jointRows.test.ts +548 -0
- package/src/joints.test.ts +1066 -0
- package/src/massProperties.test.ts +611 -0
- package/src/material.test.ts +40 -0
- package/src/nodeSync.test.ts +50 -0
- package/src/ownership.test.ts +61 -0
- package/src/physics3DBroadphasePublication.test.ts +63 -0
- package/src/physics3DSpatialIndexingGuards.test.ts +43 -0
- package/src/registerBuiltInPhysics3DJointSolvers.test.ts +51 -0
- package/src/solver.test.ts +567 -0
- package/src/step.test.ts +490 -0
- package/src/stepValidation.test.ts +346 -0
- package/src/stress.test.ts +526 -0
- package/src/symmetricTensor.test.ts +166 -0
- package/src/world.test.ts +1127 -0
- package/src/worldQueries.test.ts +565 -0
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { Physics3DWorld } from '@flighthq/types/contract';
|
|
2
|
+
export declare function synchronizePhysics3DBroadphase(world: Physics3DWorld): void;
|
|
3
|
+
export declare function synchronizePhysics3DSweptBroadphase(world: Physics3DWorld, dt: number): void;
|
|
4
|
+
//# sourceMappingURL=broadphase.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"broadphase.d.ts","sourceRoot":"","sources":["../src/broadphase.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAiB,MAAM,0BAA0B,CAAC;AAa9E,wBAAgB,8BAA8B,CAAC,KAAK,EAAE,cAAc,GAAG,IAAI,CAO1E;AAQD,wBAAgB,mCAAmC,CAAC,KAAK,EAAE,cAAc,EAAE,EAAE,EAAE,MAAM,GAAG,IAAI,CAO3F"}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { updatePhysics3DColliderWorldShape, writePhysics3DColliderBounds } from './colliderTransform';
|
|
2
|
+
import { getPhysics3DBroadphaseBodyIndices, publishPhysics3DBroadphaseBody, withdrawPhysics3DBroadphaseBody, } from './physics3DBroadphasePublication';
|
|
3
|
+
import { reportPhysics3DSpatialIndexing } from './physics3DSpatialIndexingGuards';
|
|
4
|
+
// Refreshes every collider's world shape and republishes its body's bounds to the broadphase index. The
|
|
5
|
+
// step and the public world queries share this path, so a query observes the body's current authored
|
|
6
|
+
// pose rather than the pre-integration snapshot the most recent contact set was built from.
|
|
7
|
+
export function synchronizePhysics3DBroadphase(world) {
|
|
8
|
+
const scratch = acquirePhysics3DBroadphaseScratch();
|
|
9
|
+
try {
|
|
10
|
+
synchronizePhysics3DBroadphaseWithScratch(world, scratch, 0);
|
|
11
|
+
}
|
|
12
|
+
finally {
|
|
13
|
+
releasePhysics3DBroadphaseScratch(scratch);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
// Publishes the union of every body's current bounds and the bounds it would have after `dt` of its
|
|
17
|
+
// current motion — the volume it sweeps through, which is what a continuous pass must find candidates in.
|
|
18
|
+
//
|
|
19
|
+
// The ORDINARY index is reused rather than a second swept one. A continuous step queries the candidate
|
|
20
|
+
// pairs immediately and then restores the current bounds, so nothing observes the widened state, and the
|
|
21
|
+
// backend swap point stays single.
|
|
22
|
+
export function synchronizePhysics3DSweptBroadphase(world, dt) {
|
|
23
|
+
const scratch = acquirePhysics3DBroadphaseScratch();
|
|
24
|
+
try {
|
|
25
|
+
synchronizePhysics3DBroadphaseWithScratch(world, scratch, dt);
|
|
26
|
+
}
|
|
27
|
+
finally {
|
|
28
|
+
releasePhysics3DBroadphaseScratch(scratch);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
// The BODY is what the index holds, not the collider: a `SpatialObjectId` is one number, and the pair
|
|
32
|
+
// query returns pairs of them. Indexing colliders would need a composite id, and the step already
|
|
33
|
+
// refines a body pair down to its collider pairs — which is where the filter and sensor decisions live
|
|
34
|
+
// anyway.
|
|
35
|
+
function synchronizePhysics3DBroadphaseWithScratch(world, scratch, dt) {
|
|
36
|
+
const publishedBodyIndices = getPhysics3DBroadphaseBodyIndices(world);
|
|
37
|
+
for (let bodyIndex = 0; bodyIndex < world.bodies.length; bodyIndex += 1) {
|
|
38
|
+
const body = world.bodies[bodyIndex];
|
|
39
|
+
let minX = Infinity;
|
|
40
|
+
let minY = Infinity;
|
|
41
|
+
let minZ = Infinity;
|
|
42
|
+
let maxX = -Infinity;
|
|
43
|
+
let maxY = -Infinity;
|
|
44
|
+
let maxZ = -Infinity;
|
|
45
|
+
let rotationRadiusSquared = 0;
|
|
46
|
+
for (let colliderIndex = 0; colliderIndex < body.colliders.length; colliderIndex += 1) {
|
|
47
|
+
const collider = body.colliders[colliderIndex];
|
|
48
|
+
updatePhysics3DColliderWorldShape(collider, body);
|
|
49
|
+
writePhysics3DColliderBounds(collider, scratch.bounds);
|
|
50
|
+
if (scratch.bounds.minX < minX)
|
|
51
|
+
minX = scratch.bounds.minX;
|
|
52
|
+
if (scratch.bounds.minY < minY)
|
|
53
|
+
minY = scratch.bounds.minY;
|
|
54
|
+
if (scratch.bounds.minZ < minZ)
|
|
55
|
+
minZ = scratch.bounds.minZ;
|
|
56
|
+
if (scratch.bounds.maxX > maxX)
|
|
57
|
+
maxX = scratch.bounds.maxX;
|
|
58
|
+
if (scratch.bounds.maxY > maxY)
|
|
59
|
+
maxY = scratch.bounds.maxY;
|
|
60
|
+
if (scratch.bounds.maxZ > maxZ)
|
|
61
|
+
maxZ = scratch.bounds.maxZ;
|
|
62
|
+
if (dt > 0) {
|
|
63
|
+
const radiusX = Math.max(Math.abs(scratch.bounds.minX - body.x), Math.abs(scratch.bounds.maxX - body.x));
|
|
64
|
+
const radiusY = Math.max(Math.abs(scratch.bounds.minY - body.y), Math.abs(scratch.bounds.maxY - body.y));
|
|
65
|
+
const radiusZ = Math.max(Math.abs(scratch.bounds.minZ - body.z), Math.abs(scratch.bounds.maxZ - body.z));
|
|
66
|
+
const radiusSquared = radiusX * radiusX + radiusY * radiusY + radiusZ * radiusZ;
|
|
67
|
+
if (radiusSquared > rotationRadiusSquared)
|
|
68
|
+
rotationRadiusSquared = radiusSquared;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
if (minX > maxX) {
|
|
72
|
+
// No collider produced bounds, so there is nothing to index. Withdraw rather than skip: the id may
|
|
73
|
+
// have been indexed on a previous step, and stale bounds would keep returning a body that has since
|
|
74
|
+
// lost its geometry.
|
|
75
|
+
withdrawPhysics3DBroadphaseBody(world, body.index, publishedBodyIndices);
|
|
76
|
+
continue;
|
|
77
|
+
}
|
|
78
|
+
if (dt > 0 && body.type !== 'static' && !body.sleeping) {
|
|
79
|
+
const translationX = body.velocityX * dt;
|
|
80
|
+
const translationY = body.velocityY * dt;
|
|
81
|
+
const translationZ = body.velocityZ * dt;
|
|
82
|
+
const spinning = body.angularVelocityX !== 0 || body.angularVelocityY !== 0 || body.angularVelocityZ !== 0;
|
|
83
|
+
if (spinning) {
|
|
84
|
+
// A SPHERE around the body origin encloses every orientation of every collider, so sweeping that
|
|
85
|
+
// sphere along the origin's translation is conservative for arbitrary rotation — including an
|
|
86
|
+
// offset collider whose centre follows an arc rather than the straight line a shape sweep assumes.
|
|
87
|
+
const radius = Math.sqrt(rotationRadiusSquared);
|
|
88
|
+
minX = Math.min(minX, body.x - radius, body.x + translationX - radius);
|
|
89
|
+
minY = Math.min(minY, body.y - radius, body.y + translationY - radius);
|
|
90
|
+
minZ = Math.min(minZ, body.z - radius, body.z + translationZ - radius);
|
|
91
|
+
maxX = Math.max(maxX, body.x + radius, body.x + translationX + radius);
|
|
92
|
+
maxY = Math.max(maxY, body.y + radius, body.y + translationY + radius);
|
|
93
|
+
maxZ = Math.max(maxZ, body.z + radius, body.z + translationZ + radius);
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
if (translationX < 0)
|
|
97
|
+
minX += translationX;
|
|
98
|
+
else
|
|
99
|
+
maxX += translationX;
|
|
100
|
+
if (translationY < 0)
|
|
101
|
+
minY += translationY;
|
|
102
|
+
else
|
|
103
|
+
maxY += translationY;
|
|
104
|
+
if (translationZ < 0)
|
|
105
|
+
minZ += translationZ;
|
|
106
|
+
else
|
|
107
|
+
maxZ += translationZ;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
// The spatial package bounds its own indexing cost. This second limit expresses the physics world's
|
|
111
|
+
// stricter judgement that a non-finite or ten-million-unit body has diverged and should no longer
|
|
112
|
+
// participate in collision or queries.
|
|
113
|
+
if (!Number.isFinite(minX) ||
|
|
114
|
+
!Number.isFinite(minY) ||
|
|
115
|
+
!Number.isFinite(minZ) ||
|
|
116
|
+
!Number.isFinite(maxX) ||
|
|
117
|
+
!Number.isFinite(maxY) ||
|
|
118
|
+
!Number.isFinite(maxZ) ||
|
|
119
|
+
maxX - minX > MAX_SIMULATED_EXTENT ||
|
|
120
|
+
maxY - minY > MAX_SIMULATED_EXTENT ||
|
|
121
|
+
maxZ - minZ > MAX_SIMULATED_EXTENT) {
|
|
122
|
+
withdrawPhysics3DBroadphaseBody(world, body.index, publishedBodyIndices);
|
|
123
|
+
continue;
|
|
124
|
+
}
|
|
125
|
+
scratch.bodyBounds.minX = minX;
|
|
126
|
+
scratch.bodyBounds.minY = minY;
|
|
127
|
+
scratch.bodyBounds.minZ = minZ;
|
|
128
|
+
// Spatial cells use half-open containment while collision point tests include a shape's boundary.
|
|
129
|
+
// Publish a minimally conservative upper corner so an exact query at the maximum remains a broadphase
|
|
130
|
+
// candidate, and so a degenerate zero-volume collider still spans a non-empty indexed cell.
|
|
131
|
+
scratch.bodyBounds.maxX = paddedUpperBound(maxX);
|
|
132
|
+
scratch.bodyBounds.maxY = paddedUpperBound(maxY);
|
|
133
|
+
scratch.bodyBounds.maxZ = paddedUpperBound(maxZ);
|
|
134
|
+
publishPhysics3DBroadphaseBody(world, body.index, scratch.bodyBounds, publishedBodyIndices);
|
|
135
|
+
}
|
|
136
|
+
reportPhysics3DSpatialIndexing(world);
|
|
137
|
+
}
|
|
138
|
+
function paddedUpperBound(value) {
|
|
139
|
+
const padded = value + Math.max(1, Math.abs(value)) * Number.EPSILON * 4;
|
|
140
|
+
return Number.isFinite(padded) ? padded : value;
|
|
141
|
+
}
|
|
142
|
+
// The widest body this world still treats as simulating. Named for what it bounds — the simulation's
|
|
143
|
+
// tolerance for divergence — not for the index, which bounds its own insert cost independently.
|
|
144
|
+
const MAX_SIMULATED_EXTENT = 1e7;
|
|
145
|
+
function acquirePhysics3DBroadphaseScratch() {
|
|
146
|
+
return physics3DBroadphaseScratchPool.pop() ?? createPhysics3DBroadphaseScratch();
|
|
147
|
+
}
|
|
148
|
+
function createPhysics3DBroadphaseScratch() {
|
|
149
|
+
return {
|
|
150
|
+
bounds: { minX: 0, minY: 0, minZ: 0, maxX: 0, maxY: 0, maxZ: 0 },
|
|
151
|
+
bodyBounds: { minX: 0, minY: 0, minZ: 0, maxX: 0, maxY: 0, maxZ: 0 },
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
function releasePhysics3DBroadphaseScratch(scratch) {
|
|
155
|
+
physics3DBroadphaseScratchPool.push(scratch);
|
|
156
|
+
}
|
|
157
|
+
const physics3DBroadphaseScratchPool = [createPhysics3DBroadphaseScratch()];
|
|
158
|
+
//# sourceMappingURL=broadphase.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"broadphase.js","sourceRoot":"","sources":["../src/broadphase.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iCAAiC,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAC;AACtG,OAAO,EACL,iCAAiC,EACjC,8BAA8B,EAC9B,+BAA+B,GAChC,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,8BAA8B,EAAE,MAAM,kCAAkC,CAAC;AAElF,wGAAwG;AACxG,qGAAqG;AACrG,4FAA4F;AAC5F,MAAM,UAAU,8BAA8B,CAAC,KAAqB;IAClE,MAAM,OAAO,GAAG,iCAAiC,EAAE,CAAC;IACpD,IAAI,CAAC;QACH,yCAAyC,CAAC,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC;IAC/D,CAAC;YAAS,CAAC;QACT,iCAAiC,CAAC,OAAO,CAAC,CAAC;IAC7C,CAAC;AACH,CAAC;AAED,oGAAoG;AACpG,0GAA0G;AAC1G,EAAE;AACF,uGAAuG;AACvG,yGAAyG;AACzG,mCAAmC;AACnC,MAAM,UAAU,mCAAmC,CAAC,KAAqB,EAAE,EAAU;IACnF,MAAM,OAAO,GAAG,iCAAiC,EAAE,CAAC;IACpD,IAAI,CAAC;QACH,yCAAyC,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,CAAC,CAAC;IAChE,CAAC;YAAS,CAAC;QACT,iCAAiC,CAAC,OAAO,CAAC,CAAC;IAC7C,CAAC;AACH,CAAC;AAED,sGAAsG;AACtG,kGAAkG;AAClG,uGAAuG;AACvG,UAAU;AACV,SAAS,yCAAyC,CAChD,KAAqB,EACrB,OAAmC,EACnC,EA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C,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE;QAChE,UAAU,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE;KACrE,CAAC;AACJ,CAAC;AAED,SAAS,iCAAiC,CAAC,OAAmC;IAC5E,8BAA8B,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AAC/C,CAAC;AAED,MAAM,8BAA8B,GAAiC,CAAC,gCAAgC,EAAE,CAAC,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { CollisionColliderShape3D, CollisionContactManifold3D, CollisionRaycastHit3D, CollisionTimeOfImpact3D } from '@flighthq/types/contract';
|
|
2
|
+
export declare function collidePhysics3DColliderShapes(shapeA: Readonly<CollisionColliderShape3D>, shapeB: Readonly<CollisionColliderShape3D>, out: CollisionContactManifold3D): boolean;
|
|
3
|
+
export declare function raycastPhysics3DColliderShape(shape: Readonly<CollisionColliderShape3D>, originX: number, originY: number, originZ: number, directionX: number, directionY: number, directionZ: number, out: CollisionRaycastHit3D, maxFraction: number): boolean;
|
|
4
|
+
export declare function sweepPhysics3DColliderShapes(shapeA: Readonly<CollisionColliderShape3D>, deltaAX: number, deltaAY: number, deltaAZ: number, shapeB: Readonly<CollisionColliderShape3D>, deltaBX: number, deltaBY: number, deltaBZ: number, out: CollisionTimeOfImpact3D, maxFraction: number): boolean;
|
|
5
|
+
//# sourceMappingURL=colliderCollision.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"colliderCollision.d.ts","sourceRoot":"","sources":["../src/colliderCollision.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EACV,wBAAwB,EACxB,0BAA0B,EAC1B,qBAAqB,EACrB,uBAAuB,EACxB,MAAM,0BAA0B,CAAC;AAElC,wBAAgB,8BAA8B,CAC5C,MAAM,EAAE,QAAQ,CAAC,wBAAwB,CAAC,EAC1C,MAAM,EAAE,QAAQ,CAAC,wBAAwB,CAAC,EAC1C,GAAG,EAAE,0BAA0B,GAC9B,OAAO,CAaT;AAED,wBAAgB,6BAA6B,CAC3C,KAAK,EAAE,QAAQ,CAAC,wBAAwB,CAAC,EACzC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,EAClB,GAAG,EAAE,qBAAqB,EAC1B,WAAW,EAAE,MAAM,GAClB,OAAO,CAsCT;AAED,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,QAAQ,CAAC,wBAAwB,CAAC,EAC1C,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,QAAQ,CAAC,wBAAwB,CAAC,EAC1C,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,GAAG,EAAE,uBAAuB,EAC5B,WAAW,EAAE,MAAM,GAClB,OAAO,CAqDT"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { collideCollisionHeightfield3D, collideCollisionTriangleMesh3D, collideContactManifold3D, raycastCollisionHeightfield3D, raycastCollisionShape3D, raycastCollisionTriangleMesh3D, sweepCollisionHeightfield3D, sweepCollisionShape3D, sweepCollisionTriangleMesh3D, } from '@flighthq/collision/contract';
|
|
2
|
+
export function collidePhysics3DColliderShapes(shapeA, shapeB, out) {
|
|
3
|
+
if (shapeA.kind === 'triangle-mesh' || shapeA.kind === 'heightfield') {
|
|
4
|
+
if (shapeB.kind === 'triangle-mesh' || shapeB.kind === 'heightfield')
|
|
5
|
+
return false;
|
|
6
|
+
const hit = shapeA.kind === 'triangle-mesh'
|
|
7
|
+
? collideCollisionTriangleMesh3D(shapeB, shapeA, out)
|
|
8
|
+
: collideCollisionHeightfield3D(shapeB, shapeA, out);
|
|
9
|
+
if (hit)
|
|
10
|
+
reversePhysics3DManifoldNormal(out);
|
|
11
|
+
return hit;
|
|
12
|
+
}
|
|
13
|
+
if (shapeB.kind === 'triangle-mesh')
|
|
14
|
+
return collideCollisionTriangleMesh3D(shapeA, shapeB, out);
|
|
15
|
+
if (shapeB.kind === 'heightfield')
|
|
16
|
+
return collideCollisionHeightfield3D(shapeA, shapeB, out);
|
|
17
|
+
return collideContactManifold3D(shapeA, shapeB, out);
|
|
18
|
+
}
|
|
19
|
+
export function raycastPhysics3DColliderShape(shape, originX, originY, originZ, directionX, directionY, directionZ, out, maxFraction) {
|
|
20
|
+
if (shape.kind === 'triangle-mesh') {
|
|
21
|
+
return raycastCollisionTriangleMesh3D(shape, originX, originY, originZ, directionX, directionY, directionZ, out, maxFraction);
|
|
22
|
+
}
|
|
23
|
+
if (shape.kind === 'heightfield') {
|
|
24
|
+
return raycastCollisionHeightfield3D(shape, originX, originY, originZ, directionX, directionY, directionZ, out, maxFraction);
|
|
25
|
+
}
|
|
26
|
+
return raycastCollisionShape3D(shape, originX, originY, originZ, directionX, directionY, directionZ, out, maxFraction);
|
|
27
|
+
}
|
|
28
|
+
export function sweepPhysics3DColliderShapes(shapeA, deltaAX, deltaAY, deltaAZ, shapeB, deltaBX, deltaBY, deltaBZ, out, maxFraction) {
|
|
29
|
+
if (shapeA.kind === 'triangle-mesh' || shapeA.kind === 'heightfield') {
|
|
30
|
+
if (shapeB.kind === 'triangle-mesh' || shapeB.kind === 'heightfield')
|
|
31
|
+
return false;
|
|
32
|
+
const hit = shapeA.kind === 'triangle-mesh'
|
|
33
|
+
? sweepCollisionTriangleMesh3D(shapeB, deltaBX - deltaAX, deltaBY - deltaAY, deltaBZ - deltaAZ, shapeA, out, maxFraction)
|
|
34
|
+
: sweepCollisionHeightfield3D(shapeB, deltaBX - deltaAX, deltaBY - deltaAY, deltaBZ - deltaAZ, shapeA, out, maxFraction);
|
|
35
|
+
if (hit) {
|
|
36
|
+
out.normalX = -out.normalX;
|
|
37
|
+
out.normalY = -out.normalY;
|
|
38
|
+
out.normalZ = -out.normalZ;
|
|
39
|
+
}
|
|
40
|
+
return hit;
|
|
41
|
+
}
|
|
42
|
+
if (shapeB.kind === 'triangle-mesh') {
|
|
43
|
+
return sweepCollisionTriangleMesh3D(shapeA, deltaAX - deltaBX, deltaAY - deltaBY, deltaAZ - deltaBZ, shapeB, out, maxFraction);
|
|
44
|
+
}
|
|
45
|
+
if (shapeB.kind === 'heightfield') {
|
|
46
|
+
return sweepCollisionHeightfield3D(shapeA, deltaAX - deltaBX, deltaAY - deltaBY, deltaAZ - deltaBZ, shapeB, out, maxFraction);
|
|
47
|
+
}
|
|
48
|
+
return sweepCollisionShape3D(shapeA, deltaAX, deltaAY, deltaAZ, shapeB, deltaBX, deltaBY, deltaBZ, out, maxFraction);
|
|
49
|
+
}
|
|
50
|
+
function reversePhysics3DManifoldNormal(out) {
|
|
51
|
+
out.normalX = -out.normalX;
|
|
52
|
+
out.normalY = -out.normalY;
|
|
53
|
+
out.normalZ = -out.normalZ;
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=colliderCollision.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"colliderCollision.js","sourceRoot":"","sources":["../src/colliderCollision.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,6BAA6B,EAC7B,8BAA8B,EAC9B,wBAAwB,EACxB,6BAA6B,EAC7B,uBAAuB,EACvB,8BAA8B,EAC9B,2BAA2B,EAC3B,qBAAqB,EACrB,4BAA4B,GAC7B,MAAM,8BAA8B,CAAC;AAQtC,MAAM,UAAU,8BAA8B,CAC5C,MAA0C,EAC1C,MAA0C,EAC1C,GAA+B;IAE/B,IAAI,MAAM,CAAC,IAAI,KAAK,eAAe,IAAI,MAAM,CAAC,IAAI,KAAK,aAAa,EAAE,CAAC;QACr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OAAO,GAAG,OAAO,EACjB,MAAM,EACN,GAAG,EACH,WAAW,CACZ,CAAC;IACJ,CAAC;IACD,IAAI,MAAM,CAAC,IAAI,KAAK,aAAa,EAAE,CAAC;QAClC,OAAO,2BAA2B,CAChC,MAAM,EACN,OAAO,GAAG,OAAO,EACjB,OAAO,GAAG,OAAO,EACjB,OAAO,GAAG,OAAO,EACjB,MAAM,EACN,GAAG,EACH,WAAW,CACZ,CAAC;IACJ,CAAC;IACD,OAAO,qBAAqB,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,WAAW,CAAC,CAAC;AACvH,CAAC;AAED,SAAS,8BAA8B,CAAC,GAA+B;IACrE,GAAG,CAAC,OAAO,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC;IAC3B,GAAG,CAAC,OAAO,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC;IAC3B,GAAG,CAAC,OAAO,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC;AAC7B,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { CollisionColliderShape3D, Physics3DCollider, RigidBody3D, SpatialAabb3D } from '@flighthq/types/contract';
|
|
2
|
+
export declare function createPhysics3DColliderWorldShape(local: Readonly<CollisionColliderShape3D>): CollisionColliderShape3D;
|
|
3
|
+
export declare function updatePhysics3DColliderWorldShape(collider: Physics3DCollider, body: Readonly<RigidBody3D>): void;
|
|
4
|
+
export declare function writePhysics3DColliderBounds(collider: Readonly<Physics3DCollider>, out: SpatialAabb3D): void;
|
|
5
|
+
//# sourceMappingURL=colliderTransform.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"colliderTransform.d.ts","sourceRoot":"","sources":["../src/colliderTransform.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,wBAAwB,EAAE,iBAAiB,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAKxH,wBAAgB,iCAAiC,CAAC,KAAK,EAAE,QAAQ,CAAC,wBAAwB,CAAC,GAAG,wBAAwB,CAwFrH;AAUD,wBAAgB,iCAAiC,CAAC,QAAQ,EAAE,iBAAiB,EAAE,IAAI,EAAE,QAAQ,CAAC,WAAW,CAAC,GAAG,IAAI,CA4HhH;AAMD,wBAAgB,4BAA4B,CAAC,QAAQ,EAAE,QAAQ,CAAC,iBAAiB,CAAC,EAAE,GAAG,EAAE,aAAa,GAAG,IAAI,CAyI5G"}
|