@driftengine/physics 4.7.3 → 4.8.0
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/collide/segment.js +0 -2
- package/dist/collide/sweep.js +1 -1
- package/dist/world.js +2 -3
- package/package.json +1 -1
- package/src/collide/segment.ts +0 -4
- package/src/collide/sweep.ts +1 -1
- package/src/world.ts +2 -9
package/dist/collide/segment.js
CHANGED
|
@@ -17,8 +17,6 @@ export function segmentHit(ox, oy, oz, dx, dy, dz, boxes, radius) {
|
|
|
17
17
|
let nearest = 1;
|
|
18
18
|
const count = boxes.query(Math.min(ox, ox + dx) - radius, Math.min(oy, oy + dy) - radius, Math.min(oz, oz + dz) - radius, Math.max(ox, ox + dx) + radius, Math.max(oy, oy + dy) + radius, Math.max(oz, oz + dz) + radius, hits);
|
|
19
19
|
const data = boxes.data;
|
|
20
|
-
// Support of the contact that finally clamps the move; true when unblocked.
|
|
21
|
-
let clampSupport = true;
|
|
22
20
|
for (let h = 0; h < count; h++) {
|
|
23
21
|
const index = hits[h] ?? 0;
|
|
24
22
|
const o = index * 6;
|
package/dist/collide/sweep.js
CHANGED
|
@@ -815,7 +815,7 @@ export function moveAxis(body, boxes, axis, delta) {
|
|
|
815
815
|
* exactly `pos + local`, unchanged.
|
|
816
816
|
*/
|
|
817
817
|
const pivotY = body.pivotY ?? 0;
|
|
818
|
-
const baseX = body.x - frame.
|
|
818
|
+
const baseX = body.x - frame.ux * pivotY;
|
|
819
819
|
const baseY = body.y + pivotY - frame.uy * pivotY;
|
|
820
820
|
const baseZ = body.z - frame.uz * pivotY;
|
|
821
821
|
const parts = body.parts;
|
package/dist/world.js
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { BODY_DYNAMIC, BODY_SENSOR, BODY_STATIC, BodySet } from './bodies.js';
|
|
2
|
-
import { shapeBounds } from './shape.js';
|
|
3
2
|
import { collideShapes, createManifold } from './manifold.js';
|
|
4
3
|
import { MAX_MESH_MANIFOLDS, collideMesh, isMesh } from './meshContact.js';
|
|
5
4
|
import { MAX_BODY_PARTS, MAX_PAIR_MANIFOLDS, collideCompound, partsBoundRadius, } from './compoundContact.js';
|
|
6
5
|
import { MAX_BODIES, PairSet, pairA, pairB, pairKey } from './pairs.js';
|
|
7
|
-
import { ContactConstraints,
|
|
6
|
+
import { ContactConstraints, prepareContact } from './solver.js';
|
|
8
7
|
import { DynamicTree } from './tree.js';
|
|
9
8
|
import { overlapWorld, raycastWorld, shapecastWorld } from './query.js';
|
|
10
9
|
import { ContactEvents } from './events.js';
|
|
11
10
|
import { IslandSet } from './island.js';
|
|
12
|
-
import { JointSet, resetJointImpulses
|
|
11
|
+
import { JointSet, resetJointImpulses } from './joints.js';
|
|
13
12
|
import { SerialExecutor } from './executor.js';
|
|
14
13
|
import { DIAL_ALLOW_SLEEP, DIAL_ANGULAR_DAMPING, DIAL_CONTACT_DAMPING, DIAL_CONTACT_HERTZ, DIAL_COUNT, DIAL_DT, DIAL_FRICTION_MODEL, DIAL_GRAVITY_X, DIAL_GRAVITY_Y, DIAL_GRAVITY_Z, DIAL_ITERATIONS, DIAL_JOINT_DAMPING, DIAL_JOINT_HERTZ, DIAL_LINEAR_DAMPING, DIAL_SUBSTEPS, SLEEP_TICKS, bodyAsleep, frictionDial, solveIslandInto, } from './islandSolve.js';
|
|
15
14
|
const IMPULSE_I = new Float32Array(6);
|
package/package.json
CHANGED
package/src/collide/segment.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ColliderSet } from '../colliderSet.ts';
|
|
2
|
-
import type { Aabb } from './aabb.ts';
|
|
3
2
|
import { hits } from './scratch.ts';
|
|
4
3
|
|
|
5
4
|
/** What a ray hits: a segment tested against a collider set. */
|
|
@@ -39,9 +38,6 @@ export function segmentHit(
|
|
|
39
38
|
hits,
|
|
40
39
|
);
|
|
41
40
|
const data = boxes.data;
|
|
42
|
-
// Support of the contact that finally clamps the move; true when unblocked.
|
|
43
|
-
let clampSupport = true;
|
|
44
|
-
|
|
45
41
|
for (let h = 0; h < count; h++) {
|
|
46
42
|
const index = hits[h] ?? 0;
|
|
47
43
|
const o = index * 6;
|
package/src/collide/sweep.ts
CHANGED
|
@@ -875,7 +875,7 @@ export function moveAxis(body: Body, boxes: ColliderSet, axis: Axis, delta: numb
|
|
|
875
875
|
* exactly `pos + local`, unchanged.
|
|
876
876
|
*/
|
|
877
877
|
const pivotY = body.pivotY ?? 0;
|
|
878
|
-
const baseX = body.x - frame.
|
|
878
|
+
const baseX = body.x - frame.ux * pivotY;
|
|
879
879
|
const baseY = body.y + pivotY - frame.uy * pivotY;
|
|
880
880
|
const baseZ = body.z - frame.uz * pivotY;
|
|
881
881
|
const parts = body.parts;
|
package/src/world.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { BODY_DYNAMIC, BODY_SENSOR, BODY_STATIC, BodySet } from './bodies.ts';
|
|
2
2
|
import type { BodyDesc } from './bodies.ts';
|
|
3
|
-
import { shapeBounds } from './shape.ts';
|
|
4
3
|
import type { Aabb } from './collide/index.ts';
|
|
5
4
|
import { collideShapes, createManifold } from './manifold.ts';
|
|
6
5
|
import { MAX_MESH_MANIFOLDS, collideMesh, isMesh } from './meshContact.ts';
|
|
@@ -13,13 +12,7 @@ import {
|
|
|
13
12
|
|
|
14
13
|
import type { Manifold, ShapePose } from './manifold.ts';
|
|
15
14
|
import { MAX_BODIES, PairSet, pairA, pairB, pairKey } from './pairs.ts';
|
|
16
|
-
import {
|
|
17
|
-
ContactConstraints,
|
|
18
|
-
applyRestitution,
|
|
19
|
-
prepareContact,
|
|
20
|
-
solveContacts,
|
|
21
|
-
warmStart,
|
|
22
|
-
} from './solver.ts';
|
|
15
|
+
import { ContactConstraints, prepareContact } from './solver.ts';
|
|
23
16
|
import type { FrictionModel } from './solver.ts';
|
|
24
17
|
import { DynamicTree } from './tree.ts';
|
|
25
18
|
import { overlapWorld, raycastWorld, shapecastWorld } from './query.ts';
|
|
@@ -27,7 +20,7 @@ import type { QueryFilter, RayHit } from './query.ts';
|
|
|
27
20
|
import type { ConvexShape } from './shape.ts';
|
|
28
21
|
import { ContactEvents } from './events.ts';
|
|
29
22
|
import { IslandSet } from './island.ts';
|
|
30
|
-
import { JointSet, resetJointImpulses
|
|
23
|
+
import { JointSet, resetJointImpulses } from './joints.ts';
|
|
31
24
|
import type { JointDesc } from './joints.ts';
|
|
32
25
|
import { SerialExecutor } from './executor.ts';
|
|
33
26
|
import type { Executor, IslandSolver } from './executor.ts';
|