@woosh/meep-engine 2.101.0 → 2.102.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/build/meep.cjs +107 -92
- package/build/meep.min.js +1 -1
- package/build/meep.module.js +107 -92
- package/package.json +1 -1
- package/src/core/__module.d.ts +4 -0
- package/src/core/__module.js +4 -0
- package/src/core/geom/3d/cone/computeConePlaneSide.js +1 -1
- package/src/core/geom/3d/mat4/{allocate_transform_m4.d.ts → allocate_m4.d.ts} +2 -2
- package/src/core/geom/3d/mat4/allocate_m4.d.ts.map +1 -0
- package/src/core/geom/3d/mat4/{allocate_transform_m4.js → allocate_m4.js} +1 -1
- package/src/core/geom/Vector4.d.ts.map +1 -1
- package/src/core/geom/Vector4.js +13 -92
- package/src/core/geom/vec4/v4_distance_sqr.d.ts +14 -0
- package/src/core/geom/vec4/v4_distance_sqr.d.ts.map +1 -0
- package/src/core/geom/vec4/v4_distance_sqr.js +20 -0
- package/src/core/geom/vec4/v4_dot.d.ts +14 -0
- package/src/core/geom/vec4/v4_dot.d.ts.map +1 -0
- package/src/core/geom/vec4/v4_dot.js +19 -0
- package/src/core/geom/vec4/v4_length_sqr.d.ts +10 -0
- package/src/core/geom/vec4/v4_length_sqr.d.ts.map +1 -0
- package/src/core/geom/vec4/v4_length_sqr.js +11 -0
- package/src/core/geom/vec4/v4_multiply_mat4.d.ts +8 -0
- package/src/core/geom/vec4/v4_multiply_mat4.d.ts.map +1 -0
- package/src/core/geom/vec4/v4_multiply_mat4.js +42 -0
- package/src/engine/ecs/fow/FogOfWar.js +2 -2
- package/src/engine/ecs/transform/Transform.d.ts.map +1 -1
- package/src/engine/ecs/transform/Transform.js +2 -2
- package/src/engine/graphics/texture/virtual/tile/VirtualTextureTile.d.ts +4 -0
- package/src/engine/graphics/texture/virtual/tile/VirtualTextureTile.d.ts.map +1 -1
- package/src/engine/graphics/texture/virtual/tile/VirtualTextureTile.js +4 -0
- package/src/engine/graphics/trail/x/NOTES.md +3 -0
- package/src/engine/graphics/trail/x/RibbonMaterialX.d.ts +11 -2
- package/src/engine/graphics/trail/x/RibbonMaterialX.d.ts.map +1 -1
- package/src/engine/graphics/trail/x/RibbonMaterialX.js +28 -13
- package/src/engine/graphics/util/projectSphere.js +4 -4
- package/src/core/geom/3d/mat4/allocate_transform_m4.d.ts.map +0 -1
- package/src/engine/graphics/trail/CodeflowTrailMaterial.d.ts +0 -4
- package/src/engine/graphics/trail/CodeflowTrailMaterial.d.ts.map +0 -1
- package/src/engine/graphics/trail/CodeflowTrailMaterial.js +0 -134
- package/src/engine/graphics/trail/TemporalPath.d.ts +0 -39
- package/src/engine/graphics/trail/TemporalPath.d.ts.map +0 -1
- package/src/engine/graphics/trail/TemporalPath.js +0 -129
- package/src/engine/graphics/trail/TemporalPath.spec.d.ts +0 -2
- package/src/engine/graphics/trail/TemporalPath.spec.d.ts.map +0 -1
- package/src/engine/graphics/trail/TemporalPath.spec.js +0 -5
- package/src/engine/graphics/util/composeMatrix4RotationScale.d.ts +0 -9
- package/src/engine/graphics/util/composeMatrix4RotationScale.d.ts.map +0 -1
- package/src/engine/graphics/util/composeMatrix4RotationScale.js +0 -14
package/build/meep.module.js
CHANGED
|
@@ -804,7 +804,7 @@ const MATRIX_BYTE_SIZE = 4 * 16;
|
|
|
804
804
|
* custom Float32Array allocator, allocated memory in continuous chunks
|
|
805
805
|
* @returns {Float32Array}
|
|
806
806
|
*/
|
|
807
|
-
function
|
|
807
|
+
function allocate_m4() {
|
|
808
808
|
if (transform_bucket_cursor >= TRANSFORM_ALLOCATOR_BUCKET_CAPACITY) {
|
|
809
809
|
transform_bucket = new ArrayBuffer(TRANSFORM_ALLOCATOR_BUCKET_CAPACITY * MATRIX_BYTE_SIZE);
|
|
810
810
|
transform_bucket_cursor = 0;
|
|
@@ -4703,7 +4703,7 @@ class Transform {
|
|
|
4703
4703
|
* @readonly
|
|
4704
4704
|
* @type {Float32Array}
|
|
4705
4705
|
*/
|
|
4706
|
-
matrix =
|
|
4706
|
+
matrix = allocate_m4();
|
|
4707
4707
|
|
|
4708
4708
|
/**
|
|
4709
4709
|
* Various bit flags, see {@link TransformFlags}
|
|
@@ -50635,93 +50635,6 @@ function computeHashIntegerArray(...value) {
|
|
|
50635
50635
|
*/
|
|
50636
50636
|
|
|
50637
50637
|
|
|
50638
|
-
/**
|
|
50639
|
-
*
|
|
50640
|
-
* @param {number[]} result
|
|
50641
|
-
* @param {number[]} input
|
|
50642
|
-
* @param {number[]} mat4
|
|
50643
|
-
*/
|
|
50644
|
-
function v4_applyMatrix4(result, input, mat4) {
|
|
50645
|
-
const a0 = mat4[0];
|
|
50646
|
-
const a1 = mat4[1];
|
|
50647
|
-
const a2 = mat4[2];
|
|
50648
|
-
const a3 = mat4[3];
|
|
50649
|
-
|
|
50650
|
-
const b0 = mat4[4];
|
|
50651
|
-
const b1 = mat4[5];
|
|
50652
|
-
const b2 = mat4[6];
|
|
50653
|
-
const b3 = mat4[7];
|
|
50654
|
-
|
|
50655
|
-
const c0 = mat4[8];
|
|
50656
|
-
const c1 = mat4[9];
|
|
50657
|
-
const c2 = mat4[10];
|
|
50658
|
-
const c3 = mat4[11];
|
|
50659
|
-
|
|
50660
|
-
const d0 = mat4[12];
|
|
50661
|
-
const d1 = mat4[13];
|
|
50662
|
-
const d2 = mat4[14];
|
|
50663
|
-
const d3 = mat4[15];
|
|
50664
|
-
|
|
50665
|
-
const _x = input[0];
|
|
50666
|
-
const _y = input[1];
|
|
50667
|
-
const _z = input[2];
|
|
50668
|
-
const _w = input[3];
|
|
50669
|
-
|
|
50670
|
-
const x = a0 * _x + b0 * _y + c0 * _z + d0 * _w;
|
|
50671
|
-
const y = a1 * _x + b1 * _y + c1 * _z + d1 * _w;
|
|
50672
|
-
const z = a2 * _x + b2 * _y + c2 * _z + d2 * _w;
|
|
50673
|
-
const w = a3 * _x + b3 * _y + c3 * _z + d3 * _w;
|
|
50674
|
-
|
|
50675
|
-
result[0] = x;
|
|
50676
|
-
result[1] = y;
|
|
50677
|
-
result[2] = z;
|
|
50678
|
-
result[3] = w;
|
|
50679
|
-
}
|
|
50680
|
-
|
|
50681
|
-
/**
|
|
50682
|
-
*
|
|
50683
|
-
* @param {number} x0
|
|
50684
|
-
* @param {number} y0
|
|
50685
|
-
* @param {number} z0
|
|
50686
|
-
* @param {number} w0
|
|
50687
|
-
* @param {number} x1
|
|
50688
|
-
* @param {number} y1
|
|
50689
|
-
* @param {number} z1
|
|
50690
|
-
* @param {number} w1
|
|
50691
|
-
* @returns {number}
|
|
50692
|
-
*/
|
|
50693
|
-
function v4_dot(x0, y0, z0, w0, x1, y1, z1, w1) {
|
|
50694
|
-
return (x0 * x1 + y0 * y1 + z0 * z1 + w0 * w1);
|
|
50695
|
-
}
|
|
50696
|
-
|
|
50697
|
-
/**
|
|
50698
|
-
*
|
|
50699
|
-
* @param {number} x
|
|
50700
|
-
* @param {number} y
|
|
50701
|
-
* @param {number} z
|
|
50702
|
-
* @param {number} w
|
|
50703
|
-
* @returns {number}
|
|
50704
|
-
*/
|
|
50705
|
-
function v4_length_sqr(x, y, z, w) {
|
|
50706
|
-
return x * x + y * y + z * z + w * w;
|
|
50707
|
-
}
|
|
50708
|
-
|
|
50709
|
-
/**
|
|
50710
|
-
*
|
|
50711
|
-
* @param {number} x0
|
|
50712
|
-
* @param {number} y0
|
|
50713
|
-
* @param {number} z0
|
|
50714
|
-
* @param {number} w0
|
|
50715
|
-
* @param {number} x1
|
|
50716
|
-
* @param {number} y1
|
|
50717
|
-
* @param {number} z1
|
|
50718
|
-
* @param {number} w1
|
|
50719
|
-
* @returns {number}
|
|
50720
|
-
*/
|
|
50721
|
-
function v4_distance_sqr(x0, y0, z0, w0, x1, y1, z1, w1) {
|
|
50722
|
-
return v4_length_sqr(x0 - x1, y0 - y1, z0 - z1, w0 - w1);
|
|
50723
|
-
}
|
|
50724
|
-
|
|
50725
50638
|
class Vector4 {
|
|
50726
50639
|
/**
|
|
50727
50640
|
*
|
|
@@ -50806,7 +50719,10 @@ class Vector4 {
|
|
|
50806
50719
|
this.w = w;
|
|
50807
50720
|
|
|
50808
50721
|
if (this.onChanged.hasHandlers()) {
|
|
50809
|
-
this.onChanged.
|
|
50722
|
+
this.onChanged.send8(
|
|
50723
|
+
x, y, z, w,
|
|
50724
|
+
_x, _y, _z, _w
|
|
50725
|
+
);
|
|
50810
50726
|
}
|
|
50811
50727
|
}
|
|
50812
50728
|
|
|
@@ -50890,7 +50806,12 @@ class Vector4 {
|
|
|
50890
50806
|
* @returns {Vector4}
|
|
50891
50807
|
*/
|
|
50892
50808
|
add3(v3) {
|
|
50893
|
-
return this.set(
|
|
50809
|
+
return this.set(
|
|
50810
|
+
this.x + v3.x,
|
|
50811
|
+
this.y + v3.y,
|
|
50812
|
+
this.z + v3.z,
|
|
50813
|
+
this.w
|
|
50814
|
+
);
|
|
50894
50815
|
}
|
|
50895
50816
|
|
|
50896
50817
|
/**
|
|
@@ -117805,4 +117726,98 @@ function v2_angle_between(x0, y0, x1, y1) {
|
|
|
117805
117726
|
return Math.acos(theta);
|
|
117806
117727
|
}
|
|
117807
117728
|
|
|
117808
|
-
|
|
117729
|
+
/**
|
|
117730
|
+
*
|
|
117731
|
+
* @param {number[]} result
|
|
117732
|
+
* @param {number[]} input
|
|
117733
|
+
* @param {number[]} mat4
|
|
117734
|
+
*/
|
|
117735
|
+
function v4_multiply_mat4(result, input, mat4) {
|
|
117736
|
+
const a0 = mat4[0];
|
|
117737
|
+
const a1 = mat4[1];
|
|
117738
|
+
const a2 = mat4[2];
|
|
117739
|
+
const a3 = mat4[3];
|
|
117740
|
+
|
|
117741
|
+
const b0 = mat4[4];
|
|
117742
|
+
const b1 = mat4[5];
|
|
117743
|
+
const b2 = mat4[6];
|
|
117744
|
+
const b3 = mat4[7];
|
|
117745
|
+
|
|
117746
|
+
const c0 = mat4[8];
|
|
117747
|
+
const c1 = mat4[9];
|
|
117748
|
+
const c2 = mat4[10];
|
|
117749
|
+
const c3 = mat4[11];
|
|
117750
|
+
|
|
117751
|
+
const d0 = mat4[12];
|
|
117752
|
+
const d1 = mat4[13];
|
|
117753
|
+
const d2 = mat4[14];
|
|
117754
|
+
const d3 = mat4[15];
|
|
117755
|
+
|
|
117756
|
+
const _x = input[0];
|
|
117757
|
+
const _y = input[1];
|
|
117758
|
+
const _z = input[2];
|
|
117759
|
+
const _w = input[3];
|
|
117760
|
+
|
|
117761
|
+
const x = a0 * _x + b0 * _y + c0 * _z + d0 * _w;
|
|
117762
|
+
const y = a1 * _x + b1 * _y + c1 * _z + d1 * _w;
|
|
117763
|
+
const z = a2 * _x + b2 * _y + c2 * _z + d2 * _w;
|
|
117764
|
+
const w = a3 * _x + b3 * _y + c3 * _z + d3 * _w;
|
|
117765
|
+
|
|
117766
|
+
result[0] = x;
|
|
117767
|
+
result[1] = y;
|
|
117768
|
+
result[2] = z;
|
|
117769
|
+
result[3] = w;
|
|
117770
|
+
}
|
|
117771
|
+
|
|
117772
|
+
/**
|
|
117773
|
+
*
|
|
117774
|
+
* @param {number} x0
|
|
117775
|
+
* @param {number} y0
|
|
117776
|
+
* @param {number} z0
|
|
117777
|
+
* @param {number} w0
|
|
117778
|
+
* @param {number} x1
|
|
117779
|
+
* @param {number} y1
|
|
117780
|
+
* @param {number} z1
|
|
117781
|
+
* @param {number} w1
|
|
117782
|
+
* @returns {number}
|
|
117783
|
+
*/
|
|
117784
|
+
function v4_dot(
|
|
117785
|
+
x0, y0, z0, w0,
|
|
117786
|
+
x1, y1, z1, w1
|
|
117787
|
+
) {
|
|
117788
|
+
|
|
117789
|
+
return (x0 * x1 + y0 * y1 + z0 * z1 + w0 * w1);
|
|
117790
|
+
}
|
|
117791
|
+
|
|
117792
|
+
/**
|
|
117793
|
+
*
|
|
117794
|
+
* @param {number} x
|
|
117795
|
+
* @param {number} y
|
|
117796
|
+
* @param {number} z
|
|
117797
|
+
* @param {number} w
|
|
117798
|
+
* @returns {number}
|
|
117799
|
+
*/
|
|
117800
|
+
function v4_length_sqr(x, y, z, w) {
|
|
117801
|
+
return x * x + y * y + z * z + w * w;
|
|
117802
|
+
}
|
|
117803
|
+
|
|
117804
|
+
/**
|
|
117805
|
+
*
|
|
117806
|
+
* @param {number} x0
|
|
117807
|
+
* @param {number} y0
|
|
117808
|
+
* @param {number} z0
|
|
117809
|
+
* @param {number} w0
|
|
117810
|
+
* @param {number} x1
|
|
117811
|
+
* @param {number} y1
|
|
117812
|
+
* @param {number} z1
|
|
117813
|
+
* @param {number} w1
|
|
117814
|
+
* @returns {number}
|
|
117815
|
+
*/
|
|
117816
|
+
function v4_distance_sqr(
|
|
117817
|
+
x0, y0, z0, w0,
|
|
117818
|
+
x1, y1, z1, w1
|
|
117819
|
+
) {
|
|
117820
|
+
return v4_length_sqr(x0 - x1, y0 - y1, z0 - z1, w0 - w1);
|
|
117821
|
+
}
|
|
117822
|
+
|
|
117823
|
+
export { AmbientOcclusionPostProcessEffect, Behavior, BehaviorStatus, Blackboard, Cache, EngineConfiguration, EngineHarness, ForwardPlusRenderingPlugin, HashMap, Light, ParallelBehavior, ParallelBehaviorPolicy, SGMesh, SGMeshSystem, SelectorBehavior, SequenceBehavior, ShadedGeometry, ShadedGeometrySystem, Signal, SignalBinding, Transform, dispatchViaProxy, findSignalHandlerIndexByHandle, findSignalHandlerIndexByHandleAndContext, find_path_on_grid_astar, quat3_createFromAxisAngle, v2_angle_between, v2_bearing_angle_towards, v2_distance, v2_dot, v2_length_sqr, v2_magnitude, v4_distance_sqr, v4_dot, v4_length_sqr, v4_multiply_mat4 };
|
package/package.json
CHANGED
package/src/core/__module.d.ts
CHANGED
|
@@ -14,4 +14,8 @@ export { v2_length_sqr } from "./geom/vec2/v2_length_sqr.js";
|
|
|
14
14
|
export { v2_dot } from "./geom/vec2/v2_dot.js";
|
|
15
15
|
export { v2_bearing_angle_towards } from "./geom/vec2/v2_bearing_angle_towards.js";
|
|
16
16
|
export { v2_angle_between } from "./geom/vec2/v2_angle_between.js";
|
|
17
|
+
export { v4_multiply_mat4 } from "./geom/vec4/v4_multiply_mat4.js";
|
|
18
|
+
export { v4_dot } from "./geom/vec4/v4_dot.js";
|
|
19
|
+
export { v4_length_sqr } from "./geom/vec4/v4_length_sqr.js";
|
|
20
|
+
export { v4_distance_sqr } from "./geom/vec4/v4_distance_sqr.js";
|
|
17
21
|
//# sourceMappingURL=__module.d.ts.map
|
package/src/core/__module.js
CHANGED
|
@@ -16,3 +16,7 @@ export { v2_length_sqr } from "./geom/vec2/v2_length_sqr.js";
|
|
|
16
16
|
export { v2_dot } from "./geom/vec2/v2_dot.js";
|
|
17
17
|
export { v2_bearing_angle_towards } from "./geom/vec2/v2_bearing_angle_towards.js";
|
|
18
18
|
export { v2_angle_between } from "./geom/vec2/v2_angle_between.js";
|
|
19
|
+
export { v4_multiply_mat4 } from "./geom/vec4/v4_multiply_mat4.js";
|
|
20
|
+
export { v4_dot } from "./geom/vec4/v4_dot.js";
|
|
21
|
+
export { v4_length_sqr } from "./geom/vec4/v4_length_sqr.js";
|
|
22
|
+
export { v4_distance_sqr } from "./geom/vec4/v4_distance_sqr.js";
|
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
* custom Float32Array allocator, allocated memory in continuous chunks
|
|
3
3
|
* @returns {Float32Array}
|
|
4
4
|
*/
|
|
5
|
-
export function
|
|
6
|
-
//# sourceMappingURL=
|
|
5
|
+
export function allocate_m4(): Float32Array;
|
|
6
|
+
//# sourceMappingURL=allocate_m4.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"allocate_m4.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/3d/mat4/allocate_m4.js"],"names":[],"mappings":"AAuBA;;;GAGG;AACH,+BAFa,YAAY,CAgBxB"}
|
|
@@ -25,7 +25,7 @@ const MATRIX_BYTE_SIZE = 4 * 16;
|
|
|
25
25
|
* custom Float32Array allocator, allocated memory in continuous chunks
|
|
26
26
|
* @returns {Float32Array}
|
|
27
27
|
*/
|
|
28
|
-
export function
|
|
28
|
+
export function allocate_m4() {
|
|
29
29
|
if (transform_bucket_cursor >= TRANSFORM_ALLOCATOR_BUCKET_CAPACITY) {
|
|
30
30
|
transform_bucket = new ArrayBuffer(TRANSFORM_ALLOCATOR_BUCKET_CAPACITY * MATRIX_BYTE_SIZE);
|
|
31
31
|
transform_bucket_cursor = 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Vector4.d.ts","sourceRoot":"","sources":["../../../../src/core/geom/Vector4.js"],"names":[],"mappings":"AAUA
|
|
1
|
+
{"version":3,"file":"Vector4.d.ts","sourceRoot":"","sources":["../../../../src/core/geom/Vector4.js"],"names":[],"mappings":";AAUA;IA2WI;;;;;;OAMG;IACH,gBALW,OAAO,MACP,OAAO,qBAEP,OAAO,QASjB;IAxXD;;;;;;;;OAQG;IACH,4DAOC;IANG,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IAEV,eAA6B;IAGjC,gBAEC;IAED,gBAEC;IAED,gBAEC;IAED,gBAEC;IAED;;;;OAIG;IACH,qBAHW,MAAM,EAAE,WACR,MAAM,QAShB;IAED;;;;OAIG;IACH,oBAHW,MAAM,EAAE,WACR,MAAM,QAOhB;IAED;;;;;;;OAOG;IACH,iDAFa,OAAO,CAkCnB;IAED;;;OAGG;IACH,mCAMC;IAED;;;;OAIG;IACH,+BAFa,OAAO,CAOnB;IAED;;;;;;;;;;;;;;;;;;;OAmBG;IACH,kBAlBW,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,MACN,MAAM,MACN,MAAM,MACN,MAAM,GACJ,OAAO,CAoBnB;IAED;;;;OAIG;IACH,WAHW,OAAO,GACL,MAAM,CAIlB;IAED;;;;OAIG;IACH,SAHW,UAAQ,OAAO,GACb,OAAO,CASnB;IAED;;;;OAIG;IACH,+BAFa,OAAO,CAUnB;IAED;;;;OAIG;IACH,WAHW,OAAO,GACL,OAAO,CAInB;IAED;;;OAGG;IACH,SAFa,OAAO,CAQnB;IAED;;;OAGG;IACH,qCAuBC;IAED;;;;OAIG;IACH,aAHW,OAAO,GACL,OAAO,CAInB;IAED;;;OAGG;IACH,QAFY,MAAM,CASjB;IAED;;;;OAIG;IACH,gBAJW,OAAO,MACP,OAAO,mBAKjB;IAED;;;OAGG;IACH,gBAFW,MAAM,EAAE,QAOlB;IAED;;OAEG;IACH,WAFa,MAAM,EAAE,CAQpB;IAED;;;;OAIG;IACH,mBAHW,MAAM,EAAE,UACR,MAAM,QAIhB;IAED;;;;;MAOC;IAED,0BAEC;IAED;;;OAGG;IACH,2CAKC;IAED;;;OAGG;IACH,6CAOC;IAED,sDAOC;CAiBJ"}
|
package/src/core/geom/Vector4.js
CHANGED
|
@@ -3,98 +3,11 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import { assert } from "../assert.js";
|
|
6
|
+
import { computeHashIntegerArray } from "../collection/array/computeHashIntegerArray.js";
|
|
6
7
|
import { Signal } from "../events/signal/Signal.js";
|
|
7
8
|
import { lerp } from "../math/lerp.js";
|
|
8
|
-
import { computeHashIntegerArray } from "../collection/array/computeHashIntegerArray.js";
|
|
9
9
|
import { computeHashFloat } from "../primitives/numbers/computeHashFloat.js";
|
|
10
10
|
|
|
11
|
-
/**
|
|
12
|
-
*
|
|
13
|
-
* @param {number[]} result
|
|
14
|
-
* @param {number[]} input
|
|
15
|
-
* @param {number[]} mat4
|
|
16
|
-
*/
|
|
17
|
-
export function v4_applyMatrix4(result, input, mat4) {
|
|
18
|
-
const a0 = mat4[0];
|
|
19
|
-
const a1 = mat4[1];
|
|
20
|
-
const a2 = mat4[2];
|
|
21
|
-
const a3 = mat4[3];
|
|
22
|
-
|
|
23
|
-
const b0 = mat4[4];
|
|
24
|
-
const b1 = mat4[5];
|
|
25
|
-
const b2 = mat4[6];
|
|
26
|
-
const b3 = mat4[7];
|
|
27
|
-
|
|
28
|
-
const c0 = mat4[8];
|
|
29
|
-
const c1 = mat4[9];
|
|
30
|
-
const c2 = mat4[10];
|
|
31
|
-
const c3 = mat4[11];
|
|
32
|
-
|
|
33
|
-
const d0 = mat4[12];
|
|
34
|
-
const d1 = mat4[13];
|
|
35
|
-
const d2 = mat4[14];
|
|
36
|
-
const d3 = mat4[15];
|
|
37
|
-
|
|
38
|
-
const _x = input[0];
|
|
39
|
-
const _y = input[1];
|
|
40
|
-
const _z = input[2];
|
|
41
|
-
const _w = input[3];
|
|
42
|
-
|
|
43
|
-
const x = a0 * _x + b0 * _y + c0 * _z + d0 * _w;
|
|
44
|
-
const y = a1 * _x + b1 * _y + c1 * _z + d1 * _w;
|
|
45
|
-
const z = a2 * _x + b2 * _y + c2 * _z + d2 * _w;
|
|
46
|
-
const w = a3 * _x + b3 * _y + c3 * _z + d3 * _w;
|
|
47
|
-
|
|
48
|
-
result[0] = x;
|
|
49
|
-
result[1] = y;
|
|
50
|
-
result[2] = z;
|
|
51
|
-
result[3] = w;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
*
|
|
56
|
-
* @param {number} x0
|
|
57
|
-
* @param {number} y0
|
|
58
|
-
* @param {number} z0
|
|
59
|
-
* @param {number} w0
|
|
60
|
-
* @param {number} x1
|
|
61
|
-
* @param {number} y1
|
|
62
|
-
* @param {number} z1
|
|
63
|
-
* @param {number} w1
|
|
64
|
-
* @returns {number}
|
|
65
|
-
*/
|
|
66
|
-
export function v4_dot(x0, y0, z0, w0, x1, y1, z1, w1) {
|
|
67
|
-
return (x0 * x1 + y0 * y1 + z0 * z1 + w0 * w1);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
*
|
|
72
|
-
* @param {number} x
|
|
73
|
-
* @param {number} y
|
|
74
|
-
* @param {number} z
|
|
75
|
-
* @param {number} w
|
|
76
|
-
* @returns {number}
|
|
77
|
-
*/
|
|
78
|
-
export function v4_length_sqr(x, y, z, w) {
|
|
79
|
-
return x * x + y * y + z * z + w * w;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
*
|
|
84
|
-
* @param {number} x0
|
|
85
|
-
* @param {number} y0
|
|
86
|
-
* @param {number} z0
|
|
87
|
-
* @param {number} w0
|
|
88
|
-
* @param {number} x1
|
|
89
|
-
* @param {number} y1
|
|
90
|
-
* @param {number} z1
|
|
91
|
-
* @param {number} w1
|
|
92
|
-
* @returns {number}
|
|
93
|
-
*/
|
|
94
|
-
export function v4_distance_sqr(x0, y0, z0, w0, x1, y1, z1, w1) {
|
|
95
|
-
return v4_length_sqr(x0 - x1, y0 - y1, z0 - z1, w0 - w1);
|
|
96
|
-
}
|
|
97
|
-
|
|
98
11
|
class Vector4 {
|
|
99
12
|
/**
|
|
100
13
|
*
|
|
@@ -188,7 +101,10 @@ class Vector4 {
|
|
|
188
101
|
this.w = w;
|
|
189
102
|
|
|
190
103
|
if (this.onChanged.hasHandlers()) {
|
|
191
|
-
this.onChanged.
|
|
104
|
+
this.onChanged.send8(
|
|
105
|
+
x, y, z, w,
|
|
106
|
+
_x, _y, _z, _w
|
|
107
|
+
);
|
|
192
108
|
}
|
|
193
109
|
}
|
|
194
110
|
|
|
@@ -213,8 +129,8 @@ class Vector4 {
|
|
|
213
129
|
* @returns {Vector4}
|
|
214
130
|
*/
|
|
215
131
|
multiplyScalar(value) {
|
|
216
|
-
assert.
|
|
217
|
-
assert.
|
|
132
|
+
assert.isNumber(value, 'value');
|
|
133
|
+
assert.notNaN(value, 'value');
|
|
218
134
|
|
|
219
135
|
return this.set(this.x * value, this.y * value, this.z * value, this.w * value);
|
|
220
136
|
}
|
|
@@ -274,7 +190,12 @@ class Vector4 {
|
|
|
274
190
|
* @returns {Vector4}
|
|
275
191
|
*/
|
|
276
192
|
add3(v3) {
|
|
277
|
-
return this.set(
|
|
193
|
+
return this.set(
|
|
194
|
+
this.x + v3.x,
|
|
195
|
+
this.y + v3.y,
|
|
196
|
+
this.z + v3.z,
|
|
197
|
+
this.w
|
|
198
|
+
);
|
|
278
199
|
}
|
|
279
200
|
|
|
280
201
|
/**
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @param {number} x0
|
|
4
|
+
* @param {number} y0
|
|
5
|
+
* @param {number} z0
|
|
6
|
+
* @param {number} w0
|
|
7
|
+
* @param {number} x1
|
|
8
|
+
* @param {number} y1
|
|
9
|
+
* @param {number} z1
|
|
10
|
+
* @param {number} w1
|
|
11
|
+
* @returns {number}
|
|
12
|
+
*/
|
|
13
|
+
export function v4_distance_sqr(x0: number, y0: number, z0: number, w0: number, x1: number, y1: number, z1: number, w1: number): number;
|
|
14
|
+
//# sourceMappingURL=v4_distance_sqr.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"v4_distance_sqr.d.ts","sourceRoot":"","sources":["../../../../../src/core/geom/vec4/v4_distance_sqr.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AACH,oCAVW,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,GACJ,MAAM,CAOlB"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { v4_length_sqr } from "./v4_length_sqr.js";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
* @param {number} x0
|
|
6
|
+
* @param {number} y0
|
|
7
|
+
* @param {number} z0
|
|
8
|
+
* @param {number} w0
|
|
9
|
+
* @param {number} x1
|
|
10
|
+
* @param {number} y1
|
|
11
|
+
* @param {number} z1
|
|
12
|
+
* @param {number} w1
|
|
13
|
+
* @returns {number}
|
|
14
|
+
*/
|
|
15
|
+
export function v4_distance_sqr(
|
|
16
|
+
x0, y0, z0, w0,
|
|
17
|
+
x1, y1, z1, w1
|
|
18
|
+
) {
|
|
19
|
+
return v4_length_sqr(x0 - x1, y0 - y1, z0 - z1, w0 - w1);
|
|
20
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @param {number} x0
|
|
4
|
+
* @param {number} y0
|
|
5
|
+
* @param {number} z0
|
|
6
|
+
* @param {number} w0
|
|
7
|
+
* @param {number} x1
|
|
8
|
+
* @param {number} y1
|
|
9
|
+
* @param {number} z1
|
|
10
|
+
* @param {number} w1
|
|
11
|
+
* @returns {number}
|
|
12
|
+
*/
|
|
13
|
+
export function v4_dot(x0: number, y0: number, z0: number, w0: number, x1: number, y1: number, z1: number, w1: number): number;
|
|
14
|
+
//# sourceMappingURL=v4_dot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"v4_dot.d.ts","sourceRoot":"","sources":["../../../../../src/core/geom/vec4/v4_dot.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,2BAVW,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,GACJ,MAAM,CAQlB"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @param {number} x0
|
|
4
|
+
* @param {number} y0
|
|
5
|
+
* @param {number} z0
|
|
6
|
+
* @param {number} w0
|
|
7
|
+
* @param {number} x1
|
|
8
|
+
* @param {number} y1
|
|
9
|
+
* @param {number} z1
|
|
10
|
+
* @param {number} w1
|
|
11
|
+
* @returns {number}
|
|
12
|
+
*/
|
|
13
|
+
export function v4_dot(
|
|
14
|
+
x0, y0, z0, w0,
|
|
15
|
+
x1, y1, z1, w1
|
|
16
|
+
) {
|
|
17
|
+
|
|
18
|
+
return (x0 * x1 + y0 * y1 + z0 * z1 + w0 * w1);
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"v4_length_sqr.d.ts","sourceRoot":"","sources":["../../../../../src/core/geom/vec4/v4_length_sqr.js"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,iCANW,MAAM,KACN,MAAM,KACN,MAAM,KACN,MAAM,GACJ,MAAM,CAIlB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"v4_multiply_mat4.d.ts","sourceRoot":"","sources":["../../../../../src/core/geom/vec4/v4_multiply_mat4.js"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,yCAJW,MAAM,EAAE,SACR,MAAM,EAAE,QACR,MAAM,EAAE,QAqClB"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @param {number[]} result
|
|
4
|
+
* @param {number[]} input
|
|
5
|
+
* @param {number[]} mat4
|
|
6
|
+
*/
|
|
7
|
+
export function v4_multiply_mat4(result, input, mat4) {
|
|
8
|
+
const a0 = mat4[0];
|
|
9
|
+
const a1 = mat4[1];
|
|
10
|
+
const a2 = mat4[2];
|
|
11
|
+
const a3 = mat4[3];
|
|
12
|
+
|
|
13
|
+
const b0 = mat4[4];
|
|
14
|
+
const b1 = mat4[5];
|
|
15
|
+
const b2 = mat4[6];
|
|
16
|
+
const b3 = mat4[7];
|
|
17
|
+
|
|
18
|
+
const c0 = mat4[8];
|
|
19
|
+
const c1 = mat4[9];
|
|
20
|
+
const c2 = mat4[10];
|
|
21
|
+
const c3 = mat4[11];
|
|
22
|
+
|
|
23
|
+
const d0 = mat4[12];
|
|
24
|
+
const d1 = mat4[13];
|
|
25
|
+
const d2 = mat4[14];
|
|
26
|
+
const d3 = mat4[15];
|
|
27
|
+
|
|
28
|
+
const _x = input[0];
|
|
29
|
+
const _y = input[1];
|
|
30
|
+
const _z = input[2];
|
|
31
|
+
const _w = input[3];
|
|
32
|
+
|
|
33
|
+
const x = a0 * _x + b0 * _y + c0 * _z + d0 * _w;
|
|
34
|
+
const y = a1 * _x + b1 * _y + c1 * _z + d1 * _w;
|
|
35
|
+
const z = a2 * _x + b2 * _y + c2 * _z + d2 * _w;
|
|
36
|
+
const w = a3 * _x + b3 * _y + c3 * _z + d3 * _w;
|
|
37
|
+
|
|
38
|
+
result[0] = x;
|
|
39
|
+
result[1] = y;
|
|
40
|
+
result[2] = z;
|
|
41
|
+
result[3] = w;
|
|
42
|
+
}
|
|
@@ -539,9 +539,9 @@ export class FogOfWar {
|
|
|
539
539
|
}
|
|
540
540
|
|
|
541
541
|
rebuildDistanceField() {
|
|
542
|
-
console.time('computeSignedDistanceField');
|
|
542
|
+
// console.time('computeSignedDistanceField');
|
|
543
543
|
computeUnsignedDistanceField(this.sampler, this.distanceSampler, 255);
|
|
544
|
-
console.timeEnd('computeSignedDistanceField');
|
|
544
|
+
// console.timeEnd('computeSignedDistanceField');
|
|
545
545
|
this.distanceFieldNeedsUpdate = false;
|
|
546
546
|
}
|
|
547
547
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Transform.d.ts","sourceRoot":"","sources":["../../../../../src/engine/ecs/transform/Transform.js"],"names":[],"mappings":"AA0BA;;;GAGG;AACH;IAwQI;;;;OAIG;IACH,4BAFa,SAAS,CAQrB;IAqDD;;;;;OAKG;IACH,wCAJW,UAAU,gBACV,OAAO,wBAajB;IAtVD;;;OAGG;IACH,mBAHU,OAAO,CAGe;IAEhC;;;OAGG;IACH,mBAHU,UAAU,CAGkB;IAEtC;;;OAGG;IACH,gBAHU,OAAO,CAGY;IAE7B;;;;OAIG;IACH,iBAFU,YAAY,
|
|
1
|
+
{"version":3,"file":"Transform.d.ts","sourceRoot":"","sources":["../../../../../src/engine/ecs/transform/Transform.js"],"names":[],"mappings":"AA0BA;;;GAGG;AACH;IAwQI;;;;OAIG;IACH,4BAFa,SAAS,CAQrB;IAqDD;;;;;OAKG;IACH,wCAJW,UAAU,gBACV,OAAO,wBAajB;IAtVD;;;OAGG;IACH,mBAHU,OAAO,CAGe;IAEhC;;;OAGG;IACH,mBAHU,UAAU,CAGkB;IAEtC;;;OAGG;IACH,gBAHU,OAAO,CAGY;IAE7B;;;;OAIG;IACH,iBAFU,YAAY,CAEC;IAEvB;;;;OAIG;IACH,OAFU,MAAM,CAEM;IAOtB;;;;OAIG;IACH,uBAMC;IAED;;;OAGG;IACH,kBAMC;IAED;;;OAGG;IACH,qBAMC;IAED;;;;OAIG;IACH,kDAIC;IAED;;;;OAIG;IACH,oDAIC;IAYD;;;;OAIG;IACH,cAHW,MAAM,GAAC,cAAc,GACnB,IAAI,CAIhB;IAED;;;;OAIG;IACH,gBAHW,MAAM,GAAC,cAAc,GACnB,IAAI,CAIhB;IAED;;;;OAIG;IACH,gBAHW,MAAM,GAAC,cAAc,SACrB,OAAO,QAQjB;IAED;;;;OAIG;IACH,cAHW,MAAM,GAAC,cAAc,GACnB,OAAO,CAInB;IAED;;OAEG;IACH,qBAEC;IAED;;;;OAIG;IACH,eAHW,OAAO,OACP,OAAO,QAmBjB;IAED,0BAwBC;IAED;;;;MAMC;IAED;;;OAGG;IACH,YAFW,SAAS,QAenB;IAED;;;OAGG;IACH,SAFa,SAAS,CAQrB;IAED;;;;OAIG;IACH,cAHW,SAAS,GACP,OAAO,CAMnB;IAED;;;OAGG;IACH,QAFa,MAAM,CAKlB;IAeD;;;;OAIG;IACH,sBAHW,SAAS,KACT,SAAS,QAMnB;IAED;;;OAGG;IACH,eAFW,OAAK,MAAM,EAAE,GAAC,YAAY,QAcpC;IAED;;;OAGG;IACH,kBAFW,MAAM,EAAE,GAAC,YAAY,QAI/B;IAED;;;;;OAKG;IACH,qBAEC;IAED,mBAEC;IA2BL;;;OAGG;IACH,sBAFU,OAAO,CAEc;;CAZ9B;;kBAIS,MAAM;;oBAhXI,+BAA+B;uBAD5B,kCAAkC;+BAE1B,qBAAqB"}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { assert } from "../../../core/assert.js";
|
|
6
6
|
import { compose_matrix4_array } from "../../../core/geom/3d/compose_matrix4_array.js";
|
|
7
7
|
import { decompose_matrix_4_array } from "../../../core/geom/3d/decompose_matrix_4_array.js";
|
|
8
|
-
import {
|
|
8
|
+
import { allocate_m4 } from "../../../core/geom/3d/mat4/allocate_m4.js";
|
|
9
9
|
import { m4_multiply } from "../../../core/geom/3d/mat4/m4_multiply.js";
|
|
10
10
|
import { MATRIX_4_IDENTITY } from "../../../core/geom/3d/mat4/MATRIX_4_IDENTITY.js";
|
|
11
11
|
import Quaternion from "../../../core/geom/Quaternion.js";
|
|
@@ -53,7 +53,7 @@ export class Transform {
|
|
|
53
53
|
* @readonly
|
|
54
54
|
* @type {Float32Array}
|
|
55
55
|
*/
|
|
56
|
-
matrix =
|
|
56
|
+
matrix = allocate_m4();
|
|
57
57
|
|
|
58
58
|
/**
|
|
59
59
|
* Various bit flags, see {@link TransformFlags}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VirtualTextureTile.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/graphics/texture/virtual/tile/VirtualTextureTile.js"],"names":[],"mappings":"AAAA;IAEI;;;OAGG;IACH,cAFU,MAAM,CAEC;IAEjB,
|
|
1
|
+
{"version":3,"file":"VirtualTextureTile.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/graphics/texture/virtual/tile/VirtualTextureTile.js"],"names":[],"mappings":"AAAA;IAEI;;;OAGG;IACH,cAFU,MAAM,CAEC;IAEjB;;;OAGG;IACH,gBAFU,MAAM,CAEG;IAEnB;;;OAGG;IACH,WAFU,MAAM,CAED;IAEf;;;OAGG;IACH,MAFU,YAAU,IAAI,CAEZ;IAEZ;;;;OAIG;IACH,cAHW,kBAAkB,GAChB,OAAO,CAInB;IAED,eAEC;CACJ"}
|