@woosh/meep-engine 3.63.3 → 3.64.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/CHANGELOG.md +51 -0
- package/package.json +1 -1
- package/src/core/color/xyz/m3_chromatic_adaptation_bradford.d.ts +14 -0
- package/src/core/color/xyz/m3_chromatic_adaptation_bradford.d.ts.map +1 -0
- package/src/core/color/xyz/m3_chromatic_adaptation_bradford.js +51 -0
- package/src/core/math/linalg/eigen/matrix_symmetric_3x3_eigen.d.ts +2 -1
- package/src/core/math/linalg/eigen/matrix_symmetric_3x3_eigen.d.ts.map +1 -1
- package/src/core/math/linalg/eigen/matrix_symmetric_3x3_eigen.js +51 -70
- package/src/core/math/linalg/eigen/matrix_symmetric_4x4_eigen.d.ts.map +1 -1
- package/src/core/math/linalg/eigen/matrix_symmetric_4x4_eigen.js +8 -64
- package/src/core/math/linalg/eigen/matrix_symmetric_jacobi_rotate_in_place.d.ts +17 -0
- package/src/core/math/linalg/eigen/matrix_symmetric_jacobi_rotate_in_place.d.ts.map +1 -0
- package/src/core/math/linalg/eigen/matrix_symmetric_jacobi_rotate_in_place.js +64 -0
- package/src/core/math/linalg/solve_box_constrained_qp.d.ts +30 -0
- package/src/core/math/linalg/solve_box_constrained_qp.d.ts.map +1 -0
- package/src/core/math/linalg/solve_box_constrained_qp.js +205 -0
- package/src/engine/physics/constraint/soft_spring_coefficients.d.ts +24 -0
- package/src/engine/physics/constraint/soft_spring_coefficients.d.ts.map +1 -0
- package/src/engine/physics/constraint/soft_spring_coefficients.js +38 -0
- package/src/engine/physics/constraint/solve_constraints.d.ts.map +1 -1
- package/src/engine/physics/constraint/solve_constraints.js +16 -8
- package/src/engine/physics/ecs/PhysicsSystem.d.ts +54 -0
- package/src/engine/physics/ecs/PhysicsSystem.d.ts.map +1 -1
- package/src/engine/physics/ecs/PhysicsSystem.js +192 -7
- package/src/engine/physics/fluid/ecs/FluidObstacleSystem.d.ts +4 -4
- package/src/engine/physics/inertia/world_inverse_inertia.d.ts +3 -5
- package/src/engine/physics/inertia/world_inverse_inertia.d.ts.map +1 -1
- package/src/engine/physics/inertia/world_inverse_inertia.js +3 -5
- package/src/engine/physics/vehicle/RaycastVehicle.d.ts +183 -12
- package/src/engine/physics/vehicle/RaycastVehicle.d.ts.map +1 -1
- package/src/engine/physics/vehicle/RaycastVehicle.js +1046 -121
- package/src/shade/playground/tonemap_sdr/README.md +11 -8
- package/src/shade/playground/tonemap_sdr/ToneMapCompare.js +2 -2
- package/src/shade/renderer/Renderer.d.ts +5 -6
- package/src/shade/renderer/Renderer.d.ts.map +1 -1
- package/src/shade/renderer/Renderer.js +15 -88
- package/src/shade/renderer/animation/chunk_animation_curve_evaluate_keys.d.ts +14 -0
- package/src/shade/renderer/animation/chunk_animation_curve_evaluate_keys.d.ts.map +1 -0
- package/src/shade/renderer/animation/chunk_animation_curve_evaluate_keys.js +62 -0
- package/src/shade/renderer/deferred/tonemap/ColorGrade.d.ts +158 -0
- package/src/shade/renderer/deferred/tonemap/ColorGrade.d.ts.map +1 -0
- package/src/shade/renderer/deferred/tonemap/ColorGrade.js +337 -0
- package/src/shade/renderer/deferred/tonemap/SAMPLER_TONEMAP_LUT.d.ts +9 -0
- package/src/shade/renderer/deferred/tonemap/SAMPLER_TONEMAP_LUT.d.ts.map +1 -0
- package/src/shade/renderer/deferred/tonemap/SAMPLER_TONEMAP_LUT.js +15 -0
- package/src/shade/renderer/deferred/tonemap/TONE_MAP_OPERATOR_ACES.d.ts +6 -0
- package/src/shade/renderer/deferred/tonemap/TONE_MAP_OPERATOR_ACES.d.ts.map +1 -0
- package/src/shade/renderer/deferred/tonemap/TONE_MAP_OPERATOR_ACES.js +84 -0
- package/src/shade/renderer/deferred/tonemap/TONE_MAP_OPERATOR_GT7.d.ts +10 -0
- package/src/shade/renderer/deferred/tonemap/TONE_MAP_OPERATOR_GT7.d.ts.map +1 -0
- package/src/shade/renderer/deferred/tonemap/TONE_MAP_OPERATOR_GT7.js +25 -0
- package/src/shade/renderer/deferred/tonemap/TONE_MAP_OPERATOR_NONE.d.ts +9 -0
- package/src/shade/renderer/deferred/tonemap/TONE_MAP_OPERATOR_NONE.d.ts.map +1 -0
- package/src/shade/renderer/deferred/tonemap/TONE_MAP_OPERATOR_NONE.js +20 -0
- package/src/shade/renderer/deferred/tonemap/TONE_MAP_OPERATOR_PBR_NEUTRAL.d.ts +14 -0
- package/src/shade/renderer/deferred/tonemap/TONE_MAP_OPERATOR_PBR_NEUTRAL.d.ts.map +1 -0
- package/src/shade/renderer/deferred/tonemap/TONE_MAP_OPERATOR_PBR_NEUTRAL.js +30 -0
- package/src/shade/renderer/deferred/tonemap/ToneMapOperator.d.ts +54 -0
- package/src/shade/renderer/deferred/tonemap/ToneMapOperator.d.ts.map +1 -0
- package/src/shade/renderer/deferred/tonemap/ToneMapOperator.js +63 -0
- package/src/shade/renderer/deferred/tonemap/ToneMapper.d.ts +106 -0
- package/src/shade/renderer/deferred/tonemap/ToneMapper.d.ts.map +1 -0
- package/src/shade/renderer/deferred/tonemap/ToneMapper.js +474 -0
- package/src/shade/renderer/deferred/tonemap/TonemapAces2Tables.d.ts +5 -13
- package/src/shade/renderer/deferred/tonemap/TonemapAces2Tables.d.ts.map +1 -1
- package/src/shade/renderer/deferred/tonemap/TonemapAces2Tables.js +5 -44
- package/src/shade/renderer/deferred/tonemap/TonemapDisplaySettings.d.ts +7 -25
- package/src/shade/renderer/deferred/tonemap/TonemapDisplaySettings.d.ts.map +1 -1
- package/src/shade/renderer/deferred/tonemap/TonemapDisplaySettings.js +11 -51
- package/src/shade/renderer/deferred/tonemap/m3_white_balance_rec709.d.ts +20 -0
- package/src/shade/renderer/deferred/tonemap/m3_white_balance_rec709.d.ts.map +1 -0
- package/src/shade/renderer/deferred/tonemap/m3_white_balance_rec709.js +103 -0
- package/src/shade/renderer/deferred/tonemap/shader_tonemap_HDR_lut.d.ts +9 -0
- package/src/shade/renderer/deferred/tonemap/shader_tonemap_HDR_lut.d.ts.map +1 -0
- package/src/shade/renderer/deferred/tonemap/{shader_tonemap_HDR_none.js → shader_tonemap_HDR_lut.js} +22 -18
- package/src/shade/renderer/deferred/tonemap/shader_tonemap_LDR_lut.d.ts +9 -0
- package/src/shade/renderer/deferred/tonemap/shader_tonemap_LDR_lut.d.ts.map +1 -0
- package/src/shade/renderer/deferred/tonemap/{shader_tonemap_LDR_aces.js → shader_tonemap_LDR_lut.js} +24 -24
- package/src/shade/renderer/deferred/tonemap/shader_tonemap_lut_bake.d.ts +23 -0
- package/src/shade/renderer/deferred/tonemap/shader_tonemap_lut_bake.d.ts.map +1 -0
- package/src/shade/renderer/deferred/tonemap/shader_tonemap_lut_bake.js +92 -0
- package/src/shade/renderer/deferred/tonemap/shader_tonemap_lut_sdr_from_hdr.d.ts +15 -0
- package/src/shade/renderer/deferred/tonemap/shader_tonemap_lut_sdr_from_hdr.d.ts.map +1 -0
- package/src/shade/renderer/deferred/tonemap/shader_tonemap_lut_sdr_from_hdr.js +73 -0
- package/src/shade/renderer/fluid/GPUFluidCascade.d.ts +3 -3
- package/src/shade/renderer/fluid/GPUFluidCascadeStack.d.ts +1 -1
- package/src/shade/renderer/fluid/forcing/GPUFluidForcing.d.ts +6 -6
- package/src/shade/renderer/fluid/pressure/GPUFluidPressureSolve.d.ts +1 -1
- package/src/shade/renderer/fluid/query/GPUFluidQueries.d.ts +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/GPUProbeClipmapGI.d.ts +1 -1
- package/src/shade/renderer/loader/gltf/tiny-gltf.d.ts +1 -1
- package/src/shade/renderer/postprocess/nss/NSS.d.ts +1 -1
- package/src/shade/renderer/shader/chunk/color/conversion/chunk_CRM_REC709_AP1.d.ts +22 -0
- package/src/shade/renderer/shader/chunk/color/conversion/chunk_CRM_REC709_AP1.d.ts.map +1 -0
- package/src/shade/renderer/shader/chunk/color/conversion/chunk_CRM_REC709_AP1.js +62 -0
- package/src/shade/renderer/shader/chunk/color/grade/chunk_color_grade.d.ts +13 -0
- package/src/shade/renderer/shader/chunk/color/grade/chunk_color_grade.d.ts.map +1 -0
- package/src/shade/renderer/shader/chunk/color/grade/chunk_color_grade.js +140 -0
- package/src/shade/renderer/shader/chunk/color/oklab/chunk_oklab_compute_max_saturation.d.ts +11 -0
- package/src/shade/renderer/shader/chunk/color/oklab/chunk_oklab_compute_max_saturation.d.ts.map +1 -0
- package/src/shade/renderer/shader/chunk/color/oklab/chunk_oklab_compute_max_saturation.js +65 -0
- package/src/shade/renderer/shader/chunk/color/tonemap/chunk_bt2390_eetf.d.ts +14 -0
- package/src/shade/renderer/shader/chunk/color/tonemap/chunk_bt2390_eetf.d.ts.map +1 -0
- package/src/shade/renderer/shader/chunk/color/tonemap/chunk_bt2390_eetf.js +38 -0
- package/src/shade/renderer/shader/chunk/color/tonemap/chunk_tonemap_lut.d.ts +16 -0
- package/src/shade/renderer/shader/chunk/color/tonemap/chunk_tonemap_lut.d.ts.map +1 -0
- package/src/shade/renderer/shader/chunk/color/tonemap/chunk_tonemap_lut.js +41 -0
- package/src/shade/renderer/water/query/GPUWaterQueries.d.ts +1 -1
- package/src/shade/wgsl/emulator/WGSLJavaScriptCompiler.js +8 -8
- package/src/shade/wgsl/emulator/WGSLLanguageCore.d.ts.map +1 -1
- package/src/shade/wgsl/emulator/WGSLLanguageCore.js +2 -0
- package/src/shade/renderer/ShadeToneMappingMode.d.ts +0 -15
- package/src/shade/renderer/ShadeToneMappingMode.d.ts.map +0 -1
- package/src/shade/renderer/ShadeToneMappingMode.js +0 -41
- package/src/shade/renderer/deferred/tonemap/shader_tonemap_HDR.d.ts +0 -9
- package/src/shade/renderer/deferred/tonemap/shader_tonemap_HDR.d.ts.map +0 -1
- package/src/shade/renderer/deferred/tonemap/shader_tonemap_HDR.js +0 -79
- package/src/shade/renderer/deferred/tonemap/shader_tonemap_HDR_aces.d.ts +0 -17
- package/src/shade/renderer/deferred/tonemap/shader_tonemap_HDR_aces.d.ts.map +0 -1
- package/src/shade/renderer/deferred/tonemap/shader_tonemap_HDR_aces.js +0 -101
- package/src/shade/renderer/deferred/tonemap/shader_tonemap_HDR_none.d.ts +0 -9
- package/src/shade/renderer/deferred/tonemap/shader_tonemap_HDR_none.d.ts.map +0 -1
- package/src/shade/renderer/deferred/tonemap/shader_tonemap_HDR_pbr_neutral.d.ts +0 -10
- package/src/shade/renderer/deferred/tonemap/shader_tonemap_HDR_pbr_neutral.d.ts.map +0 -1
- package/src/shade/renderer/deferred/tonemap/shader_tonemap_HDR_pbr_neutral.js +0 -80
- package/src/shade/renderer/deferred/tonemap/shader_tonemap_LDR.d.ts +0 -9
- package/src/shade/renderer/deferred/tonemap/shader_tonemap_LDR.d.ts.map +0 -1
- package/src/shade/renderer/deferred/tonemap/shader_tonemap_LDR.js +0 -80
- package/src/shade/renderer/deferred/tonemap/shader_tonemap_LDR_aces.d.ts +0 -10
- package/src/shade/renderer/deferred/tonemap/shader_tonemap_LDR_aces.d.ts.map +0 -1
- package/src/shade/renderer/deferred/tonemap/shader_tonemap_LDR_none.d.ts +0 -9
- package/src/shade/renderer/deferred/tonemap/shader_tonemap_LDR_none.d.ts.map +0 -1
- package/src/shade/renderer/deferred/tonemap/shader_tonemap_LDR_none.js +0 -71
- package/src/shade/renderer/deferred/tonemap/shader_tonemap_LDR_pbr_neutral.d.ts +0 -10
- package/src/shade/renderer/deferred/tonemap/shader_tonemap_LDR_pbr_neutral.d.ts.map +0 -1
- package/src/shade/renderer/deferred/tonemap/shader_tonemap_LDR_pbr_neutral.js +0 -76
- package/src/shade/renderer/shader/chunk/color/tonemap/chunk_tonemap_hdr_bt2390.d.ts +0 -3
- package/src/shade/renderer/shader/chunk/color/tonemap/chunk_tonemap_hdr_bt2390.d.ts.map +0 -1
- package/src/shade/renderer/shader/chunk/color/tonemap/chunk_tonemap_hdr_bt2390.js +0 -44
|
@@ -66,11 +66,11 @@ export class FluidObstacleSystem extends System<any> {
|
|
|
66
66
|
/**
|
|
67
67
|
* @param {FluidComponent} fluid
|
|
68
68
|
*/
|
|
69
|
-
static "__#
|
|
69
|
+
static "__#490@#refresh_masks"(fluid: FluidComponent): void;
|
|
70
70
|
/**
|
|
71
71
|
* @param {FluidComponent} fluid
|
|
72
72
|
*/
|
|
73
|
-
static "__#
|
|
73
|
+
static "__#490@#clear_field"(fluid: FluidComponent): void;
|
|
74
74
|
/**
|
|
75
75
|
* Mark every cell of `fluid` whose centre lies within `inflation` of the
|
|
76
76
|
* posed shape as solid. Iteration is clipped to the shape's world AABB
|
|
@@ -82,7 +82,7 @@ export class FluidObstacleSystem extends System<any> {
|
|
|
82
82
|
* @param {number} inflation world-units SDF threshold
|
|
83
83
|
* @param {Float64Array} point length-3 scratch
|
|
84
84
|
*/
|
|
85
|
-
static "__#
|
|
85
|
+
static "__#490@#voxelize"(fluid: FluidComponent, posed: PosedShape3D, aabb: Float64Array, inflation: number, point: Float64Array): void;
|
|
86
86
|
/**
|
|
87
87
|
* Write the obstacle's translation velocity onto every face of every cell
|
|
88
88
|
* it voxelized — the moving-wall boundary condition. Runs AFTER the mask
|
|
@@ -102,7 +102,7 @@ export class FluidObstacleSystem extends System<any> {
|
|
|
102
102
|
* @param {number} wvy
|
|
103
103
|
* @param {number} wvz
|
|
104
104
|
*/
|
|
105
|
-
static "__#
|
|
105
|
+
static "__#490@#stamp_wall_velocity"(fluid: FluidComponent, posed: PosedShape3D, aabb: Float64Array, inflation: number, point: Float64Array, wvx: number, wvy: number, wvz: number): void;
|
|
106
106
|
constructor();
|
|
107
107
|
dependencies: (typeof FluidObstacle)[];
|
|
108
108
|
components_used: (ResourceAccessSpecification<typeof Transform64> | ResourceAccessSpecification<typeof FluidObstacle> | ResourceAccessSpecification<typeof Collider> | ResourceAccessSpecification<typeof RigidBody> | ResourceAccessSpecification<typeof FluidComponent>)[];
|
|
@@ -39,11 +39,9 @@ export function world_inverse_inertia_apply(result: number[] | Float64Array, res
|
|
|
39
39
|
* is the body-relative application point. The full constraint denominator is
|
|
40
40
|
* `invM_A + invM_B + contribution_A + contribution_B`.
|
|
41
41
|
*
|
|
42
|
-
* The
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
* Identical operation order in every caller keeps the paths bit-identical
|
|
46
|
-
* (the determinism contract): the arithmetic is
|
|
42
|
+
* The kernel the contact/joint solver's SoA path and the CCD sweep's component
|
|
43
|
+
* path share. Identical operation order in every caller keeps the paths
|
|
44
|
+
* bit-identical (the determinism contract): the arithmetic is
|
|
47
45
|
* {@link angular_effective_mass_array}'s, which this packs its scalars for.
|
|
48
46
|
*
|
|
49
47
|
* @param {number} ix
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"world_inverse_inertia.d.ts","sourceRoot":"","sources":["../../../../../src/engine/physics/inertia/world_inverse_inertia.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,oDAXW,MAAM,EAAE,GAAC,YAAY,iBACrB,MAAM,qBACN,MAAM,EAAE,GAAC,YAAY,YAErB,MAAM,EAAE,GAAC,YAAY,MAGrB,MAAM,MACN,MAAM,MACN,MAAM,QAkBhB;AAED
|
|
1
|
+
{"version":3,"file":"world_inverse_inertia.d.ts","sourceRoot":"","sources":["../../../../../src/engine/physics/inertia/world_inverse_inertia.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,oDAXW,MAAM,EAAE,GAAC,YAAY,iBACrB,MAAM,qBACN,MAAM,EAAE,GAAC,YAAY,YAErB,MAAM,EAAE,GAAC,YAAY,MAGrB,MAAM,MACN,MAAM,MACN,MAAM,QAkBhB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,+CAhBW,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,WACN,MAAM,EAAE,GAAC,YAAY,GACnB,MAAM,CA4BlB;AAOD;;;;;;;;;;;;;;;;GAgBG;AACH,qDAZW,MAAM,EAAE,GAAC,YAAY,iBACrB,MAAM,eACN,MAAM,EAAE,GAAC,YAAY,sBACrB,MAAM,YACN,MAAM,EAAE,GAAC,YAAY,mBACrB,MAAM,SACN,MAAM,EAAE,GAAC,YAAY,gBACrB,MAAM,QACN,MAAM,EAAE,GAAC,YAAY,eACrB,MAAM,WACN,MAAM,EAAE,GAAC,YAAY,QA6B/B;AAKD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wDAbW,MAAM,EAAE,GAAC,YAAY,iBACrB,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,QAsBhB;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,0DATW,MAAM,EAAE,GAAC,YAAY,iBACrB,MAAM,eACN,MAAM,EAAE,GAAC,YAAY,sBACrB,MAAM,YACN,MAAM,EAAE,GAAC,YAAY,mBACrB,MAAM,KACN,MAAM,EAAE,GAAC,YAAY,YACrB,MAAM,QAwDhB"}
|
|
@@ -56,11 +56,9 @@ export function world_inverse_inertia_apply(
|
|
|
56
56
|
* is the body-relative application point. The full constraint denominator is
|
|
57
57
|
* `invM_A + invM_B + contribution_A + contribution_B`.
|
|
58
58
|
*
|
|
59
|
-
* The
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
* Identical operation order in every caller keeps the paths bit-identical
|
|
63
|
-
* (the determinism contract): the arithmetic is
|
|
59
|
+
* The kernel the contact/joint solver's SoA path and the CCD sweep's component
|
|
60
|
+
* path share. Identical operation order in every caller keeps the paths
|
|
61
|
+
* bit-identical (the determinism contract): the arithmetic is
|
|
64
62
|
* {@link angular_effective_mass_array}'s, which this packs its scalars for.
|
|
65
63
|
*
|
|
66
64
|
* @param {number} ix
|
|
@@ -25,13 +25,22 @@ export class Wheel {
|
|
|
25
25
|
contactNormal: Float64Array;
|
|
26
26
|
/** Body id of the surface under the wheel, or −1. */
|
|
27
27
|
contactBodyId: number;
|
|
28
|
-
/**
|
|
28
|
+
/**
|
|
29
|
+
* This wheel's steering angle (rad): its forward direction turned about its suspension axis, toward
|
|
30
|
+
* `up × forward` when positive. {@link RaycastVehicle#setSteering} sets every steered wheel's.
|
|
31
|
+
*/
|
|
29
32
|
steering: number;
|
|
30
33
|
/** Accumulated spin angle (rad) for rendering. */
|
|
31
34
|
rotation: number;
|
|
32
|
-
/**
|
|
35
|
+
/**
|
|
36
|
+
* Forward ground speed at the contact across the coming step (m/s): the chassis' mean velocity there
|
|
37
|
+
* over the step, along the wheel's forward direction, with every impulse of the update in it.
|
|
38
|
+
*/
|
|
33
39
|
forwardSpeed: number;
|
|
34
|
-
/**
|
|
40
|
+
/**
|
|
41
|
+
* The suspension's push in the last {@link RaycastVehicle#update}, as a force: the impulse it
|
|
42
|
+
* applied along the contact normal, divided by the step (N).
|
|
43
|
+
*/
|
|
35
44
|
suspensionForce: number;
|
|
36
45
|
suspensionRestLength: number;
|
|
37
46
|
suspensionLength: number;
|
|
@@ -50,13 +59,101 @@ export class RaycastVehicle {
|
|
|
50
59
|
__drivenCount: number;
|
|
51
60
|
__ray: Ray3;
|
|
52
61
|
__hit: PhysicsSurfacePoint;
|
|
53
|
-
|
|
62
|
+
/** Reused impulse payload for applyImpulseAt. @type {Float64Array} */
|
|
63
|
+
__impulse: Float64Array;
|
|
64
|
+
/**
|
|
65
|
+
* The chassis' mean linear and angular velocity across the coming step: before the springs push, for
|
|
66
|
+
* the spring solves; with them pushing, while the tyres solve and for each wheel's ground speed.
|
|
67
|
+
* @type {Float64Array}
|
|
68
|
+
*/
|
|
69
|
+
__mean_linear: Float64Array;
|
|
70
|
+
/** @type {Float64Array} */
|
|
71
|
+
__mean_angular: Float64Array;
|
|
72
|
+
/** The chassis' mean velocity across the step per unit impulse applied before it, `M⁻¹`'s linear part. */
|
|
73
|
+
__mean_inverse_mass: number;
|
|
74
|
+
/**
|
|
75
|
+
* `M⁻¹`'s angular part, as the chassis' body-local inverse inertia diagonal (LockRot*-masked) times the
|
|
76
|
+
* angular share: turned to the world by the pose, its mean spin across the step per unit angular impulse.
|
|
77
|
+
* @type {Float64Array}
|
|
78
|
+
*/
|
|
79
|
+
__mean_inverse_inertia: Float64Array;
|
|
80
|
+
/** Contact normal, forward and side directions (at FRAME_*), 9 per wheel. @type {Float64Array} */
|
|
81
|
+
__wheel_frame: Float64Array;
|
|
82
|
+
/** The contact's offset from the chassis' centre, 3 per wheel. @type {Float64Array} */
|
|
83
|
+
__wheel_lever: Float64Array;
|
|
84
|
+
/** 1 where the forward direction lies in the contact plane, so the tyre can grip and roll. @type {Uint8Array} */
|
|
85
|
+
__wheel_rolls: Uint8Array;
|
|
86
|
+
/**
|
|
87
|
+
* The tyre impulse the wheel applied in the last update, along its forward and side directions, 2 per
|
|
88
|
+
* wheel; zero for a wheel that applied none.
|
|
89
|
+
* @type {Float64Array}
|
|
90
|
+
*/
|
|
91
|
+
__wheel_tyre: Float64Array;
|
|
92
|
+
/** The most impulse the tyre may apply this step, `μ·N·dt`. @type {Float64Array} */
|
|
93
|
+
__wheel_budget: Float64Array;
|
|
94
|
+
/**
|
|
95
|
+
* The brake's part of the forward impulse in {@link __wheel_tyre}: what the tyre applied along its
|
|
96
|
+
* forward direction, less the drive. The tyre starts the next update from it.
|
|
97
|
+
* @type {Float64Array}
|
|
98
|
+
*/
|
|
99
|
+
__wheel_brake: Float64Array;
|
|
100
|
+
/**
|
|
101
|
+
* The chassis' mean velocity across the step per unit tyre impulse, the free springs answering it:
|
|
102
|
+
* `W·Jᵀ` for the forward, then the side direction, each linear then angular, 12 per wheel.
|
|
103
|
+
* @type {Float64Array}
|
|
104
|
+
*/
|
|
105
|
+
__wheel_response: Float64Array;
|
|
106
|
+
/**
|
|
107
|
+
* The wheel's block of `J·W·Jᵀ`, how a unit tyre impulse changes its patch's slip: forward on forward,
|
|
108
|
+
* side on side, and either on the other, 3 per wheel.
|
|
109
|
+
* @type {Float64Array}
|
|
110
|
+
*/
|
|
111
|
+
__wheel_block: Float64Array;
|
|
112
|
+
/** How many there are. */
|
|
113
|
+
__free_count: number;
|
|
114
|
+
/** Their rows. @type {Uint32Array} */
|
|
115
|
+
__free_row: Uint32Array;
|
|
54
116
|
/**
|
|
55
|
-
*
|
|
56
|
-
* transform's own translation view can go straight in.
|
|
117
|
+
* Their block of {@link __row_matrix}, `J_s·M⁻¹·J_sᵀ + Γ`, times {@link __free_scale}, LU-factored.
|
|
57
118
|
* @type {Float64Array}
|
|
58
119
|
*/
|
|
59
|
-
|
|
120
|
+
__free_matrix: Float64Array;
|
|
121
|
+
/** The LU factorisation's pivots. @type {Uint32Array} */
|
|
122
|
+
__free_pivot: Uint32Array;
|
|
123
|
+
/** One over the block's largest diagonal. */
|
|
124
|
+
__free_scale: number;
|
|
125
|
+
/** Each free spring's speed per unit of one tyre impulse, `J_s·M⁻¹·Jᵀ`. @type {Float64Array} */
|
|
126
|
+
__free_speed: Float64Array;
|
|
127
|
+
/**
|
|
128
|
+
* How much less each free spring pushes per unit of one tyre impulse,
|
|
129
|
+
* `(J_s·M⁻¹·J_sᵀ + Γ)⁻¹·J_s·M⁻¹·Jᵀ`.
|
|
130
|
+
* @type {Float64Array}
|
|
131
|
+
*/
|
|
132
|
+
__free_answer: Float64Array;
|
|
133
|
+
/** The wheel. @type {Uint32Array} */
|
|
134
|
+
__row_wheel: Uint32Array;
|
|
135
|
+
/** The contact normal `n`, then `r × n`, 6 per row. @type {Float64Array} */
|
|
136
|
+
__row_jacobian: Float64Array;
|
|
137
|
+
/**
|
|
138
|
+
* `M⁻¹`'s angular part on `r × n`: the chassis' mean spin across the step per unit impulse along the row,
|
|
139
|
+
* 3 per row.
|
|
140
|
+
* @type {Float64Array}
|
|
141
|
+
*/
|
|
142
|
+
__row_response: Float64Array;
|
|
143
|
+
/** The spring's compliance `γ`. @type {Float64Array} */
|
|
144
|
+
__row_compliance: Float64Array;
|
|
145
|
+
/** `β·x`, the velocity the spring restores at. @type {Float64Array} */
|
|
146
|
+
__row_restore: Float64Array;
|
|
147
|
+
/** `β·x − J·v̄`: what the spring asks for against where the step carries the chassis. @type {Float64Array} */
|
|
148
|
+
__row_rhs: Float64Array;
|
|
149
|
+
/** The least impulse: a spring does not pull. @type {Float64Array} */
|
|
150
|
+
__row_lower: Float64Array;
|
|
151
|
+
/** The most impulse, `suspensionMaxForce·dt`. @type {Float64Array} */
|
|
152
|
+
__row_upper: Float64Array;
|
|
153
|
+
/** The impulses solved for. @type {Float64Array} */
|
|
154
|
+
__row_impulse: Float64Array;
|
|
155
|
+
/** Rows × rows, column-major: `J·M⁻¹·Jᵀ` plus each row's compliance on the diagonal. @type {Float64Array} */
|
|
156
|
+
__row_matrix: Float64Array;
|
|
60
157
|
system: PhysicsSystem;
|
|
61
158
|
chassisBody: RigidBody;
|
|
62
159
|
chassisTransform: Transform64;
|
|
@@ -92,19 +189,93 @@ export class RaycastVehicle {
|
|
|
92
189
|
steered?: boolean;
|
|
93
190
|
driven?: boolean;
|
|
94
191
|
}): Wheel;
|
|
95
|
-
/**
|
|
96
|
-
|
|
192
|
+
/**
|
|
193
|
+
* Steer: turn every steered wheel so that its axle passes through one turn centre on a line across the
|
|
194
|
+
* chassis, and the tyres' grips agree on the point the chassis turns about. Each wheel's own angle goes
|
|
195
|
+
* into its {@link Wheel#steering}, from the wheels as they are configured when this is called. The
|
|
196
|
+
* wheels are taken to share their suspension axis and their straight-ahead direction, as a car's do;
|
|
197
|
+
* where they differ, their axles need not meet.
|
|
198
|
+
*
|
|
199
|
+
* The line passes through the unsteered wheels' mean mount position: the line their axles share.
|
|
200
|
+
* Where they sit on more than one line, no centre suits them all, and this one leaves them the least
|
|
201
|
+
* side slip, summed in squares. With every wheel steered, it passes through all the wheels' mean
|
|
202
|
+
* position: the line that needs the least steering, summed in squares, in a gentle turn.
|
|
203
|
+
*
|
|
204
|
+
* `angle` is the single-track ("bicycle") model's steering angle of the steered wheels farthest from
|
|
205
|
+
* the line, which turn the most: that of one wheel standing at the steered wheels' mean place across
|
|
206
|
+
* the chassis and as far ahead of the line as they are from it, with its axle through the centre.
|
|
207
|
+
* Steered wheels nearer the line turn less, and one on it changes nothing. Positive turns the chassis
|
|
208
|
+
* toward `up × forward` (+x for the default axes), where a positive {@link Wheel#steering} turns a
|
|
209
|
+
* wheel's forward direction; a steered wheel behind the line turns the other way. At 0 every wheel
|
|
210
|
+
* points straight. At ±π/2 the chassis pivots about the point of the line beside that one wheel, and
|
|
211
|
+
* the steered wheels on the inside of it turn past π/2. With every steered wheel on the line, to the
|
|
212
|
+
* rounding of the mean positions, none can move the centre along it, and each points straight.
|
|
213
|
+
*
|
|
214
|
+
* @param {number} angle radians
|
|
215
|
+
*/
|
|
216
|
+
setSteering(angle: number): void;
|
|
97
217
|
/** Total engine drive force (N), split evenly across the driven wheels. */
|
|
98
218
|
setDriveForce(force: any): void;
|
|
99
219
|
/** Brake force (N) per wheel, opposing each wheel's forward motion. */
|
|
100
220
|
setBrake(force: any): void;
|
|
101
221
|
/**
|
|
102
|
-
*
|
|
103
|
-
*
|
|
104
|
-
*
|
|
222
|
+
* Size the per-wheel and per-row storage for `wheel_count` wheels, keeping each wheel's last tyre
|
|
223
|
+
* impulse and its brake's part.
|
|
224
|
+
* @param {number} wheel_count
|
|
225
|
+
* @private
|
|
226
|
+
*/
|
|
227
|
+
private __reserve;
|
|
228
|
+
/**
|
|
229
|
+
* Step the vehicle: cast the suspension rays, apply the tyre impulses, then push the chassis up on its
|
|
230
|
+
* grounded springs. Every impulse acts on the chassis velocity at once, for the next
|
|
231
|
+
* `PhysicsSystem.fixedUpdate` to integrate. Call once per fixed step, with that step's `dt`.
|
|
105
232
|
* @param {number} dt
|
|
106
233
|
*/
|
|
107
234
|
update(dt: number): void;
|
|
235
|
+
/**
|
|
236
|
+
* Fill the `rows` springs' Jacobians, the chassis' angular response to each, and the matrix
|
|
237
|
+
* `J·M⁻¹·Jᵀ` with each spring's compliance on its diagonal — all fixed by the pose, so shared by
|
|
238
|
+
* every solve of the step.
|
|
239
|
+
* @param {number} rows
|
|
240
|
+
* @private
|
|
241
|
+
*/
|
|
242
|
+
private __prepare_springs;
|
|
243
|
+
/**
|
|
244
|
+
* Solve the `rows` prepared springs as one backward-Euler step against the chassis' mean motion in
|
|
245
|
+
* {@link __mean_linear} / {@link __mean_angular}, into {@link __row_impulse}: each pushes, and no
|
|
246
|
+
* harder than its most force.
|
|
247
|
+
* @param {number} rows
|
|
248
|
+
* @private
|
|
249
|
+
*/
|
|
250
|
+
private __solve_springs;
|
|
251
|
+
/**
|
|
252
|
+
* Ready the tyres' solve, after the springs are solved against the tyres pushing as they did the step
|
|
253
|
+
* before. Factors the springs that push freely in that solve, which answer the tyres; turns the motion
|
|
254
|
+
* in {@link __mean_linear} / {@link __mean_angular} into the step's with those springs pushing and no
|
|
255
|
+
* tyre; and works out each tyre's response, `W·Jᵀ` and `J·W·Jᵀ`.
|
|
256
|
+
* @param {number} rows
|
|
257
|
+
* @private
|
|
258
|
+
*/
|
|
259
|
+
private __prepare_tyres;
|
|
260
|
+
/**
|
|
261
|
+
* The chassis' mean velocity across the step per unit impulse along wheel `wi`'s forward or side
|
|
262
|
+
* direction at its contact, the free springs answering: `W·Jᵀ`, linear then angular, into
|
|
263
|
+
* {@link __wheel_response}, and `J·W·Jᵀ`, the change of the contact's speed along that direction per
|
|
264
|
+
* unit impulse, into its diagonal of {@link __wheel_block}.
|
|
265
|
+
* @param {number} wi
|
|
266
|
+
* @param {number} direction {@link FRAME_FORWARD} or {@link FRAME_SIDE}
|
|
267
|
+
* @private
|
|
268
|
+
*/
|
|
269
|
+
private __tyre_response;
|
|
270
|
+
/**
|
|
271
|
+
* Set wheel `wi`'s tyre impulse for the step from {@link scratch_grip}'s drive, brake and side:
|
|
272
|
+
* `drive + brake` along its forward direction and `side` along its side, clamped together to its
|
|
273
|
+
* friction circle. The change applies to the chassis, and to its motion in {@link __mean_linear} /
|
|
274
|
+
* {@link __mean_angular} with the free springs answering.
|
|
275
|
+
* @param {number} wi
|
|
276
|
+
* @private
|
|
277
|
+
*/
|
|
278
|
+
private __grip;
|
|
108
279
|
}
|
|
109
280
|
import { Ray3 } from "../../../core/geom/3d/ray/Ray3.js";
|
|
110
281
|
import { PhysicsSurfacePoint } from "../queries/PhysicsSurfacePoint.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RaycastVehicle.d.ts","sourceRoot":"","sources":["../../../../../src/engine/physics/vehicle/RaycastVehicle.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RaycastVehicle.d.ts","sourceRoot":"","sources":["../../../../../src/engine/physics/vehicle/RaycastVehicle.js"],"names":[],"mappings":"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"}
|