@woosh/meep-engine 2.143.0 → 2.144.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/package.json +1 -1
- package/src/core/geom/3d/shape/PointShape3D.d.ts +1 -0
- package/src/core/geom/3d/shape/PointShape3D.d.ts.map +1 -1
- package/src/core/geom/3d/shape/PointShape3D.js +11 -0
- package/src/core/geom/3d/shape/SphereShape3D.d.ts +1 -0
- package/src/core/geom/3d/shape/SphereShape3D.d.ts.map +1 -1
- package/src/core/geom/3d/shape/SphereShape3D.js +4 -0
- package/src/engine/control/first-person/DESIGN_COLLISION.md +264 -217
- package/src/engine/control/first-person/FirstPersonPlayerControllerSystem.d.ts +91 -58
- package/src/engine/control/first-person/FirstPersonPlayerControllerSystem.d.ts.map +1 -1
- package/src/engine/control/first-person/FirstPersonPlayerControllerSystem.js +1814 -1789
- package/src/engine/control/first-person/TODO.md +17 -32
- package/src/engine/control/first-person/collision/KinematicMover.d.ts +176 -0
- package/src/engine/control/first-person/collision/KinematicMover.d.ts.map +1 -0
- package/src/engine/control/first-person/collision/KinematicMover.js +424 -0
- package/src/engine/control/first-person/prototype_first_person_controller.js +65 -0
- package/src/engine/graphics/render/buffer/simple-fx/ao/SAOShader.js +18 -9
- package/src/engine/physics/PLAN.md +94 -32
- package/src/engine/physics/contact/ManifoldStore.d.ts +28 -2
- package/src/engine/physics/contact/ManifoldStore.d.ts.map +1 -1
- package/src/engine/physics/contact/ManifoldStore.js +37 -3
- package/src/engine/physics/contact/combine_material.d.ts +30 -0
- package/src/engine/physics/contact/combine_material.d.ts.map +1 -0
- package/src/engine/physics/contact/combine_material.js +35 -0
- package/src/engine/physics/ecs/Collider.d.ts +15 -0
- package/src/engine/physics/ecs/Collider.d.ts.map +1 -1
- package/src/engine/physics/ecs/Collider.js +34 -0
- package/src/engine/physics/ecs/Joint.d.ts +18 -0
- package/src/engine/physics/ecs/Joint.d.ts.map +1 -1
- package/src/engine/physics/ecs/Joint.js +70 -0
- package/src/engine/physics/ecs/PhysicsSystem.d.ts +9 -4
- package/src/engine/physics/ecs/PhysicsSystem.d.ts.map +1 -1
- package/src/engine/physics/ecs/PhysicsSystem.js +9 -4
- package/src/engine/physics/ecs/RigidBody.d.ts +15 -0
- package/src/engine/physics/ecs/RigidBody.d.ts.map +1 -1
- package/src/engine/physics/ecs/RigidBody.js +46 -0
- package/src/engine/physics/narrowphase/compute_penetration.d.ts +41 -41
- package/src/engine/physics/narrowphase/compute_penetration.d.ts.map +1 -1
- package/src/engine/physics/narrowphase/compute_penetration.js +96 -169
- package/src/engine/physics/narrowphase/narrowphase_step.d.ts +52 -0
- package/src/engine/physics/narrowphase/narrowphase_step.d.ts.map +1 -1
- package/src/engine/physics/narrowphase/narrowphase_step.js +130 -3
- package/src/engine/physics/solver/solve_contacts.d.ts.map +1 -1
- package/src/engine/physics/solver/solve_contacts.js +10 -21
|
@@ -286,25 +286,11 @@ function inv_mass_of(rb) {
|
|
|
286
286
|
return rb.mass > 0 ? 1 / rb.mass : 0;
|
|
287
287
|
}
|
|
288
288
|
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
*/
|
|
295
|
-
function combine_friction(a, b) {
|
|
296
|
-
return Math.sqrt(a * b);
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
/**
|
|
300
|
-
* Combine two restitution coefficients (maximum — Unity / common default).
|
|
301
|
-
* @param {number} a
|
|
302
|
-
* @param {number} b
|
|
303
|
-
* @returns {number}
|
|
304
|
-
*/
|
|
305
|
-
function combine_restitution(a, b) {
|
|
306
|
-
return a > b ? a : b;
|
|
307
|
-
}
|
|
289
|
+
// Friction / restitution are no longer combined here: the narrowphase combines
|
|
290
|
+
// the specific source-collider pair's coefficients per contact (so compound
|
|
291
|
+
// bodies with mixed-material colliders are honoured) and stores the result in
|
|
292
|
+
// the manifold (CONTACT_STRIDE offsets 14 / 15). prepare_contacts reads them
|
|
293
|
+
// per contact. See engine/physics/contact/combine_material.js.
|
|
308
294
|
|
|
309
295
|
const scratch_clamp = new Float64Array(2);
|
|
310
296
|
const scratch_inertia_a = new Float64Array(3);
|
|
@@ -520,8 +506,6 @@ export function prepare_contacts(manifolds, system, dt_sub) {
|
|
|
520
506
|
|
|
521
507
|
const cc = manifolds.contact_count(slot);
|
|
522
508
|
const slot_off = manifolds.slot_data_offset(slot);
|
|
523
|
-
const restitution_combined = combine_restitution(colA.restitution, colB.restitution);
|
|
524
|
-
const friction_combined = combine_friction(colA.friction, colB.friction);
|
|
525
509
|
|
|
526
510
|
const pAx = trA.position.x, pAy = trA.position.y, pAz = trA.position.z;
|
|
527
511
|
const pBx = trB.position.x, pBy = trB.position.y, pBz = trB.position.z;
|
|
@@ -530,6 +514,11 @@ export function prepare_contacts(manifolds, system, dt_sub) {
|
|
|
530
514
|
for (let k = 0; k < cc; k++) {
|
|
531
515
|
const off = slot_off + k * CONTACT_STRIDE;
|
|
532
516
|
|
|
517
|
+
// Per-contact combined materials (stamped by the narrowphase from
|
|
518
|
+
// this contact's specific source-collider pair).
|
|
519
|
+
const friction_combined = data[off + 14];
|
|
520
|
+
const restitution_combined = data[off + 15];
|
|
521
|
+
|
|
533
522
|
const wax = data[off], way = data[off + 1], waz = data[off + 2];
|
|
534
523
|
const wbx = data[off + 3], wby = data[off + 4], wbz = data[off + 5];
|
|
535
524
|
const nx = data[off + 6], ny = data[off + 7], nz = data[off + 8];
|