@woosh/meep-engine 2.113.2 → 2.113.4
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/bundle-worker-terrain.js +1 -1
- package/build/meep.cjs +63 -43
- package/build/meep.min.js +1 -1
- package/build/meep.module.js +63 -43
- package/package.json +1 -1
- package/src/core/collection/array/combine_hash.d.ts +7 -0
- package/src/core/collection/array/combine_hash.d.ts.map +1 -0
- package/src/core/collection/array/combine_hash.js +13 -0
- package/src/core/collection/array/computeHashIntegerArray.d.ts.map +1 -1
- package/src/core/collection/array/computeHashIntegerArray.js +4 -7
- package/src/core/collection/array/typed/is_typed_array_equals.d.ts.map +1 -1
- package/src/core/collection/array/typed/is_typed_array_equals.js +32 -15
- package/src/core/collection/array/typed/sparse_typed_array_hash.d.ts +10 -0
- package/src/core/collection/array/typed/sparse_typed_array_hash.d.ts.map +1 -0
- package/src/core/collection/array/typed/sparse_typed_array_hash.js +26 -0
- package/src/core/function/FunctionCompiler.js +3 -3
- package/src/core/geom/3d/compute_triangle_normal.d.ts +5 -5
- package/src/core/geom/3d/compute_triangle_normal.d.ts.map +1 -1
- package/src/core/geom/3d/compute_triangle_normal.js +4 -4
- package/src/core/geom/ConicRay.js +2 -2
- package/src/core/geom/Vector4.js +2 -2
- package/src/core/math/random/roundFair.js +1 -1
- package/src/core/model/node-graph/node/NodeInstancePortReference.js +2 -2
- package/src/core/model/reactive/model/ReactiveBinaryExpression.d.ts.map +1 -1
- package/src/core/model/reactive/model/ReactiveBinaryExpression.js +2 -2
- package/src/core/model/reactive/model/terminal/ReactiveReference.d.ts.map +1 -1
- package/src/core/model/reactive/model/terminal/ReactiveReference.js +2 -2
- package/src/engine/asset/AssetDescription.js +2 -2
- package/src/engine/asset/AssetManager.d.ts.map +1 -1
- package/src/engine/asset/AssetManager.js +2 -0
- package/src/engine/asset/loaders/material/computeMaterialHash.js +6 -6
- package/src/engine/asset/loaders/material/computeTextureHash.js +2 -2
- package/src/engine/ecs/animation/Animation.js +2 -2
- package/src/engine/ecs/animation/AnimationClip.d.ts.map +1 -1
- package/src/engine/ecs/animation/AnimationClip.js +4 -4
- package/src/engine/ecs/gui/GUIElement.js +2 -2
- package/src/engine/ecs/gui/hud/HeadsUpDisplay.js +2 -2
- package/src/engine/ecs/gui/position/ViewportPosition.js +2 -2
- package/src/engine/ecs/ik/IKConstraint.d.ts.map +1 -1
- package/src/engine/ecs/ik/IKConstraint.js +3 -3
- package/src/engine/graphics/ecs/animation/animator/AnimationClip.d.ts.map +1 -1
- package/src/engine/graphics/ecs/animation/animator/AnimationClip.js +4 -4
- package/src/engine/graphics/ecs/animation/animator/AnimationClipDefinition.js +4 -4
- package/src/engine/graphics/ecs/animation/animator/AnimationNotification.js +2 -2
- package/src/engine/graphics/ecs/animation/animator/AnimationNotificationDefinition.js +3 -3
- package/src/engine/graphics/ecs/animation/animator/graph/AnimationGraph.js +2 -2
- package/src/engine/graphics/ecs/animation/animator/graph/definition/AnimationGraphDefinition.d.ts.map +1 -1
- package/src/engine/graphics/ecs/animation/animator/graph/definition/AnimationGraphDefinition.js +8 -8
- package/src/engine/graphics/ecs/animation/animator/graph/definition/AnimationStateDefinition.js +2 -2
- package/src/engine/graphics/ecs/animation/animator/graph/definition/AnimationTransitionDefinition.js +3 -3
- package/src/engine/graphics/geometry/buffered/computeBufferAttributeHash.d.ts.map +1 -1
- package/src/engine/graphics/geometry/buffered/computeBufferAttributeHash.js +2 -13
- package/src/engine/graphics/particles/particular/engine/emitter/ParticleEmitter.js +2 -2
- package/src/engine/graphics/particles/particular/engine/emitter/ParticleLayer.js +2 -2
- package/src/engine/graphics/particles/particular/engine/parameter/ParameterLookupTable.d.ts.map +1 -1
- package/src/engine/graphics/particles/particular/engine/parameter/ParameterLookupTable.js +8 -3
- package/src/engine/graphics/particles/particular/engine/parameter/ParameterTrack.d.ts.map +1 -1
- package/src/engine/graphics/particles/particular/engine/parameter/ParameterTrack.js +3 -3
- package/src/engine/graphics/particles/particular/engine/parameter/ParticleParameter.d.ts.map +1 -1
- package/src/engine/graphics/particles/particular/engine/parameter/ParticleParameter.js +4 -4
- package/src/engine/graphics/render/buffer/slot/parameter/ProgramValueSlotParameter.d.ts.map +1 -1
- package/src/engine/graphics/render/buffer/slot/parameter/ProgramValueSlotParameter.js +4 -4
- package/src/engine/graphics/render/frame_graph/resource/TextureResourceDescriptor.js +2 -2
- package/src/engine/grid/obstacle/GridObstacle.js +2 -2
- package/src/engine/intelligence/behavior/selector/WeightedElement.js +2 -2
- package/src/engine/sound/ecs/emitter/SoundEmitter.js +2 -2
- package/src/engine/sound/ecs/emitter/SoundTrack.d.ts.map +1 -1
- package/src/engine/sound/ecs/emitter/SoundTrack.js +6 -6
- package/src/misc/makeMaterialIconCached.js +2 -2
- package/src/view/common/HTMLElementCacheKey.d.ts.map +1 -1
- package/src/view/common/HTMLElementCacheKey.js +5 -5
package/build/meep.module.js
CHANGED
|
@@ -48983,6 +48983,14 @@ function is_typed_array_equals(a, b) {
|
|
|
48983
48983
|
return false;
|
|
48984
48984
|
}
|
|
48985
48985
|
|
|
48986
|
+
const a_constructor = a.constructor;
|
|
48987
|
+
const b_constructor = b.constructor;
|
|
48988
|
+
|
|
48989
|
+
if (a_constructor !== b_constructor) {
|
|
48990
|
+
// incompatible constructors
|
|
48991
|
+
return false;
|
|
48992
|
+
}
|
|
48993
|
+
|
|
48986
48994
|
if (a_length === 0) {
|
|
48987
48995
|
// both arrays are empty
|
|
48988
48996
|
return true;
|
|
@@ -48999,20 +49007,15 @@ function is_typed_array_equals(a, b) {
|
|
|
48999
49007
|
return false;
|
|
49000
49008
|
}
|
|
49001
49009
|
|
|
49002
|
-
const a_constructor = a.constructor;
|
|
49003
|
-
const b_constructor = b.constructor;
|
|
49004
|
-
|
|
49005
|
-
if (a_constructor !== b_constructor) {
|
|
49006
|
-
// incompatible constructors
|
|
49007
|
-
return false;
|
|
49008
|
-
}
|
|
49009
|
-
|
|
49010
49010
|
|
|
49011
49011
|
const a_buffer = a.buffer;
|
|
49012
49012
|
const b_buffer = b.buffer;
|
|
49013
49013
|
|
|
49014
49014
|
// check if buffers are the same
|
|
49015
|
-
|
|
49015
|
+
const a_offset = a.byteOffset;
|
|
49016
|
+
const b_offset = b.byteOffset;
|
|
49017
|
+
|
|
49018
|
+
if (a_buffer === b_buffer && a_offset === b_offset) {
|
|
49016
49019
|
// using the same buffer and pointing to the same range within it
|
|
49017
49020
|
return true;
|
|
49018
49021
|
}
|
|
@@ -49022,14 +49025,28 @@ function is_typed_array_equals(a, b) {
|
|
|
49022
49025
|
|
|
49023
49026
|
const bytes_per_element = a_constructor.BYTES_PER_ELEMENT;
|
|
49024
49027
|
|
|
49025
|
-
if (
|
|
49028
|
+
if (
|
|
49029
|
+
bytes_per_element < 4
|
|
49030
|
+
&& byte_length % 4 === 0
|
|
49031
|
+
&& a_offset % 4 === 0
|
|
49032
|
+
&& b_offset % 4 === 0
|
|
49033
|
+
) {
|
|
49034
|
+
|
|
49026
49035
|
// 4 byte alignment, can use uint32
|
|
49027
|
-
a_proxy = new Uint32Array(a_buffer,
|
|
49028
|
-
b_proxy = new Uint32Array(b_buffer,
|
|
49029
|
-
|
|
49036
|
+
a_proxy = new Uint32Array(a_buffer, a_offset, byte_length >>> 2);
|
|
49037
|
+
b_proxy = new Uint32Array(b_buffer, b_offset, byte_length >>> 2);
|
|
49038
|
+
|
|
49039
|
+
} else if (
|
|
49040
|
+
bytes_per_element < 2
|
|
49041
|
+
&& byte_length % 2 === 0
|
|
49042
|
+
&& a_offset % 2 === 0
|
|
49043
|
+
&& b_offset % 2 === 0
|
|
49044
|
+
) {
|
|
49045
|
+
|
|
49030
49046
|
// 2 byte alignment, can use uint16
|
|
49031
|
-
a_proxy = new Uint16Array(a_buffer,
|
|
49032
|
-
b_proxy = new Uint16Array(b_buffer,
|
|
49047
|
+
a_proxy = new Uint16Array(a_buffer, a_offset, byte_length >>> 1);
|
|
49048
|
+
b_proxy = new Uint16Array(b_buffer, b_offset, byte_length >>> 1);
|
|
49049
|
+
|
|
49033
49050
|
}
|
|
49034
49051
|
|
|
49035
49052
|
return isArrayEqualStrict(a_proxy, b_proxy);
|
|
@@ -50516,11 +50533,12 @@ function computeIntegerArrayHash(data, offset, length) {
|
|
|
50516
50533
|
}
|
|
50517
50534
|
|
|
50518
50535
|
/**
|
|
50519
|
-
* Computes hash on integer values
|
|
50536
|
+
* Computes hash on integer values, useful for building composite hashes
|
|
50520
50537
|
* @param {...number} value
|
|
50521
50538
|
* @returns {number}
|
|
50522
50539
|
*/
|
|
50523
|
-
function
|
|
50540
|
+
function combine_hash(...value) {
|
|
50541
|
+
|
|
50524
50542
|
return computeIntegerArrayHash(value, 0, value.length);
|
|
50525
50543
|
}
|
|
50526
50544
|
|
|
@@ -50782,7 +50800,7 @@ class Vector4 {
|
|
|
50782
50800
|
* @return {number}
|
|
50783
50801
|
*/
|
|
50784
50802
|
hash() {
|
|
50785
|
-
return
|
|
50803
|
+
return combine_hash(
|
|
50786
50804
|
computeHashFloat(this.x),
|
|
50787
50805
|
computeHashFloat(this.y),
|
|
50788
50806
|
computeHashFloat(this.z),
|
|
@@ -75846,15 +75864,6 @@ class GenericRendererAdapter extends AbstractRenderAdapter {
|
|
|
75846
75864
|
|
|
75847
75865
|
}
|
|
75848
75866
|
|
|
75849
|
-
/**
|
|
75850
|
-
*
|
|
75851
|
-
* @param {Plane} plane
|
|
75852
|
-
* @returns {number}
|
|
75853
|
-
*/
|
|
75854
|
-
function planeHash(plane) {
|
|
75855
|
-
return mortonEncode_magicbits(plane.normal.x, plane.normal.y, plane.normal.z) ^ plane.constant;
|
|
75856
|
-
}
|
|
75857
|
-
|
|
75858
75867
|
/**
|
|
75859
75868
|
* @template T
|
|
75860
75869
|
* @param {T[]} array
|
|
@@ -75880,6 +75889,23 @@ function computeHashArray(array, elementHashFunction, thisArg) {
|
|
|
75880
75889
|
return hash;
|
|
75881
75890
|
}
|
|
75882
75891
|
|
|
75892
|
+
/**
|
|
75893
|
+
*
|
|
75894
|
+
* @param {THREE.Color} c
|
|
75895
|
+
*/
|
|
75896
|
+
function computeHashColor(c) {
|
|
75897
|
+
return c.getHex();
|
|
75898
|
+
}
|
|
75899
|
+
|
|
75900
|
+
/**
|
|
75901
|
+
*
|
|
75902
|
+
* @param {Plane} plane
|
|
75903
|
+
* @returns {number}
|
|
75904
|
+
*/
|
|
75905
|
+
function planeHash(plane) {
|
|
75906
|
+
return mortonEncode_magicbits(plane.normal.x, plane.normal.y, plane.normal.z) ^ plane.constant;
|
|
75907
|
+
}
|
|
75908
|
+
|
|
75883
75909
|
/**
|
|
75884
75910
|
*
|
|
75885
75911
|
* @param {THREE.Texture} texture
|
|
@@ -75893,14 +75919,6 @@ function textureHashById(texture) {
|
|
|
75893
75919
|
return texture.id;
|
|
75894
75920
|
}
|
|
75895
75921
|
|
|
75896
|
-
/**
|
|
75897
|
-
*
|
|
75898
|
-
* @param {THREE.Color} c
|
|
75899
|
-
*/
|
|
75900
|
-
function computeHashColor(c) {
|
|
75901
|
-
return c.getHex();
|
|
75902
|
-
}
|
|
75903
|
-
|
|
75904
75922
|
/**
|
|
75905
75923
|
*
|
|
75906
75924
|
* @param {Material|MeshStandardMaterial|ShaderMaterial} material
|
|
@@ -75908,7 +75926,7 @@ function computeHashColor(c) {
|
|
|
75908
75926
|
*/
|
|
75909
75927
|
function computeMaterialHash(material) {
|
|
75910
75928
|
|
|
75911
|
-
let hash =
|
|
75929
|
+
let hash = combine_hash(
|
|
75912
75930
|
computeHashFloat(material.alphaTest),
|
|
75913
75931
|
material.blendDst,
|
|
75914
75932
|
material.blendDstAlpha === null ? 0 : computeHashFloat(material.blendDstAlpha),
|
|
@@ -75942,7 +75960,7 @@ function computeMaterialHash(material) {
|
|
|
75942
75960
|
|
|
75943
75961
|
|
|
75944
75962
|
if (material.isMeshStandardMaterial) {
|
|
75945
|
-
hash =
|
|
75963
|
+
hash = combine_hash(
|
|
75946
75964
|
hash,
|
|
75947
75965
|
computeHashColor(material.color),
|
|
75948
75966
|
computeHashFloat(material.roughness),
|
|
@@ -76490,7 +76508,7 @@ function computeTextureHash(t) {
|
|
|
76490
76508
|
|
|
76491
76509
|
const specificHash = computeSpecificHash(t);
|
|
76492
76510
|
|
|
76493
|
-
return
|
|
76511
|
+
return combine_hash(
|
|
76494
76512
|
t.mapping,
|
|
76495
76513
|
t.wrapS,
|
|
76496
76514
|
t.wrapT,
|
|
@@ -85531,7 +85549,7 @@ class AssetDescription {
|
|
|
85531
85549
|
* @returns {number}
|
|
85532
85550
|
*/
|
|
85533
85551
|
hash() {
|
|
85534
|
-
return
|
|
85552
|
+
return combine_hash(
|
|
85535
85553
|
computeStringHash(this.path),
|
|
85536
85554
|
computeStringHash(this.type)
|
|
85537
85555
|
);
|
|
@@ -86081,6 +86099,8 @@ function get_pending_asset_priority_score(pending_asset) {
|
|
|
86081
86099
|
}
|
|
86082
86100
|
|
|
86083
86101
|
|
|
86102
|
+
// TODO handle 429 HTTP error gracefully
|
|
86103
|
+
|
|
86084
86104
|
/**
|
|
86085
86105
|
* Handles loading/generating assets
|
|
86086
86106
|
* @template CTX
|
|
@@ -98209,7 +98229,7 @@ function isArrayEqual(first, second) {
|
|
|
98209
98229
|
* @param {KeyValuePair<string,string>} pair
|
|
98210
98230
|
*/
|
|
98211
98231
|
function computeStringPairHash(pair) {
|
|
98212
|
-
return
|
|
98232
|
+
return combine_hash(
|
|
98213
98233
|
computeStringHash(pair.key),
|
|
98214
98234
|
computeStringHash(pair.value)
|
|
98215
98235
|
);
|
|
@@ -98444,7 +98464,7 @@ class HTMLElementCacheKey {
|
|
|
98444
98464
|
const tagHash = computeStringHash(this.tag);
|
|
98445
98465
|
|
|
98446
98466
|
|
|
98447
|
-
this.__hash =
|
|
98467
|
+
this.__hash = combine_hash(
|
|
98448
98468
|
styleHash,
|
|
98449
98469
|
attributeHash,
|
|
98450
98470
|
tagHash
|
|
@@ -102777,7 +102797,7 @@ class GUIElement {
|
|
|
102777
102797
|
* @return {number}
|
|
102778
102798
|
*/
|
|
102779
102799
|
hash() {
|
|
102780
|
-
return
|
|
102800
|
+
return combine_hash(
|
|
102781
102801
|
this.flags,
|
|
102782
102802
|
computeStringHash(this.klass),
|
|
102783
102803
|
this.anchor.hash(),
|
|
@@ -102914,7 +102934,7 @@ class ViewportPosition {
|
|
|
102914
102934
|
}
|
|
102915
102935
|
|
|
102916
102936
|
hash() {
|
|
102917
|
-
return
|
|
102937
|
+
return combine_hash(
|
|
102918
102938
|
this.position.hash(),
|
|
102919
102939
|
this.offset.hash(),
|
|
102920
102940
|
this.anchor.hash(),
|
package/package.json
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"combine_hash.d.ts","sourceRoot":"","sources":["../../../../../src/core/collection/array/combine_hash.js"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,uCAHc,MAAM,KACP,MAAM,CAMlB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { assert } from "../../assert.js";
|
|
2
|
+
import { computeIntegerArrayHash } from "../../primitives/array/computeIntegerArrayHash.js";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Computes hash on integer values, useful for building composite hashes
|
|
6
|
+
* @param {...number} value
|
|
7
|
+
* @returns {number}
|
|
8
|
+
*/
|
|
9
|
+
export function combine_hash(...value) {
|
|
10
|
+
assert.isArray(value, 'value');
|
|
11
|
+
|
|
12
|
+
return computeIntegerArrayHash(value, 0, value.length);
|
|
13
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"computeHashIntegerArray.d.ts","sourceRoot":"","sources":["../../../../../src/core/collection/array/computeHashIntegerArray.js"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"computeHashIntegerArray.d.ts","sourceRoot":"","sources":["../../../../../src/core/collection/array/computeHashIntegerArray.js"],"names":[],"mappings":"AAEA;;;GAGG;AACH,gDAFsB,CAAC,MAAM,CAAC,OAAG,MAAM,CAEa"}
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { combine_hash } from "./combine_hash.js";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
* @
|
|
6
|
-
* @returns {number}
|
|
4
|
+
* @deprecated use {@link combine_hash} instead
|
|
5
|
+
* @type {function(...[number]): number}
|
|
7
6
|
*/
|
|
8
|
-
export
|
|
9
|
-
return computeIntegerArrayHash(value, 0, value.length);
|
|
10
|
-
}
|
|
7
|
+
export const computeHashIntegerArray = combine_hash;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is_typed_array_equals.d.ts","sourceRoot":"","sources":["../../../../../../src/core/collection/array/typed/is_typed_array_equals.js"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,yCAJW,UAAU,GAAC,WAAW,KACtB,UAAU,GAAC,WAAW,GACpB,OAAO,
|
|
1
|
+
{"version":3,"file":"is_typed_array_equals.d.ts","sourceRoot":"","sources":["../../../../../../src/core/collection/array/typed/is_typed_array_equals.js"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,yCAJW,UAAU,GAAC,WAAW,KACtB,UAAU,GAAC,WAAW,GACpB,OAAO,CAmFnB"}
|
|
@@ -21,6 +21,14 @@ export function is_typed_array_equals(a, b) {
|
|
|
21
21
|
return false;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
+
const a_constructor = a.constructor;
|
|
25
|
+
const b_constructor = b.constructor;
|
|
26
|
+
|
|
27
|
+
if (a_constructor !== b_constructor) {
|
|
28
|
+
// incompatible constructors
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
|
|
24
32
|
if (a_length === 0) {
|
|
25
33
|
// both arrays are empty
|
|
26
34
|
return true;
|
|
@@ -37,20 +45,15 @@ export function is_typed_array_equals(a, b) {
|
|
|
37
45
|
return false;
|
|
38
46
|
}
|
|
39
47
|
|
|
40
|
-
const a_constructor = a.constructor;
|
|
41
|
-
const b_constructor = b.constructor;
|
|
42
|
-
|
|
43
|
-
if (a_constructor !== b_constructor) {
|
|
44
|
-
// incompatible constructors
|
|
45
|
-
return false;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
48
|
|
|
49
49
|
const a_buffer = a.buffer;
|
|
50
50
|
const b_buffer = b.buffer;
|
|
51
51
|
|
|
52
52
|
// check if buffers are the same
|
|
53
|
-
|
|
53
|
+
const a_offset = a.byteOffset;
|
|
54
|
+
const b_offset = b.byteOffset;
|
|
55
|
+
|
|
56
|
+
if (a_buffer === b_buffer && a_offset === b_offset) {
|
|
54
57
|
// using the same buffer and pointing to the same range within it
|
|
55
58
|
return true;
|
|
56
59
|
}
|
|
@@ -60,14 +63,28 @@ export function is_typed_array_equals(a, b) {
|
|
|
60
63
|
|
|
61
64
|
const bytes_per_element = a_constructor.BYTES_PER_ELEMENT;
|
|
62
65
|
|
|
63
|
-
if (
|
|
66
|
+
if (
|
|
67
|
+
bytes_per_element < 4
|
|
68
|
+
&& byte_length % 4 === 0
|
|
69
|
+
&& a_offset % 4 === 0
|
|
70
|
+
&& b_offset % 4 === 0
|
|
71
|
+
) {
|
|
72
|
+
|
|
64
73
|
// 4 byte alignment, can use uint32
|
|
65
|
-
a_proxy = new Uint32Array(a_buffer,
|
|
66
|
-
b_proxy = new Uint32Array(b_buffer,
|
|
67
|
-
|
|
74
|
+
a_proxy = new Uint32Array(a_buffer, a_offset, byte_length >>> 2);
|
|
75
|
+
b_proxy = new Uint32Array(b_buffer, b_offset, byte_length >>> 2);
|
|
76
|
+
|
|
77
|
+
} else if (
|
|
78
|
+
bytes_per_element < 2
|
|
79
|
+
&& byte_length % 2 === 0
|
|
80
|
+
&& a_offset % 2 === 0
|
|
81
|
+
&& b_offset % 2 === 0
|
|
82
|
+
) {
|
|
83
|
+
|
|
68
84
|
// 2 byte alignment, can use uint16
|
|
69
|
-
a_proxy = new Uint16Array(a_buffer,
|
|
70
|
-
b_proxy = new Uint16Array(b_buffer,
|
|
85
|
+
a_proxy = new Uint16Array(a_buffer, a_offset, byte_length >>> 1);
|
|
86
|
+
b_proxy = new Uint16Array(b_buffer, b_offset, byte_length >>> 1);
|
|
87
|
+
|
|
71
88
|
}
|
|
72
89
|
|
|
73
90
|
return isArrayEqualStrict(a_proxy, b_proxy);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @param {Uint32Array} array
|
|
4
|
+
* @param {number} offset
|
|
5
|
+
* @param {number} length
|
|
6
|
+
* @param {number} [sample_limit]
|
|
7
|
+
* @returns {number}
|
|
8
|
+
*/
|
|
9
|
+
export function sparse_typed_array_hash(array: Uint32Array, offset: number, length: number, sample_limit?: number): number;
|
|
10
|
+
//# sourceMappingURL=sparse_typed_array_hash.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sparse_typed_array_hash.d.ts","sourceRoot":"","sources":["../../../../../../src/core/collection/array/typed/sparse_typed_array_hash.js"],"names":[],"mappings":"AAIA;;;;;;;GAOG;AACH,+CANW,WAAW,UACX,MAAM,UACN,MAAM,iBACN,MAAM,GACJ,MAAM,CAelB"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { min2 } from "../../../math/min2.js";
|
|
2
|
+
import { computeStridedArrayHash } from "../../../primitives/array/computeStridedArrayHash.js";
|
|
3
|
+
import { computeHashFloat } from "../../../primitives/numbers/computeHashFloat.js";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
*
|
|
7
|
+
* @param {Uint32Array} array
|
|
8
|
+
* @param {number} offset
|
|
9
|
+
* @param {number} length
|
|
10
|
+
* @param {number} [sample_limit]
|
|
11
|
+
* @returns {number}
|
|
12
|
+
*/
|
|
13
|
+
export function sparse_typed_array_hash(array, offset, length, sample_limit = 31) {
|
|
14
|
+
// limit hash evaluation to first 1k of the data to random memory access and keep CPU cache usage more coherent
|
|
15
|
+
const hash_evaluation_length = min2(length, 1024);
|
|
16
|
+
|
|
17
|
+
// compute stride so that we don't have to iterate over the entire buffer, instead picking at most X(509) values to consider
|
|
18
|
+
const stride = Math.max(1, Math.ceil(hash_evaluation_length / sample_limit));
|
|
19
|
+
|
|
20
|
+
// TODO implement fast dedicated float and int paths
|
|
21
|
+
|
|
22
|
+
return computeStridedArrayHash(
|
|
23
|
+
array, 0, hash_evaluation_length, stride,
|
|
24
|
+
computeHashFloat
|
|
25
|
+
);
|
|
26
|
+
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { assert } from "../assert.js";
|
|
2
2
|
import { Cache } from "../cache/Cache.js";
|
|
3
|
+
import { combine_hash } from "../collection/array/combine_hash.js";
|
|
4
|
+
import { computeHashArray } from "../collection/array/computeHashArray.js";
|
|
3
5
|
import { isArrayEqualStrict } from "../collection/array/isArrayEqualStrict.js";
|
|
4
6
|
import { invokeObjectEquals } from "../model/object/invokeObjectEquals.js";
|
|
5
7
|
import { invokeObjectHash } from "../model/object/invokeObjectHash.js";
|
|
6
8
|
import { computeStringHash } from "../primitives/strings/computeStringHash.js";
|
|
7
|
-
import { computeHashArray } from "../collection/array/computeHashArray.js";
|
|
8
|
-
import { computeHashIntegerArray } from "../collection/array/computeHashIntegerArray.js";
|
|
9
9
|
import { string_compute_byte_size } from "../primitives/strings/string_compute_byte_size.js";
|
|
10
10
|
|
|
11
11
|
/**
|
|
@@ -49,7 +49,7 @@ class FunctionDefinition {
|
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
updateHash() {
|
|
52
|
-
this.__hash =
|
|
52
|
+
this.__hash = combine_hash(
|
|
53
53
|
computeStringHash(this.name),
|
|
54
54
|
computeStringHash(this.body),
|
|
55
55
|
computeHashArray(this.args, computeStringHash)
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
*
|
|
3
|
-
* @param {number[]|vec3} result
|
|
4
|
-
* @param {number[]} vA
|
|
5
|
-
* @param {number[]} vB
|
|
6
|
-
* @param {number[]} vC
|
|
3
|
+
* @param {number[]|vec3|Float32Array|Float64Array} result
|
|
4
|
+
* @param {number[]|vec3|Float32Array|Float64Array} vA
|
|
5
|
+
* @param {number[]|vec3|Float32Array|Float64Array} vB
|
|
6
|
+
* @param {number[]|vec3|Float32Array|Float64Array} vC
|
|
7
7
|
*/
|
|
8
|
-
export function compute_triangle_normal(result: number[] | vec3, vA: number[], vB: number[], vC: number[]): void;
|
|
8
|
+
export function compute_triangle_normal(result: number[] | vec3 | Float32Array | Float64Array, vA: number[] | vec3 | Float32Array | Float64Array, vB: number[] | vec3 | Float32Array | Float64Array, vC: number[] | vec3 | Float32Array | Float64Array): void;
|
|
9
9
|
//# sourceMappingURL=compute_triangle_normal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compute_triangle_normal.d.ts","sourceRoot":"","sources":["../../../../../src/core/geom/3d/compute_triangle_normal.js"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,gDALW,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"compute_triangle_normal.d.ts","sourceRoot":"","sources":["../../../../../src/core/geom/3d/compute_triangle_normal.js"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,gDALW,MAAM,EAAE,UAAM,YAAY,GAAC,YAAY,MACvC,MAAM,EAAE,UAAM,YAAY,GAAC,YAAY,MACvC,MAAM,EAAE,UAAM,YAAY,GAAC,YAAY,MACvC,MAAM,EAAE,UAAM,YAAY,GAAC,YAAY,QAiBjD"}
|
|
@@ -2,10 +2,10 @@ import { v3_compute_triangle_normal } from "./v3_compute_triangle_normal.js";
|
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
*
|
|
5
|
-
* @param {number[]|vec3} result
|
|
6
|
-
* @param {number[]} vA
|
|
7
|
-
* @param {number[]} vB
|
|
8
|
-
* @param {number[]} vC
|
|
5
|
+
* @param {number[]|vec3|Float32Array|Float64Array} result
|
|
6
|
+
* @param {number[]|vec3|Float32Array|Float64Array} vA
|
|
7
|
+
* @param {number[]|vec3|Float32Array|Float64Array} vB
|
|
8
|
+
* @param {number[]|vec3|Float32Array|Float64Array} vC
|
|
9
9
|
*/
|
|
10
10
|
export function compute_triangle_normal(result, vA, vB, vC) {
|
|
11
11
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { assert } from "../assert.js";
|
|
2
|
-
import {
|
|
2
|
+
import { combine_hash } from "../collection/array/combine_hash.js";
|
|
3
3
|
import { EPSILON } from "../math/EPSILON.js";
|
|
4
4
|
import { epsilonEquals } from "../math/epsilonEquals.js";
|
|
5
5
|
import { computeHashFloat } from "../primitives/numbers/computeHashFloat.js";
|
|
@@ -81,7 +81,7 @@ export class ConicRay {
|
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
hash() {
|
|
84
|
-
return
|
|
84
|
+
return combine_hash(
|
|
85
85
|
computeHashFloat(this.angle),
|
|
86
86
|
this.direction.hash()
|
|
87
87
|
);
|
package/src/core/geom/Vector4.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { assert } from "../assert.js";
|
|
2
|
-
import {
|
|
2
|
+
import { combine_hash } from "../collection/array/combine_hash.js";
|
|
3
3
|
import { Signal } from "../events/signal/Signal.js";
|
|
4
4
|
import { lerp } from "../math/lerp.js";
|
|
5
5
|
import { computeHashFloat } from "../primitives/numbers/computeHashFloat.js";
|
|
@@ -273,7 +273,7 @@ class Vector4 {
|
|
|
273
273
|
* @return {number}
|
|
274
274
|
*/
|
|
275
275
|
hash() {
|
|
276
|
-
return
|
|
276
|
+
return combine_hash(
|
|
277
277
|
computeHashFloat(this.x),
|
|
278
278
|
computeHashFloat(this.y),
|
|
279
279
|
computeHashFloat(this.z),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { assert } from "../../../assert.js";
|
|
2
|
-
import {
|
|
2
|
+
import { combine_hash } from "../../../collection/array/combine_hash.js";
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
*
|
|
@@ -133,7 +133,7 @@ export class NodeInstancePortReference {
|
|
|
133
133
|
}
|
|
134
134
|
|
|
135
135
|
hash() {
|
|
136
|
-
return
|
|
136
|
+
return combine_hash(
|
|
137
137
|
this.instance.hash(),
|
|
138
138
|
this.port.hash()
|
|
139
139
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReactiveBinaryExpression.d.ts","sourceRoot":"","sources":["../../../../../../src/core/model/reactive/model/ReactiveBinaryExpression.js"],"names":[],"mappings":"AAIA;;GAEG;AACH;IACI,cAqBC;IAlBG;;;OAGG;IACH,MAFU,0BAAmB,IAAI,CAEjB;IAChB;;;OAGG;IACH,OAFU,0BAAmB,IAAI,CAEhB;IAEjB;;;;OAIG;IACH,mBAA2B;IAI/B,uBAQC;IAED,wBAcC;IAED,eAMC;IAED,0BAQC;IAED,eAUC;IAED;;;OAGG;IACH,kCAFa,IAAE,OAAO,GAAC,MAAM,CAI5B;IAED,2CAKC;IAED;;;;OAIG;IACH,qCAkBC;IAED,mBAaC;IAyBL;;;;;;OAMG;IACH,wBAFU,OAAO,CAE+B;IAEhD;;;OAGG;IACH,6BAFU,OAAO,CAEoC;CAfpD;
|
|
1
|
+
{"version":3,"file":"ReactiveBinaryExpression.d.ts","sourceRoot":"","sources":["../../../../../../src/core/model/reactive/model/ReactiveBinaryExpression.js"],"names":[],"mappings":"AAIA;;GAEG;AACH;IACI,cAqBC;IAlBG;;;OAGG;IACH,MAFU,0BAAmB,IAAI,CAEjB;IAChB;;;OAGG;IACH,OAFU,0BAAmB,IAAI,CAEhB;IAEjB;;;;OAIG;IACH,mBAA2B;IAI/B,uBAQC;IAED,wBAcC;IAED,eAMC;IAED,0BAQC;IAED,eAUC;IAED;;;OAGG;IACH,kCAFa,IAAE,OAAO,GAAC,MAAM,CAI5B;IAED,2CAKC;IAED;;;;OAIG;IACH,qCAkBC;IAED,mBAaC;IAyBL;;;;;;OAMG;IACH,wBAFU,OAAO,CAE+B;IAEhD;;;OAGG;IACH,6BAFU,OAAO,CAEoC;CAfpD;mCAjKkC,yBAAyB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { assert } from "../../../assert.js";
|
|
2
|
+
import { combine_hash } from "../../../collection/array/combine_hash.js";
|
|
2
3
|
import { ReactiveExpression } from "./ReactiveExpression.js";
|
|
3
|
-
import { computeHashIntegerArray } from "../../../collection/array/computeHashIntegerArray.js";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @extends {ReactiveExpression}
|
|
@@ -56,7 +56,7 @@ export class ReactiveBinaryExpression extends ReactiveExpression {
|
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
hash() {
|
|
59
|
-
return
|
|
59
|
+
return combine_hash(
|
|
60
60
|
this.left.hash(),
|
|
61
61
|
this.right.hash(),
|
|
62
62
|
super.hash()
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReactiveReference.d.ts","sourceRoot":"","sources":["../../../../../../../src/core/model/reactive/model/terminal/ReactiveReference.js"],"names":[],"mappings":"AAOA;;GAEG;AACH;IAEI;;;OAGG;IACH,kBAFW,MAAM,EAgBhB;IAXG;;;OAGG;IACH,MAFU,MAAM,CAEA;IAEhB;;;OAGG;IACH,QAFU,mDAA0C,CAElC;IAGtB;;;OAGG;IACH,YAFW,iBAAiB,QAU3B;IAED;;;OAGG;IACH,SAFY,iBAAiB,CAQ5B;IAED,gCAEC;IAED,2BAmBC;IAED,mBAQC;IAED,wBAKC;IAED,iBAEC;IAGD,eAKC;IAED,0BAGC;IAOL;;;OAGG;IACH,qBAFU,OAAO,CAEqB;IAEtC;;;OAGG;IACH,sBAFU,OAAO,CAEsB;CAZtC;;IAcD;;;;;OAKG;IACH,6DAaC;;
|
|
1
|
+
{"version":3,"file":"ReactiveReference.d.ts","sourceRoot":"","sources":["../../../../../../../src/core/model/reactive/model/terminal/ReactiveReference.js"],"names":[],"mappings":"AAOA;;GAEG;AACH;IAEI;;;OAGG;IACH,kBAFW,MAAM,EAgBhB;IAXG;;;OAGG;IACH,MAFU,MAAM,CAEA;IAEhB;;;OAGG;IACH,QAFU,mDAA0C,CAElC;IAGtB;;;OAGG;IACH,YAFW,iBAAiB,QAU3B;IAED;;;OAGG;IACH,SAFY,iBAAiB,CAQ5B;IAED,gCAEC;IAED,2BAmBC;IAED,mBAQC;IAED,wBAKC;IAED,iBAEC;IAGD,eAKC;IAED,0BAGC;IAOL;;;OAGG;IACH,qBAFU,OAAO,CAEqB;IAEtC;;;OAGG;IACH,sBAFU,OAAO,CAEsB;CAZtC;;IAcD;;;;;OAKG;IACH,6DAaC;;mCArJkC,0BAA0B"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { assert } from "../../../../assert.js";
|
|
2
|
+
import { combine_hash } from "../../../../collection/array/combine_hash.js";
|
|
2
3
|
import DataType from "../../../../parser/simple/DataType.js";
|
|
3
4
|
import { computeStringHash } from "../../../../primitives/strings/computeStringHash.js";
|
|
4
5
|
import { ReactiveExpression } from "../ReactiveExpression.js";
|
|
5
|
-
import { computeHashIntegerArray } from "../../../../collection/array/computeHashIntegerArray.js";
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -104,7 +104,7 @@ export class ReactiveReference extends ReactiveExpression {
|
|
|
104
104
|
|
|
105
105
|
|
|
106
106
|
hash() {
|
|
107
|
-
return
|
|
107
|
+
return combine_hash(
|
|
108
108
|
computeStringHash(this.name),
|
|
109
109
|
super.hash()
|
|
110
110
|
);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { assert } from "../../core/assert.js";
|
|
2
|
-
import {
|
|
2
|
+
import { combine_hash } from "../../core/collection/array/combine_hash.js";
|
|
3
3
|
import { computeStringHash } from "../../core/primitives/strings/computeStringHash.js";
|
|
4
4
|
|
|
5
5
|
export class AssetDescription {
|
|
@@ -39,7 +39,7 @@ export class AssetDescription {
|
|
|
39
39
|
* @returns {number}
|
|
40
40
|
*/
|
|
41
41
|
hash() {
|
|
42
|
-
return
|
|
42
|
+
return combine_hash(
|
|
43
43
|
computeStringHash(this.path),
|
|
44
44
|
computeStringHash(this.type)
|
|
45
45
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssetManager.d.ts","sourceRoot":"","sources":["../../../../src/engine/asset/AssetManager.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AssetManager.d.ts","sourceRoot":"","sources":["../../../../src/engine/asset/AssetManager.js"],"names":[],"mappings":"AA8CA;;;;GAIG;AACH;IAgII;;;;;OAKG;IACH,oCAJW,GAAG,EAYb;IA7ID;;;;OAIG;IACH,eAEG;IAEH;;;OAGG;IACH,aAFU,YAAY,gBAAgB,EAAE,YAAY,CAAC,CAER;IAe7C;;;;;;OAMG;IACH,kBAFU,MAAM,CAEY;IAyB5B;;;;OAIG;IACH,iBAAc;IAEd;;;OAGG;IACH,mBAFU,iBAAiB,CAEiB;IAwE5C,gBAQC;IAED;;;;OAIG;IACH,qBAHW,MAAM,GACL,QAAQ,IAAI,CAAC,CAexB;IAED;;;;;OAKG;IACH,oCAFa,OAAO,CAOnB;IAED;;OAEG;IACH,cAEC;IAED,8BAEC;IAED;;;;;;OAMG;IACH,4DAJW,iBAAiB,GAEf,cAAc,CAY1B;IAED;;;;;;;;;OASG;IACH,qFAsCC;IAED;;;;;OAKG;IACH,aAJW,MAAM,QACN,MAAM,sBAehB;IA2QD;;;;;OAKG;IACH,sBA2BC;IAGD;;;;OAIG;IACH,uBAHW,MAAM,GACL,OAAO,CAIlB;IAED;;;;OAIG;IACH,sBAHW,MAAM,GACJ,wBAAY,SAAS,CAMjC;IAaD;;;;OAIG;IACH,+BAHW,MAAM,4CAqBhB;IAED;;;;OAIG;IACH,iCAHW,MAAM,+CAyBhB;IAED;;;;;;OAMG;IACH,6BAJW,MAAM,kCAEJ,QAAQ,OAAO,CAAC,CAU5B;IAED;;;;;OAKG;IACH,0BAJW,MAAM,iEAwChB;IAED;;;OAGG;IACH,uBAFW,MAAM,iBAkBhB;IAED;;;;;;OAMG;IACH,yCAFa,aAAS,IAAI,CAYzB;IAED;;;;;OAKG;IACH,eAJW,MAAM,QACN,MAAM,GACJ,OAAO,CAMnB;IAED;;;;OAIG;IACH,2BAHW,MAAM,GACL,mBAAiB,CAa5B;IAED;;;;OAIG;IACH,oBAHW,MAAM,GACL,gBAAgB,GAAC,SAAS,CAQrC;IAED;;;;;OAKG;IACH,mBAJW,MAAM,QACN,MAAM,QACN,MAAM,QAUhB;IAGL;;;OAGG;IACH,yBAFU,OAAO,CAEoB;;CANpC;4BA/2B2B,0CAA0C;iCAOrC,uBAAuB;6BAM3B,mBAAmB;kCAFd,6BAA6B;kCAD7B,wBAAwB;4BAE9B,0BAA0B"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { computeStringHash } from "../../../../core/primitives/strings/computeStringHash.js";
|
|
1
|
+
import { combine_hash } from "../../../../core/collection/array/combine_hash.js";
|
|
3
2
|
import { computeHashArray } from "../../../../core/collection/array/computeHashArray.js";
|
|
4
|
-
import { computeHashIntegerArray } from "../../../../core/collection/array/computeHashIntegerArray.js";
|
|
5
3
|
import { computeHashFloat } from "../../../../core/primitives/numbers/computeHashFloat.js";
|
|
6
|
-
import {
|
|
4
|
+
import { computeStringHash } from "../../../../core/primitives/strings/computeStringHash.js";
|
|
7
5
|
import { computeHashColor } from "./computeHashColor.js";
|
|
6
|
+
import { planeHash } from "./planeHash.js";
|
|
7
|
+
import { textureHashById } from "./textureHashById.js";
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
*
|
|
@@ -13,7 +13,7 @@ import { computeHashColor } from "./computeHashColor.js";
|
|
|
13
13
|
*/
|
|
14
14
|
export function computeMaterialHash(material) {
|
|
15
15
|
|
|
16
|
-
let hash =
|
|
16
|
+
let hash = combine_hash(
|
|
17
17
|
computeHashFloat(material.alphaTest),
|
|
18
18
|
material.blendDst,
|
|
19
19
|
material.blendDstAlpha === null ? 0 : computeHashFloat(material.blendDstAlpha),
|
|
@@ -47,7 +47,7 @@ export function computeMaterialHash(material) {
|
|
|
47
47
|
|
|
48
48
|
|
|
49
49
|
if (material.isMeshStandardMaterial) {
|
|
50
|
-
hash =
|
|
50
|
+
hash = combine_hash(
|
|
51
51
|
hash,
|
|
52
52
|
computeHashColor(material.color),
|
|
53
53
|
computeHashFloat(material.roughness),
|