@woosh/meep-engine 2.145.0 → 2.146.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/HeightMapShape3D.d.ts +33 -3
- package/src/core/geom/3d/shape/HeightMapShape3D.d.ts.map +1 -1
- package/src/core/geom/3d/shape/HeightMapShape3D.js +486 -451
- package/src/engine/control/first-person/DESIGN_COLLISION.md +365 -352
- package/src/engine/control/first-person/FirstPersonPlayerController.d.ts +1 -3
- package/src/engine/control/first-person/FirstPersonPlayerController.d.ts.map +1 -1
- package/src/engine/control/first-person/FirstPersonPlayerControllerConfig.d.ts +12 -2
- package/src/engine/control/first-person/FirstPersonPlayerControllerConfig.d.ts.map +1 -1
- package/src/engine/control/first-person/FirstPersonPlayerControllerConfig.js +7 -2
- package/src/engine/control/first-person/TODO.md +13 -11
- package/src/engine/control/first-person/abilities/WallJump.d.ts.map +1 -1
- package/src/engine/control/first-person/abilities/WallJump.js +11 -3
- package/src/engine/control/first-person/abilities/WallRun.d.ts.map +1 -1
- package/src/engine/control/first-person/abilities/WallRun.js +12 -0
- package/src/engine/control/first-person/collision/KinematicMover.d.ts.map +1 -1
- package/src/engine/control/first-person/collision/KinematicMover.js +634 -592
- package/src/engine/control/first-person/prototype_first_person_controller.js +1003 -901
- package/src/engine/physics/PLAN.md +943 -809
- package/src/engine/physics/body/BodyStorage.d.ts +9 -0
- package/src/engine/physics/body/BodyStorage.d.ts.map +1 -1
- package/src/engine/physics/body/BodyStorage.js +23 -0
- package/src/engine/physics/broadphase/generate_pairs.d.ts.map +1 -1
- package/src/engine/physics/broadphase/generate_pairs.js +7 -0
- package/src/engine/physics/ccd/linear_sweep.d.ts +97 -0
- package/src/engine/physics/ccd/linear_sweep.d.ts.map +1 -0
- package/src/engine/physics/ccd/linear_sweep.js +238 -0
- package/src/engine/physics/ecs/PhysicsSystem.d.ts +18 -3
- package/src/engine/physics/ecs/PhysicsSystem.d.ts.map +1 -1
- package/src/engine/physics/ecs/PhysicsSystem.js +59 -8
- package/src/engine/physics/ecs/RigidBodyFlags.d.ts +6 -0
- package/src/engine/physics/ecs/RigidBodyFlags.d.ts.map +1 -1
- package/src/engine/physics/ecs/RigidBodyFlags.js +6 -0
- package/src/engine/physics/narrowphase/box_triangle_contact.js +811 -811
- package/src/engine/physics/narrowphase/compute_penetration.d.ts.map +1 -1
- package/src/engine/physics/narrowphase/compute_penetration.js +325 -323
- package/src/engine/physics/narrowphase/decomposition/heightmap_enumerate_triangles.d.ts +27 -8
- package/src/engine/physics/narrowphase/decomposition/heightmap_enumerate_triangles.d.ts.map +1 -1
- package/src/engine/physics/narrowphase/decomposition/heightmap_enumerate_triangles.js +235 -204
- package/src/engine/physics/narrowphase/narrowphase_step.d.ts.map +1 -1
- package/src/engine/physics/narrowphase/narrowphase_step.js +70 -13
- package/src/engine/physics/queries/overlap_shape.d.ts.map +1 -1
- package/src/engine/physics/queries/overlap_shape.js +185 -183
- package/src/engine/simulation/Ticker.d.ts +14 -0
- package/src/engine/simulation/Ticker.d.ts.map +1 -1
- package/src/engine/simulation/Ticker.js +136 -1
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"description": "Pure JavaScript game engine. Fully featured and production ready.",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"author": "Alexander Goldring",
|
|
9
|
-
"version": "2.
|
|
9
|
+
"version": "2.146.0",
|
|
10
10
|
"main": "build/meep.module.js",
|
|
11
11
|
"module": "build/meep.module.js",
|
|
12
12
|
"exports": {
|
|
@@ -4,8 +4,17 @@
|
|
|
4
4
|
* The shape is a closed solid bounded below by the plane perpendicular to
|
|
5
5
|
* {@link orientation} (the "floor") and above by a height-field surface
|
|
6
6
|
* defined by a {@link Sampler2D}. Heights are sampled with Catmull-Rom
|
|
7
|
-
* filtering ({@link Sampler2D#sampleChannelCatmullRomUV})
|
|
8
|
-
* the terrain
|
|
7
|
+
* filtering ({@link Sampler2D#sampleChannelCatmullRomUV}) — the *same* cubic
|
|
8
|
+
* the terrain renderer uses (`sampleChannelBicubicUV` expands to the
|
|
9
|
+
* identical Catmull-Rom weights, with the matching `u·width − 0.5` UV
|
|
10
|
+
* convention), so the collision and render surfaces coincide at every point
|
|
11
|
+
* they both sample.
|
|
12
|
+
*
|
|
13
|
+
* They differ only in *tessellation density*: the renderer lays out
|
|
14
|
+
* `size × resolution` segments per side, while collision defaults to one
|
|
15
|
+
* quad per sampler cell. {@link tessellation} closes that gap — set it > 1
|
|
16
|
+
* to subdivide each sampler cell into N×N sub-cells so the contact surface
|
|
17
|
+
* approaches render fidelity even when the sampler is deliberately coarse.
|
|
9
18
|
*
|
|
10
19
|
* Local frame layout:
|
|
11
20
|
* - The orientation vector defines the local "up" axis (unit).
|
|
@@ -34,9 +43,12 @@ export class HeightMapShape3D extends AbstractShape3D {
|
|
|
34
43
|
* @param {number} size_y maximum heightmap height (along orientation)
|
|
35
44
|
* @param {number} size_z footprint extent along basis-v
|
|
36
45
|
* @param {Vector3} [orientation] defaults to +Y
|
|
46
|
+
* @param {number} [tessellation] collision sub-cells per sampler cell per
|
|
47
|
+
* axis; non-negative integer, defaults to 1 (one quad per sampler cell).
|
|
48
|
+
* See {@link HeightMapShape3D#tessellation}.
|
|
37
49
|
* @returns {HeightMapShape3D}
|
|
38
50
|
*/
|
|
39
|
-
static from(sampler: Sampler2D, size_x: number, size_y: number, size_z: number, orientation?: Vector3): HeightMapShape3D;
|
|
51
|
+
static from(sampler: Sampler2D, size_x: number, size_y: number, size_z: number, orientation?: Vector3, tessellation?: number): HeightMapShape3D;
|
|
40
52
|
/**
|
|
41
53
|
* Unit vector defining the local "up" axis (the direction the
|
|
42
54
|
* heightmap's surface faces). Default is +Y.
|
|
@@ -60,6 +72,24 @@ export class HeightMapShape3D extends AbstractShape3D {
|
|
|
60
72
|
* @type {Sampler2D | null}
|
|
61
73
|
*/
|
|
62
74
|
sampler: Sampler2D | null;
|
|
75
|
+
/**
|
|
76
|
+
* Collision tessellation factor: the narrowphase splits each sampler
|
|
77
|
+
* cell into `tessellation × tessellation` sub-cells before emitting
|
|
78
|
+
* collision triangles, sampling the same Catmull-Rom filter at the
|
|
79
|
+
* finer sub-cell corners. `1` (the default) is one quad per sampler
|
|
80
|
+
* cell — the legacy behaviour. Larger values let a coarse sampler's
|
|
81
|
+
* contact surface approach the rendered mesh's fidelity.
|
|
82
|
+
*
|
|
83
|
+
* Non-negative integer (validated by {@link HeightMapShape3D.from});
|
|
84
|
+
* cost is O(N²) per cell, so the caller owns the fidelity/cost
|
|
85
|
+
* trade-off. `0` yields no collision triangles — the degenerate empty
|
|
86
|
+
* case, mirroring a zero footprint size. Affects only triangle
|
|
87
|
+
* enumeration — the continuous queries ({@link sample_height_at_uv},
|
|
88
|
+
* {@link signed_distance_at_point}, {@link nearest_point_on_surface})
|
|
89
|
+
* read the smooth filter directly and are unaffected.
|
|
90
|
+
* @type {number}
|
|
91
|
+
*/
|
|
92
|
+
tessellation: number;
|
|
63
93
|
/**
|
|
64
94
|
* Cached orthonormal basis [u_x,u_y,u_z, v_x,v_y,v_z, n_x,n_y,n_z]
|
|
65
95
|
* built from {@link orientation}. Updated lazily by {@link _ensure_basis}.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HeightMapShape3D.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/3d/shape/HeightMapShape3D.js"],"names":[],"mappings":"AAMA
|
|
1
|
+
{"version":3,"file":"HeightMapShape3D.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/3d/shape/HeightMapShape3D.js"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH;IA+DI;;;;;;;;;;;OAWG;IACH,wCATW,MAAM,UACN,MAAM,UACN,MAAM,gBACN,OAAO,iBACP,MAAM,GAGJ,gBAAgB,CAqB5B;IA1FG;;;;;OAKG;IACH,sBAFU,OAAO,CAEsB;IAEvC;;;;;;;OAOG;IACH,eAFU,OAAO,CAEe;IAEhC;;;;;OAKG;IACH,SAFU,YAAY,IAAI,CAEP;IAEnB;;;;;;;;;;;;;;;;OAgBG;IACH,cAFU,MAAM,CAEK;IAErB;;;;;OAKG;IACH,eAAiC;IAGjC,6BAA+B;IAC/B,6BAA+B;IAC/B,6BAA+B;IAoCnC;;;;;;;;;OASG;IACH,sBA+CC;IAED;;;;;;OAMG;IACH,yBAJW,MAAM,OACN,MAAM,GACJ,MAAM,CAIlB;IAED;;;;;;;;OAQG;IACH,8BALW,MAAM,MACN,MAAM,MACN,MAAM,GACJ,MAAM,CAelB;IAED,wCA8BC;IAED,oCA2BC;IAED;;;;;;;;OAQG;IACH,6CAmBC;IAED;;;;OAIG;IACH,4DA2BC;IAED;;;;;;;;;OASG;IACH,qGAEC;IAED,kFAiBC;IA6CD;;;OAGG;IACH,cAHW,gBAAgB,GACd,OAAO,CAiBnB;IAeL;;;;;;OAMG;IACH,6BAFU,OAAO,CAE4B;CAT5C;gCA9c+B,sBAAsB;wBAD9B,kBAAkB"}
|