@woosh/meep-engine 2.139.0 → 2.140.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/bvh2/bvh3/query/bvh_query_user_data_overlaps_aabb.d.ts +3 -3
- package/src/core/bvh2/bvh3/query/bvh_query_user_data_overlaps_aabb.d.ts.map +1 -1
- package/src/core/bvh2/bvh3/query/bvh_query_user_data_overlaps_aabb.js +4 -4
- package/src/{engine/physics/broadphase/aabb_transform_oriented.d.ts → core/geom/3d/aabb/aabb3_transform_oriented.d.ts} +2 -2
- package/src/core/geom/3d/aabb/aabb3_transform_oriented.d.ts.map +1 -0
- package/src/{engine/physics/broadphase/aabb_transform_oriented.js → core/geom/3d/aabb/aabb3_transform_oriented.js} +1 -1
- package/src/core/geom/3d/quaternion/quat3_to_matrix3.d.ts +54 -0
- package/src/core/geom/3d/quaternion/quat3_to_matrix3.d.ts.map +1 -0
- package/src/core/geom/3d/quaternion/quat3_to_matrix3.js +69 -0
- package/src/core/geom/3d/shape/AbstractShape3D.d.ts +24 -2
- package/src/core/geom/3d/shape/AbstractShape3D.d.ts.map +1 -1
- package/src/core/geom/3d/shape/AbstractShape3D.js +24 -1
- package/src/core/geom/3d/shape/HeightMapShape3D.d.ts +148 -0
- package/src/core/geom/3d/shape/HeightMapShape3D.d.ts.map +1 -0
- package/src/core/geom/3d/shape/HeightMapShape3D.js +451 -0
- package/src/core/geom/3d/shape/MeshShape3D.d.ts +210 -0
- package/src/core/geom/3d/shape/MeshShape3D.d.ts.map +1 -0
- package/src/core/geom/3d/shape/MeshShape3D.js +593 -0
- package/src/core/geom/3d/shape/TransformedShape3D.d.ts.map +1 -1
- package/src/core/geom/3d/shape/TransformedShape3D.js +46 -2
- package/src/core/geom/3d/shape/Triangle3D.d.ts +95 -0
- package/src/core/geom/3d/shape/Triangle3D.d.ts.map +1 -0
- package/src/core/geom/3d/shape/Triangle3D.js +318 -0
- package/src/core/geom/3d/shape/UnionShape3D.js +13 -0
- package/src/core/geom/3d/shape/shape_mesh_from_geometry.d.ts +30 -0
- package/src/core/geom/3d/shape/shape_mesh_from_geometry.d.ts.map +1 -0
- package/src/core/geom/3d/shape/shape_mesh_from_geometry.js +64 -0
- package/src/core/geom/3d/tetrahedra/prototype_tetrahedrize_mesh.js +9 -11
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_build_vertex_to_tets_map.d.ts +28 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_build_vertex_to_tets_map.d.ts.map +1 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_build_vertex_to_tets_map.js +48 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_improve_quality.d.ts.map +1 -1
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_improve_quality.js +40 -18
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_smooth_vertex.d.ts +9 -5
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_smooth_vertex.d.ts.map +1 -1
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_smooth_vertex.js +38 -10
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_vertex_is_boundary.d.ts +14 -5
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_vertex_is_boundary.d.ts.map +1 -1
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_vertex_is_boundary.js +47 -5
- package/src/core/geom/3d/topology/struct/binary/BinaryElementPool.d.ts +19 -0
- package/src/core/geom/3d/topology/struct/binary/BinaryElementPool.d.ts.map +1 -1
- package/src/core/geom/3d/topology/struct/binary/BinaryElementPool.js +75 -13
- package/src/core/geom/3d/triangle/v3_compute_triangle_normal.d.ts +2 -2
- package/src/core/geom/3d/triangle/v3_compute_triangle_normal.d.ts.map +1 -1
- package/src/core/geom/3d/triangle/v3_compute_triangle_normal.js +1 -1
- package/src/core/geom/vec3/v3_dot_array_array.d.ts +3 -3
- package/src/core/geom/vec3/v3_dot_array_array.d.ts.map +1 -1
- package/src/core/geom/vec3/v3_dot_array_array.js +2 -2
- package/src/core/geom/vec3/v3_negate_array.d.ts +3 -3
- package/src/core/geom/vec3/v3_negate_array.d.ts.map +1 -1
- package/src/core/geom/vec3/v3_negate_array.js +2 -2
- package/src/core/geom/vec3/v3_quat3_apply.d.ts +29 -0
- package/src/core/geom/vec3/v3_quat3_apply.d.ts.map +1 -0
- package/src/core/geom/vec3/v3_quat3_apply.js +39 -0
- package/src/core/geom/vec3/v3_quat3_apply_inverse.d.ts +30 -0
- package/src/core/geom/vec3/v3_quat3_apply_inverse.d.ts.map +1 -0
- package/src/core/geom/vec3/v3_quat3_apply_inverse.js +41 -0
- package/src/core/geom/vec3/v3_triple_cross_product.d.ts +32 -0
- package/src/core/geom/vec3/v3_triple_cross_product.d.ts.map +1 -0
- package/src/core/geom/vec3/v3_triple_cross_product.js +45 -0
- package/src/engine/control/first-person/FirstPersonPlayerController.d.ts +16 -3
- package/src/engine/control/first-person/FirstPersonPlayerController.d.ts.map +1 -1
- package/src/engine/control/first-person/FirstPersonPlayerController.js +211 -211
- package/src/engine/control/first-person/FirstPersonPlayerControllerConfig.d.ts +72 -8
- package/src/engine/control/first-person/FirstPersonPlayerControllerConfig.d.ts.map +1 -1
- package/src/engine/control/first-person/FirstPersonPlayerControllerConfig.js +37 -5
- package/src/engine/control/first-person/FirstPersonPlayerControllerSystem.d.ts +101 -3
- package/src/engine/control/first-person/FirstPersonPlayerControllerSystem.d.ts.map +1 -1
- package/src/engine/control/first-person/FirstPersonPlayerControllerSystem.js +1789 -1416
- package/src/engine/control/first-person/TODO.md +173 -127
- package/src/engine/control/first-person/abilities/Slide.d.ts.map +1 -1
- package/src/engine/control/first-person/abilities/Slide.js +9 -1
- package/src/engine/control/first-person/prototype_first_person_controller.js +88 -2
- package/src/engine/control/first-person/test/buildTestPlayer.d.ts.map +1 -1
- package/src/engine/control/first-person/test/buildTestPlayer.js +9 -1
- package/src/engine/graphics/geometry/CapsuleGeometry.d.ts +42 -0
- package/src/engine/graphics/geometry/CapsuleGeometry.d.ts.map +1 -0
- package/src/engine/graphics/geometry/CapsuleGeometry.js +171 -0
- package/src/engine/physics/BULLET_REVIEW.md +945 -0
- package/src/engine/physics/CANNON_REVIEW.md +1300 -0
- package/src/engine/physics/JOLT_REVIEW.md +913 -0
- package/src/engine/physics/PLAN.md +461 -236
- package/src/engine/physics/RAPIER_REVIEW.md +934 -0
- package/src/engine/physics/REVIEW_001_ACTION_PLAN.md +642 -0
- package/src/engine/physics/broadphase/compute_fat_world_aabb.js +2 -2
- package/src/engine/physics/contact/ManifoldStore.d.ts +83 -10
- package/src/engine/physics/contact/ManifoldStore.d.ts.map +1 -1
- package/src/engine/physics/contact/ManifoldStore.js +608 -499
- package/src/engine/physics/ecs/ColliderObserverSystem.d.ts +2 -2
- package/src/engine/physics/ecs/ColliderObserverSystem.d.ts.map +1 -1
- package/src/engine/physics/ecs/PhysicsSystem.d.ts +128 -20
- package/src/engine/physics/ecs/PhysicsSystem.d.ts.map +1 -1
- package/src/engine/physics/ecs/PhysicsSystem.js +1301 -1159
- package/src/engine/physics/fluid/FluidSimulator.d.ts.map +1 -1
- package/src/engine/physics/fluid/FluidSimulator.js +2 -1
- package/src/engine/physics/fluid/solver/v3_grid_subtract_pressure_gradient.d.ts +28 -6
- package/src/engine/physics/fluid/solver/v3_grid_subtract_pressure_gradient.d.ts.map +1 -1
- package/src/engine/physics/fluid/solver/v3_grid_subtract_pressure_gradient.js +39 -17
- package/src/engine/physics/gjk/expanding_polytope_algorithm.d.ts +6 -6
- package/src/engine/physics/gjk/expanding_polytope_algorithm.d.ts.map +1 -1
- package/src/engine/physics/gjk/expanding_polytope_algorithm.js +68 -22
- package/src/engine/physics/gjk/gjk.d.ts +28 -2
- package/src/engine/physics/gjk/gjk.d.ts.map +1 -1
- package/src/engine/physics/gjk/gjk.js +421 -378
- package/src/engine/physics/gjk/minkowski_support.d.ts +37 -0
- package/src/engine/physics/gjk/minkowski_support.d.ts.map +1 -0
- package/src/engine/physics/gjk/minkowski_support.js +75 -0
- package/src/engine/physics/gjk/mpr.d.ts +56 -0
- package/src/engine/physics/gjk/mpr.d.ts.map +1 -0
- package/src/engine/physics/gjk/mpr.js +344 -0
- package/src/engine/physics/inertia/world_inverse_inertia.d.ts +20 -5
- package/src/engine/physics/inertia/world_inverse_inertia.d.ts.map +1 -1
- package/src/engine/physics/inertia/world_inverse_inertia.js +36 -38
- package/src/engine/physics/integration/integrate_position.d.ts +25 -7
- package/src/engine/physics/integration/integrate_position.d.ts.map +1 -1
- package/src/engine/physics/integration/integrate_position.js +43 -12
- package/src/engine/physics/integration/integrate_velocity.d.ts +30 -0
- package/src/engine/physics/integration/integrate_velocity.d.ts.map +1 -1
- package/src/engine/physics/integration/integrate_velocity.js +82 -1
- package/src/engine/physics/narrowphase/PosedShape.d.ts +0 -8
- package/src/engine/physics/narrowphase/PosedShape.d.ts.map +1 -1
- package/src/engine/physics/narrowphase/PosedShape.js +28 -30
- package/src/engine/physics/narrowphase/box_box_manifold.d.ts.map +1 -1
- package/src/engine/physics/narrowphase/box_box_manifold.js +113 -17
- package/src/engine/physics/narrowphase/box_triangle_contact.d.ts +30 -0
- package/src/engine/physics/narrowphase/box_triangle_contact.d.ts.map +1 -0
- package/src/engine/physics/narrowphase/box_triangle_contact.js +811 -0
- package/src/engine/physics/narrowphase/capsule_contacts.d.ts.map +1 -1
- package/src/engine/physics/narrowphase/capsule_contacts.js +10 -56
- package/src/engine/physics/narrowphase/capsule_triangle_contact.d.ts +71 -0
- package/src/engine/physics/narrowphase/capsule_triangle_contact.d.ts.map +1 -0
- package/src/engine/physics/narrowphase/capsule_triangle_contact.js +375 -0
- package/src/engine/physics/narrowphase/compute_penetration.d.ts +91 -0
- package/src/engine/physics/narrowphase/compute_penetration.d.ts.map +1 -0
- package/src/engine/physics/narrowphase/compute_penetration.js +396 -0
- package/src/engine/physics/narrowphase/decomposition/aabb_world_to_local.d.ts +35 -0
- package/src/engine/physics/narrowphase/decomposition/aabb_world_to_local.d.ts.map +1 -0
- package/src/engine/physics/narrowphase/decomposition/aabb_world_to_local.js +80 -0
- package/src/engine/physics/narrowphase/decomposition/decompose_to_triangles.d.ts +31 -0
- package/src/engine/physics/narrowphase/decomposition/decompose_to_triangles.d.ts.map +1 -0
- package/src/engine/physics/narrowphase/decomposition/decompose_to_triangles.js +55 -0
- package/src/engine/physics/narrowphase/decomposition/heightmap_enumerate_triangles.d.ts +42 -0
- package/src/engine/physics/narrowphase/decomposition/heightmap_enumerate_triangles.d.ts.map +1 -0
- package/src/engine/physics/narrowphase/decomposition/heightmap_enumerate_triangles.js +204 -0
- package/src/engine/physics/narrowphase/decomposition/mesh_enumerate_triangles.d.ts +42 -0
- package/src/engine/physics/narrowphase/decomposition/mesh_enumerate_triangles.d.ts.map +1 -0
- package/src/engine/physics/narrowphase/decomposition/mesh_enumerate_triangles.js +94 -0
- package/src/engine/physics/narrowphase/decomposition/triangle_buffer_layout.d.ts +37 -0
- package/src/engine/physics/narrowphase/decomposition/triangle_buffer_layout.d.ts.map +1 -0
- package/src/engine/physics/narrowphase/decomposition/triangle_buffer_layout.js +37 -0
- package/src/engine/physics/narrowphase/narrowphase_step.d.ts +8 -2
- package/src/engine/physics/narrowphase/narrowphase_step.d.ts.map +1 -1
- package/src/engine/physics/narrowphase/narrowphase_step.js +1422 -382
- package/src/engine/physics/narrowphase/sphere_box_contact.d.ts.map +1 -1
- package/src/engine/physics/narrowphase/sphere_box_contact.js +16 -23
- package/src/engine/physics/narrowphase/sphere_triangle_contact.d.ts +48 -0
- package/src/engine/physics/narrowphase/sphere_triangle_contact.d.ts.map +1 -0
- package/src/engine/physics/narrowphase/sphere_triangle_contact.js +143 -0
- package/src/engine/physics/queries/overlap_shape.d.ts +51 -0
- package/src/engine/physics/queries/overlap_shape.d.ts.map +1 -0
- package/src/engine/physics/queries/overlap_shape.js +183 -0
- package/src/engine/physics/queries/shape_cast.d.ts +56 -0
- package/src/engine/physics/queries/shape_cast.d.ts.map +1 -0
- package/src/engine/physics/queries/shape_cast.js +387 -0
- package/src/engine/physics/solver/solve_contacts.d.ts +116 -30
- package/src/engine/physics/solver/solve_contacts.d.ts.map +1 -1
- package/src/engine/physics/solver/solve_contacts.js +641 -223
- package/src/engine/physics/broadphase/aabb_transform_oriented.d.ts.map +0 -1
- package/src/engine/physics/fluid/solver/v3_grid_solve_pressure_unmasked_legacy.d.ts +0 -20
- package/src/engine/physics/fluid/solver/v3_grid_solve_pressure_unmasked_legacy.d.ts.map +0 -1
- package/src/engine/physics/fluid/solver/v3_grid_solve_pressure_unmasked_legacy.js +0 -83
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Rotate a 3-D vector by a unit quaternion: `result = q · v · q*`.
|
|
3
|
+
*
|
|
4
|
+
* The closed-form expansion below is the standard "two Hamilton
|
|
5
|
+
* products with a pure-quaternion v" derivation. We compute the
|
|
6
|
+
* intermediate `t = q · v` (treating v as a quaternion with `w = 0`),
|
|
7
|
+
* then `result = t · q*` (where `q* = (-qx, -qy, -qz, qw)`). Inline
|
|
8
|
+
* the sign of the conjugate so the final multiplies avoid temporary
|
|
9
|
+
* negations.
|
|
10
|
+
*
|
|
11
|
+
* Sign convention: `(qx, qy, qz, qw)` — `w` last, matching the
|
|
12
|
+
* project's existing {@link Quaternion} class and the rest of the
|
|
13
|
+
* `core/geom/3d/quaternion/` family.
|
|
14
|
+
*
|
|
15
|
+
* Companion to {@link v3_quat3_apply_inverse} (rotates by the
|
|
16
|
+
* conjugate, i.e. inverse rotation).
|
|
17
|
+
*
|
|
18
|
+
* @param {number[]|Float32Array|Float64Array} out
|
|
19
|
+
* @param {number} out_offset offset into `out`; receives 3 floats
|
|
20
|
+
* @param {number} vx
|
|
21
|
+
* @param {number} vy
|
|
22
|
+
* @param {number} vz
|
|
23
|
+
* @param {number} qx unit quaternion x
|
|
24
|
+
* @param {number} qy
|
|
25
|
+
* @param {number} qz
|
|
26
|
+
* @param {number} qw unit quaternion w (last)
|
|
27
|
+
*/
|
|
28
|
+
export function v3_quat3_apply(out: number[] | Float32Array | Float64Array, out_offset: number, vx: number, vy: number, vz: number, qx: number, qy: number, qz: number, qw: number): void;
|
|
29
|
+
//# sourceMappingURL=v3_quat3_apply.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"v3_quat3_apply.d.ts","sourceRoot":"","sources":["../../../../../src/core/geom/vec3/v3_quat3_apply.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,oCAVW,MAAM,EAAE,GAAC,YAAY,GAAC,YAAY,cAClC,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,QAahB"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Rotate a 3-D vector by a unit quaternion: `result = q · v · q*`.
|
|
3
|
+
*
|
|
4
|
+
* The closed-form expansion below is the standard "two Hamilton
|
|
5
|
+
* products with a pure-quaternion v" derivation. We compute the
|
|
6
|
+
* intermediate `t = q · v` (treating v as a quaternion with `w = 0`),
|
|
7
|
+
* then `result = t · q*` (where `q* = (-qx, -qy, -qz, qw)`). Inline
|
|
8
|
+
* the sign of the conjugate so the final multiplies avoid temporary
|
|
9
|
+
* negations.
|
|
10
|
+
*
|
|
11
|
+
* Sign convention: `(qx, qy, qz, qw)` — `w` last, matching the
|
|
12
|
+
* project's existing {@link Quaternion} class and the rest of the
|
|
13
|
+
* `core/geom/3d/quaternion/` family.
|
|
14
|
+
*
|
|
15
|
+
* Companion to {@link v3_quat3_apply_inverse} (rotates by the
|
|
16
|
+
* conjugate, i.e. inverse rotation).
|
|
17
|
+
*
|
|
18
|
+
* @param {number[]|Float32Array|Float64Array} out
|
|
19
|
+
* @param {number} out_offset offset into `out`; receives 3 floats
|
|
20
|
+
* @param {number} vx
|
|
21
|
+
* @param {number} vy
|
|
22
|
+
* @param {number} vz
|
|
23
|
+
* @param {number} qx unit quaternion x
|
|
24
|
+
* @param {number} qy
|
|
25
|
+
* @param {number} qz
|
|
26
|
+
* @param {number} qw unit quaternion w (last)
|
|
27
|
+
*/
|
|
28
|
+
export function v3_quat3_apply(out, out_offset, vx, vy, vz, qx, qy, qz, qw) {
|
|
29
|
+
// t = q · v (Hamilton product, v as pure quaternion w=0)
|
|
30
|
+
const tx = qw * vx + qy * vz - qz * vy;
|
|
31
|
+
const ty = qw * vy + qz * vx - qx * vz;
|
|
32
|
+
const tz = qw * vz + qx * vy - qy * vx;
|
|
33
|
+
const tw = -qx * vx - qy * vy - qz * vz;
|
|
34
|
+
|
|
35
|
+
// result = t · q* (q* = -qx, -qy, -qz, qw)
|
|
36
|
+
out[out_offset] = tx * qw - tw * qx - ty * qz + tz * qy;
|
|
37
|
+
out[out_offset + 1] = ty * qw - tw * qy - tz * qx + tx * qz;
|
|
38
|
+
out[out_offset + 2] = tz * qw - tw * qz - tx * qy + ty * qx;
|
|
39
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Inverse-rotate a 3-D vector by a unit quaternion: `result = q* · v · q`,
|
|
3
|
+
* where `q* = (-qx, -qy, -qz, qw)` is the conjugate.
|
|
4
|
+
*
|
|
5
|
+
* Geometrically: if {@link v3_quat3_apply} rotates a body-local vector
|
|
6
|
+
* into world space (`v_world = q · v_local · q*`), this is the inverse —
|
|
7
|
+
* it takes a world-space vector and writes it in body-local coordinates.
|
|
8
|
+
* For unit quaternions the conjugate IS the inverse, so the two
|
|
9
|
+
* functions are exact inverses of each other.
|
|
10
|
+
*
|
|
11
|
+
* Implementation: the conjugate's `xyz` are negated relative to `q`.
|
|
12
|
+
* Expanding `c · v · c*` with `(cx, cy, cz, cw) = (-qx, -qy, -qz, qw)`
|
|
13
|
+
* and simplifying produces the closed form below — different sign
|
|
14
|
+
* pattern than {@link v3_quat3_apply}, NOT just a call with negated
|
|
15
|
+
* components (the optimisation matters for hot-path callers such as
|
|
16
|
+
* `PosedShape.support` and the per-triangle concave dispatch in
|
|
17
|
+
* `narrowphase_step`).
|
|
18
|
+
*
|
|
19
|
+
* @param {number[]|Float32Array|Float64Array} out
|
|
20
|
+
* @param {number} out_offset offset into `out`; receives 3 floats
|
|
21
|
+
* @param {number} vx
|
|
22
|
+
* @param {number} vy
|
|
23
|
+
* @param {number} vz
|
|
24
|
+
* @param {number} qx unit quaternion x
|
|
25
|
+
* @param {number} qy
|
|
26
|
+
* @param {number} qz
|
|
27
|
+
* @param {number} qw unit quaternion w (last)
|
|
28
|
+
*/
|
|
29
|
+
export function v3_quat3_apply_inverse(out: number[] | Float32Array | Float64Array, out_offset: number, vx: number, vy: number, vz: number, qx: number, qy: number, qz: number, qw: number): void;
|
|
30
|
+
//# sourceMappingURL=v3_quat3_apply_inverse.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"v3_quat3_apply_inverse.d.ts","sourceRoot":"","sources":["../../../../../src/core/geom/vec3/v3_quat3_apply_inverse.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,4CAVW,MAAM,EAAE,GAAC,YAAY,GAAC,YAAY,cAClC,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,QAchB"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Inverse-rotate a 3-D vector by a unit quaternion: `result = q* · v · q`,
|
|
3
|
+
* where `q* = (-qx, -qy, -qz, qw)` is the conjugate.
|
|
4
|
+
*
|
|
5
|
+
* Geometrically: if {@link v3_quat3_apply} rotates a body-local vector
|
|
6
|
+
* into world space (`v_world = q · v_local · q*`), this is the inverse —
|
|
7
|
+
* it takes a world-space vector and writes it in body-local coordinates.
|
|
8
|
+
* For unit quaternions the conjugate IS the inverse, so the two
|
|
9
|
+
* functions are exact inverses of each other.
|
|
10
|
+
*
|
|
11
|
+
* Implementation: the conjugate's `xyz` are negated relative to `q`.
|
|
12
|
+
* Expanding `c · v · c*` with `(cx, cy, cz, cw) = (-qx, -qy, -qz, qw)`
|
|
13
|
+
* and simplifying produces the closed form below — different sign
|
|
14
|
+
* pattern than {@link v3_quat3_apply}, NOT just a call with negated
|
|
15
|
+
* components (the optimisation matters for hot-path callers such as
|
|
16
|
+
* `PosedShape.support` and the per-triangle concave dispatch in
|
|
17
|
+
* `narrowphase_step`).
|
|
18
|
+
*
|
|
19
|
+
* @param {number[]|Float32Array|Float64Array} out
|
|
20
|
+
* @param {number} out_offset offset into `out`; receives 3 floats
|
|
21
|
+
* @param {number} vx
|
|
22
|
+
* @param {number} vy
|
|
23
|
+
* @param {number} vz
|
|
24
|
+
* @param {number} qx unit quaternion x
|
|
25
|
+
* @param {number} qy
|
|
26
|
+
* @param {number} qz
|
|
27
|
+
* @param {number} qw unit quaternion w (last)
|
|
28
|
+
*/
|
|
29
|
+
export function v3_quat3_apply_inverse(out, out_offset, vx, vy, vz, qx, qy, qz, qw) {
|
|
30
|
+
// t = q* · v (conjugate · v, v as pure quaternion w=0)
|
|
31
|
+
// Conjugate xyz negated; expanded:
|
|
32
|
+
const tx = qw * vx - qy * vz + qz * vy;
|
|
33
|
+
const ty = qw * vy - qz * vx + qx * vz;
|
|
34
|
+
const tz = qw * vz - qx * vy + qy * vx;
|
|
35
|
+
const tw = qx * vx + qy * vy + qz * vz; // note: +, conjugate-w stays qw
|
|
36
|
+
|
|
37
|
+
// result = t · q (q is the conjugate-of-conjugate)
|
|
38
|
+
out[out_offset] = tx * qw + tw * qx + ty * qz - tz * qy;
|
|
39
|
+
out[out_offset + 1] = ty * qw + tw * qy + tz * qx - tx * qz;
|
|
40
|
+
out[out_offset + 2] = tz * qw + tw * qz + tx * qy - ty * qx;
|
|
41
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compute the triple cross product `(a × b) × a` in 3D.
|
|
3
|
+
*
|
|
4
|
+
* Identity used in GJK and related Voronoi-region searches: given an
|
|
5
|
+
* edge `a` from a simplex and the vector `b` from one endpoint toward
|
|
6
|
+
* the origin (or any other "where do we want to go" reference), the
|
|
7
|
+
* triple cross gives a direction PERPENDICULAR to `a` that lies in
|
|
8
|
+
* the plane of `(a, b)` and points toward `b`. This is the right
|
|
9
|
+
* search direction to extend the simplex away from the edge toward
|
|
10
|
+
* the origin without re-entering territory already covered.
|
|
11
|
+
*
|
|
12
|
+
* Sign convention: `result = (a × b) × a` (not `a × (b × a)` — the
|
|
13
|
+
* triple cross product is not associative).
|
|
14
|
+
*
|
|
15
|
+
* The function is allocation-free: `result` is a caller-provided
|
|
16
|
+
* typed array (or array-like) that receives the three components
|
|
17
|
+
* starting at `result_offset`. `a` and `b` are passed as raw scalar
|
|
18
|
+
* components, matching the convention of {@link v3_compute_triangle_normal}
|
|
19
|
+
* and the rest of the scalar-input vec3 helpers.
|
|
20
|
+
*
|
|
21
|
+
* @param {number[]|Float32Array|Float64Array} result destination
|
|
22
|
+
* @param {number} result_offset offset into `result` where the
|
|
23
|
+
* three output components are written
|
|
24
|
+
* @param {number} ax first input vector x
|
|
25
|
+
* @param {number} ay first input vector y
|
|
26
|
+
* @param {number} az first input vector z
|
|
27
|
+
* @param {number} bx second input vector x
|
|
28
|
+
* @param {number} by second input vector y
|
|
29
|
+
* @param {number} bz second input vector z
|
|
30
|
+
*/
|
|
31
|
+
export function v3_triple_cross_product(result: number[] | Float32Array | Float64Array, result_offset: number, ax: number, ay: number, az: number, bx: number, by: number, bz: number): void;
|
|
32
|
+
//# sourceMappingURL=v3_triple_cross_product.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"v3_triple_cross_product.d.ts","sourceRoot":"","sources":["../../../../../src/core/geom/vec3/v3_triple_cross_product.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,gDAVW,MAAM,EAAE,GAAC,YAAY,GAAC,YAAY,iBAClC,MAAM,MAEN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,QAgBhB"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compute the triple cross product `(a × b) × a` in 3D.
|
|
3
|
+
*
|
|
4
|
+
* Identity used in GJK and related Voronoi-region searches: given an
|
|
5
|
+
* edge `a` from a simplex and the vector `b` from one endpoint toward
|
|
6
|
+
* the origin (or any other "where do we want to go" reference), the
|
|
7
|
+
* triple cross gives a direction PERPENDICULAR to `a` that lies in
|
|
8
|
+
* the plane of `(a, b)` and points toward `b`. This is the right
|
|
9
|
+
* search direction to extend the simplex away from the edge toward
|
|
10
|
+
* the origin without re-entering territory already covered.
|
|
11
|
+
*
|
|
12
|
+
* Sign convention: `result = (a × b) × a` (not `a × (b × a)` — the
|
|
13
|
+
* triple cross product is not associative).
|
|
14
|
+
*
|
|
15
|
+
* The function is allocation-free: `result` is a caller-provided
|
|
16
|
+
* typed array (or array-like) that receives the three components
|
|
17
|
+
* starting at `result_offset`. `a` and `b` are passed as raw scalar
|
|
18
|
+
* components, matching the convention of {@link v3_compute_triangle_normal}
|
|
19
|
+
* and the rest of the scalar-input vec3 helpers.
|
|
20
|
+
*
|
|
21
|
+
* @param {number[]|Float32Array|Float64Array} result destination
|
|
22
|
+
* @param {number} result_offset offset into `result` where the
|
|
23
|
+
* three output components are written
|
|
24
|
+
* @param {number} ax first input vector x
|
|
25
|
+
* @param {number} ay first input vector y
|
|
26
|
+
* @param {number} az first input vector z
|
|
27
|
+
* @param {number} bx second input vector x
|
|
28
|
+
* @param {number} by second input vector y
|
|
29
|
+
* @param {number} bz second input vector z
|
|
30
|
+
*/
|
|
31
|
+
export function v3_triple_cross_product(
|
|
32
|
+
result, result_offset,
|
|
33
|
+
ax, ay, az,
|
|
34
|
+
bx, by, bz
|
|
35
|
+
) {
|
|
36
|
+
// First: t = a × b
|
|
37
|
+
const tx = ay * bz - az * by;
|
|
38
|
+
const ty = az * bx - ax * bz;
|
|
39
|
+
const tz = ax * by - ay * bx;
|
|
40
|
+
|
|
41
|
+
// Then: t × a
|
|
42
|
+
result[result_offset] = ty * az - tz * ay;
|
|
43
|
+
result[result_offset + 1] = tz * ax - tx * az;
|
|
44
|
+
result[result_offset + 2] = tx * ay - ty * ax;
|
|
45
|
+
}
|
|
@@ -55,7 +55,7 @@ export class FirstPersonPlayerController {
|
|
|
55
55
|
sprintSpeed: number;
|
|
56
56
|
crouchSpeed: number;
|
|
57
57
|
airControl: number;
|
|
58
|
-
|
|
58
|
+
groundAccelHalfLife: number;
|
|
59
59
|
groundDecel: number;
|
|
60
60
|
airAccel: number;
|
|
61
61
|
backwardSpeedFactor: number;
|
|
@@ -68,9 +68,20 @@ export class FirstPersonPlayerController {
|
|
|
68
68
|
};
|
|
69
69
|
peakHeight: number;
|
|
70
70
|
timeToApex: number;
|
|
71
|
+
/**
|
|
72
|
+
* First-person camera + body controller. See DESIGN.md (sibling file) for
|
|
73
|
+
* the goals, layered architecture, and tuning rationale.
|
|
74
|
+
*
|
|
75
|
+
* Lifecycle: only `config` is serialized. `intent`, `state`, `pose`,
|
|
76
|
+
* `signals`, and `eyeEntity` are transient — rebuilt by the system on
|
|
77
|
+
* link.
|
|
78
|
+
*
|
|
79
|
+
* @author Alex Goldring
|
|
80
|
+
* @copyright Company Named Limited (c) 2026
|
|
81
|
+
*/
|
|
71
82
|
coyoteTime: number;
|
|
72
83
|
bufferTime: number;
|
|
73
|
-
fallGravityMult: number;
|
|
84
|
+
fallGravityMult: number;
|
|
74
85
|
cutGravityMult: number;
|
|
75
86
|
};
|
|
76
87
|
landing: {
|
|
@@ -104,7 +115,9 @@ export class FirstPersonPlayerController {
|
|
|
104
115
|
};
|
|
105
116
|
wallRun: {
|
|
106
117
|
minSpeed: number;
|
|
107
|
-
minAirborneTime: number;
|
|
118
|
+
minAirborneTime: number; /**
|
|
119
|
+
* @param {FirstPersonPlayerController} other
|
|
120
|
+
*/
|
|
108
121
|
maxDuration: number;
|
|
109
122
|
gravityFactor: number;
|
|
110
123
|
cameraRollDeg: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FirstPersonPlayerController.d.ts","sourceRoot":"","sources":["../../../../../src/engine/control/first-person/FirstPersonPlayerController.js"],"names":[],"mappings":"AA8HA;;;;;;;;;;GAUG;AACH;IACI,wBAAgD;IAG5C,0CAAqD;IACrD,0BAAqC;IACrC,wBAAmC;IACnC,sBAAiC;IACjC,4BAAuC;IAEvC;;;;;;OAMG;IACH,SAFU,UAAU,CAEW;IAE/B;;;;;OAKG;IACH,WAFU,UAAU,CAEa;IAEjC;;;;;;OAMG;IACH,WAFU,MAAM,CAEG;IAGvB
|
|
1
|
+
{"version":3,"file":"FirstPersonPlayerController.d.ts","sourceRoot":"","sources":["../../../../../src/engine/control/first-person/FirstPersonPlayerController.js"],"names":[],"mappings":"AA8HA;;;;;;;;;;GAUG;AACH;IACI,wBAAgD;IAG5C,0CAAqD;IACrD,0BAAqC;IACrC,wBAAmC;IACnC,sBAAiC;IACjC,4BAAuC;IAEvC;;;;;;OAMG;IACH,SAFU,UAAU,CAEW;IAE/B;;;;;OAKG;IACH,WAFU,UAAU,CAEa;IAEjC;;;;;;OAMG;IACH,WAFU,MAAM,CAEG;IAGvB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBAhDJ;;;;;;;;;;mBAUG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yCAgDC;;mBAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAVF;IAED,0BAIC;IAED;;OAEG;IACH,YAFW,2BAA2B,QAKrC;IAED,qCAIC;IAED,4BAGC;IAED,eAGC;CACJ;;;;;kDA3MiD,wCAAwC;AAK1F;;;;;;;;GAQG;AACH;IACI,oEAAoE;IACpE,MADyD,OAAO,CACvC;IAEzB;;;;OAIG;IACH,MAFU,OAAO,CAEQ;IAEzB,mEAAmE;IACnE,MADwD,OAAO,CAClD;IAEb,0EAA0E;IAC1E,QAD+D,OAAO,CACvD;IAEf,qEAAqE;IACrE,QAD0D,OAAO,CAClD;CAClB;AAED;;;GAGG;AACH;IACI,kBAAgB;IAChB,0BAAsB;IAEtB,4EAA4E;IAC5E,sBAAoC;IACpC,gBAAkB;IAElB,cAAU;IACV,4DAA4D;IAC5D,wBAAoB;IACpB,yEAAyE;IACzE,uBAAgD;IAEhD,sBAAkB;IAClB,qBAAiB;IACjB,qBAAiB;IAEjB,4BAAwB;IACxB,4BAA2B;IAC3B,2BAA0B;IAC1B,2EAA2E;IAC3E,qBAAoB;IAEpB,iBAAa;IACb,oBAAgB;IAChB,qBAAiB;IACjB,yBAAqB;IAErB,oBAAgB;IAChB,kBAAc;IACd,kDAAkD;IAClD,iBAAa;IAEb,kBAAiB;IAEjB,+EAA+E;IAC/E,uBAAsB;IACtB,6EAA6E;IAC7E,sBAAqB;IAErB;;;;;;;OAOG;IACH,SAFU,MAAM,CAEmB;IAEnC,oBAAgB;CACnB;gCAzFkF,2BAA2B;AA2F9G;;;GAGG;AACH;IACI,uDAAuD;IACvD,2DAA0B;IAC1B,yEAAyE;IACzE,4DAA2B;IAC3B,kBAAkB;IAClB,2DAA0B;IAC1B,6BAA6B;IAC7B,8DAA6B;IAC7B,iDAAiD;IACjD,uDAAsB;IACtB,8DAA6B;IAC7B,6DAA4B;IAC5B,8DAA6B;IAC7B,6DAA4B;IAC5B,2EAA2E;IAC3E,2DAA0B;IAC1B,2EAA2E;IAC3E,4DAA2B;IAC3B,6DAA6D;IAC7D,4DAA2B;IAC3B,uDAAuD;IACvD,+DAA8B;CACjC;2BAvH0B,yBAAyB;2BAFzB,2BAA2B;uCAG6B,2BAA2B;0CAA3B,2BAA2B;oBAL1F,+BAA+B;oBAC/B,+BAA+B;mBAFhC,uCAAuC"}
|