@woosh/meep-engine 2.118.8 → 2.118.11
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 +202 -410
- package/build/meep.min.js +1 -1
- package/build/meep.module.js +202 -410
- package/editor/ecs/component/editors/Sampler2DEditor.js +2 -4
- package/package.json +1 -1
- package/samples/generation/SampleGenerator0.js +55 -55
- package/samples/generation/generators/interactive/mir_generator_place_buff_objects.js +21 -23
- package/samples/generation/generators/mir_generator_place_bases.js +20 -20
- package/samples/generation/generators/mir_generator_place_road_decorators.js +11 -11
- package/samples/terrain/editor.js +3 -3
- package/src/core/bvh2/binary/2/BinaryUint32BVH.d.ts +1 -19
- package/src/core/bvh2/binary/2/BinaryUint32BVH.d.ts.map +1 -1
- package/src/core/bvh2/binary/2/BinaryUint32BVH.js +10 -78
- package/src/core/bvh2/bvh3/build_triangle_morton_codes.js +1 -1
- package/src/core/bvh2/bvh3/ebvh_build_for_geometry_morton.d.ts.map +1 -1
- package/src/core/bvh2/bvh3/ebvh_build_for_geometry_morton.js +9 -7
- package/src/core/collection/array/isArrayEqualStrict.d.ts.map +1 -1
- package/src/core/collection/array/isArrayEqualStrict.js +2 -2
- package/src/core/collection/array/iterator/ArrayIteratorSequential.d.ts.map +1 -1
- package/src/core/collection/array/iterator/ArrayIteratorSequential.js +3 -4
- package/src/core/collection/queue/Deque.d.ts.map +1 -1
- package/src/core/collection/queue/Deque.js +1 -1
- package/src/core/geom/2d/quad-tree/qt_collect_data_all.d.ts +9 -0
- package/src/core/geom/2d/quad-tree/qt_collect_data_all.d.ts.map +1 -0
- package/src/core/geom/2d/quad-tree/qt_collect_data_all.js +29 -0
- package/src/core/geom/3d/aabb/AABB3.d.ts.map +1 -1
- package/src/core/geom/3d/aabb/AABB3.js +0 -8
- package/src/core/geom/3d/morton/{Morton.d.ts → v3_morton_encode.d.ts} +1 -1
- package/src/core/geom/3d/morton/v3_morton_encode.d.ts.map +1 -0
- package/src/core/geom/3d/morton/v3_morton_encode_bounded.js +2 -2
- package/src/core/geom/3d/morton/v3_morton_encode_transformed.js +2 -2
- package/src/core/geom/Quaternion.d.ts.map +1 -1
- package/src/core/geom/Quaternion.js +7 -10
- package/src/core/geom/Vector3.d.ts.map +1 -1
- package/src/core/geom/Vector3.js +4 -49
- package/src/core/math/gaussian.d.ts.map +1 -1
- package/src/core/math/gaussian.js +4 -1
- package/src/core/math/physics/pdf/pdf_GGX.d.ts +3 -3
- package/src/core/math/physics/pdf/pdf_GGX.d.ts.map +1 -1
- package/src/core/math/physics/pdf/pdf_GGX.js +7 -6
- package/src/core/math/sinc.d.ts +8 -0
- package/src/core/math/sinc.d.ts.map +1 -0
- package/src/core/math/sinc.js +13 -0
- package/src/core/model/ObservedBoolean.js +1 -1
- package/src/core/model/node-graph/json/deserializeNodeGraphFromJSON.d.ts +1 -1
- package/src/core/model/node-graph/json/deserializeNodeGraphFromJSON.js +7 -7
- package/src/core/model/object/validatedObjectValueByKey.js +1 -1
- package/src/core/model/reactive/transform/{ReactiveTypeInferrence.d.ts → inferReactiveExpressionTypes.d.ts} +1 -1
- package/src/core/model/reactive/transform/inferReactiveExpressionTypes.d.ts.map +1 -0
- package/src/core/model/reactive/transform/inferReactiveExpressionTypes.js +60 -0
- package/src/core/model/reactive/trigger/ReactiveTrigger.js +1 -1
- package/src/core/process/delay.d.ts.map +1 -1
- package/src/core/process/delay.js +6 -0
- package/src/core/process/task/TaskGroup.d.ts.map +1 -1
- package/src/core/process/task/TaskGroup.js +3 -8
- package/src/core/process/undo/ActionGroup.d.ts.map +1 -1
- package/src/core/process/undo/ActionGroup.js +6 -9
- package/src/core/process/worker/WorkerProxy.d.ts +12 -3
- package/src/core/process/worker/WorkerProxy.d.ts.map +1 -1
- package/src/core/process/worker/WorkerProxy.js +10 -1
- package/src/core/process/worker/extractTransferables.d.ts +3 -2
- package/src/core/process/worker/extractTransferables.d.ts.map +1 -1
- package/src/core/process/worker/extractTransferables.js +32 -12
- package/src/engine/ecs/dynamic_actions/rules/DynamicRuleDescription.d.ts.map +1 -1
- package/src/engine/ecs/dynamic_actions/rules/DynamicRuleDescription.js +3 -1
- package/src/engine/ecs/terrain/BufferedGeometryArraysBuilder.d.ts +2 -17
- package/src/engine/ecs/terrain/BufferedGeometryArraysBuilder.d.ts.map +1 -1
- package/src/engine/ecs/terrain/BufferedGeometryArraysBuilder.js +2 -118
- package/src/engine/ecs/terrain/ecs/cling/ClingToTerrain.d.ts +0 -1
- package/src/engine/ecs/terrain/ecs/cling/ClingToTerrain.d.ts.map +1 -1
- package/src/engine/ecs/terrain/ecs/cling/ClingToTerrain.js +1 -6
- package/src/engine/ecs/terrain/ecs/cling/ClingToTerrainSystem.d.ts +5 -5
- package/src/engine/ecs/terrain/ecs/cling/ClingToTerrainSystem.d.ts.map +1 -1
- package/src/engine/ecs/terrain/ecs/cling/ClingToTerrainSystem.js +20 -28
- package/src/engine/ecs/terrain/ecs/layers/TerrainLayer.d.ts.map +1 -1
- package/src/engine/ecs/terrain/ecs/layers/TerrainLayer.js +2 -2
- package/src/engine/ecs/terrain/tiles/TerrainTile.d.ts.map +1 -1
- package/src/engine/ecs/terrain/tiles/TerrainTile.js +3 -1
- package/src/engine/graphics/GraphicsEngine.d.ts.map +1 -1
- package/src/engine/graphics/GraphicsEngine.js +4 -0
- package/src/engine/graphics/ecs/camera/CameraSystem.d.ts.map +1 -1
- package/src/engine/graphics/ecs/camera/CameraSystem.js +4 -0
- package/src/engine/graphics/geometry/MikkT/MikkTSpace.d.ts +1 -1
- package/src/engine/graphics/geometry/MikkT/MikkTSpace.js +12 -12
- package/src/engine/graphics/geometry/MikkT/STSpace.d.ts.map +1 -1
- package/src/engine/graphics/geometry/MikkT/STSpace.js +14 -16
- package/src/engine/graphics/geometry/buffered/build_height_field_geometry.d.ts +17 -0
- package/src/engine/graphics/geometry/buffered/build_height_field_geometry.d.ts.map +1 -0
- package/src/engine/graphics/geometry/buffered/build_height_field_geometry.js +118 -0
- package/src/engine/graphics/geometry/buffered/geometry_compute_vertex_normals_indexed.d.ts +2 -2
- package/src/engine/graphics/geometry/buffered/geometry_compute_vertex_normals_indexed.d.ts.map +1 -1
- package/src/engine/graphics/geometry/buffered/geometry_compute_vertex_normals_indexed.js +1 -1
- package/src/engine/graphics/material/optimization/MaterialOptimizationContext.d.ts.map +1 -1
- package/src/engine/graphics/material/optimization/MaterialOptimizationContext.js +2 -2
- package/src/engine/graphics/render/forward_plus/materials/FPlusDebugMaterial.js +3 -3
- package/src/engine/graphics/texture/sampler/Sampler2D.d.ts.map +1 -1
- package/src/engine/graphics/texture/sampler/Sampler2D.js +31 -52
- package/src/engine/graphics/texture/sampler/sampler2d_to_texture.d.ts +10 -0
- package/src/engine/graphics/texture/sampler/sampler2d_to_texture.d.ts.map +1 -0
- package/src/engine/graphics/texture/sampler/{Sampler2D2Texture.js → sampler2d_to_texture.js} +5 -5
- package/src/engine/graphics/texture/sampler/{copy_Sampler2D_channel_data.d.ts → sampler2d_transfer_data.d.ts} +2 -2
- package/src/engine/graphics/texture/sampler/sampler2d_transfer_data.d.ts.map +1 -0
- package/src/engine/graphics/texture/sampler/{copy_Sampler2D_channel_data.js → sampler2d_transfer_data.js} +1 -1
- package/src/engine/graphics/texture/sampler/writeSampler2DDataToDataTexture.js +2 -2
- package/src/engine/graphics/trail/x/simulator/RibbonXFixedPhysicsSimulator.d.ts.map +1 -1
- package/src/engine/graphics/trail/x/simulator/RibbonXFixedPhysicsSimulator.js +0 -3
- package/src/engine/intelligence/behavior/selector/WeightedElement.d.ts +6 -3
- package/src/engine/intelligence/behavior/selector/WeightedElement.d.ts.map +1 -1
- package/src/engine/intelligence/behavior/selector/WeightedElement.js +9 -12
- package/src/engine/intelligence/behavior/selector/WeightedRandomBehavior.d.ts +1 -1
- package/src/engine/intelligence/behavior/selector/WeightedRandomBehavior.d.ts.map +1 -1
- package/src/engine/intelligence/behavior/selector/WeightedRandomBehavior.js +20 -23
- package/src/engine/intelligence/mcts/StateNode.d.ts.map +1 -1
- package/src/engine/intelligence/mcts/StateNode.js +76 -102
- package/src/engine/logging/Logger.d.ts.map +1 -1
- package/src/engine/logging/Logger.js +7 -9
- package/src/engine/logging/LoggerBackend.d.ts.map +1 -1
- package/src/engine/logging/LoggerBackend.js +7 -7
- package/src/generation/grid/actions/ContinuousGridCellAction.d.ts.map +1 -1
- package/src/generation/grid/actions/ContinuousGridCellAction.js +6 -8
- package/src/generation/grid/actions/ContinuousGridCellActionSetTerrainHeight.d.ts.map +1 -1
- package/src/generation/grid/actions/ContinuousGridCellActionSetTerrainHeight.js +20 -22
- package/src/generation/grid/generation/GridTaskDensityMarkerDistribution.d.ts.map +1 -1
- package/src/generation/grid/generation/GridTaskDensityMarkerDistribution.js +23 -28
- package/src/generation/grid/generation/GridTaskExecuteRuleTimes.d.ts.map +1 -1
- package/src/generation/grid/generation/GridTaskExecuteRuleTimes.js +7 -10
- package/src/generation/grid/generation/GridTaskSequence.d.ts.map +1 -1
- package/src/generation/grid/generation/GridTaskSequence.js +2 -5
- package/src/generation/grid/generation/discrete/{GridTaskCellActionRuleSet.d.ts → GridTaskActionRuleSet.d.ts} +1 -1
- package/src/generation/grid/generation/discrete/GridTaskActionRuleSet.d.ts.map +1 -0
- package/src/generation/grid/generation/discrete/{GridTaskCellActionRuleSet.js → GridTaskActionRuleSet.js} +13 -16
- package/src/generation/grid/generation/discrete/GridTaskConnectRooms.d.ts.map +1 -1
- package/src/generation/grid/generation/discrete/GridTaskConnectRooms.js +51 -53
- package/src/generation/grid/generation/discrete/layer/GridTaskBuildSourceDistanceMap.d.ts.map +1 -1
- package/src/generation/grid/generation/discrete/layer/GridTaskBuildSourceDistanceMap.js +20 -23
- package/src/generation/grid/generation/grid/select/CellSupplierBestN.d.ts.map +1 -1
- package/src/generation/grid/generation/grid/select/CellSupplierBestN.js +38 -39
- package/src/generation/grid/generation/grid/select/CellSupplierPathUpHill.d.ts.map +1 -1
- package/src/generation/grid/generation/grid/select/CellSupplierPathUpHill.js +8 -11
- package/src/generation/grid/generation/road/PathEndPoint.d.ts.map +1 -1
- package/src/generation/grid/generation/road/PathEndPoint.js +8 -10
- package/src/generation/grid/generation/road/RoadConnection.d.ts.map +1 -1
- package/src/generation/grid/generation/road/RoadConnection.js +4 -5
- package/src/generation/markers/GridCellActionPlaceMarker.d.ts.map +1 -1
- package/src/generation/markers/GridCellActionPlaceMarker.js +7 -5
- package/src/view/common/LabelView.d.ts.map +1 -1
- package/src/view/common/LabelView.js +0 -3
- package/src/core/geom/3d/morton/Morton.d.ts.map +0 -1
- package/src/core/model/LinearValue.d.ts +0 -88
- package/src/core/model/LinearValue.d.ts.map +0 -1
- package/src/core/model/LinearValue.js +0 -140
- package/src/core/model/reactive/transform/ReactiveTypeInferrence.d.ts.map +0 -1
- package/src/core/model/reactive/transform/ReactiveTypeInferrence.js +0 -54
- package/src/engine/graphics/geometry/MikkT/m_getNumVerticesOfFace.d.ts +0 -9
- package/src/engine/graphics/geometry/MikkT/m_getNumVerticesOfFace.d.ts.map +0 -1
- package/src/engine/graphics/geometry/MikkT/m_getNumVerticesOfFace.js +0 -11
- package/src/engine/graphics/geometry/MikkT/m_getPosition.d.ts +0 -14
- package/src/engine/graphics/geometry/MikkT/m_getPosition.d.ts.map +0 -1
- package/src/engine/graphics/geometry/MikkT/m_getPosition.js +0 -20
- package/src/engine/graphics/geometry/MikkT/m_setTSpaceBasic.d.ts +0 -21
- package/src/engine/graphics/geometry/MikkT/m_setTSpaceBasic.d.ts.map +0 -1
- package/src/engine/graphics/geometry/MikkT/m_setTSpaceBasic.js +0 -22
- package/src/engine/graphics/texture/sampler/Sampler2D2Texture.d.ts +0 -10
- package/src/engine/graphics/texture/sampler/Sampler2D2Texture.d.ts.map +0 -1
- package/src/engine/graphics/texture/sampler/copy_Sampler2D_channel_data.d.ts.map +0 -1
- package/src/generation/grid/generation/discrete/GridTaskCellActionRuleSet.d.ts.map +0 -1
- /package/src/core/geom/3d/morton/{Morton.js → v3_morton_encode.js} +0 -0
package/build/meep.module.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
*
|
|
3
|
-
* @param {Array|Uint8Array} a
|
|
4
|
-
* @param {Array|Uint8Array} b
|
|
3
|
+
* @param {Array|Uint8Array|Float32Array} a
|
|
4
|
+
* @param {Array|Uint8Array|Float32Array} b
|
|
5
5
|
* @returns {boolean}
|
|
6
6
|
*/
|
|
7
7
|
function isArrayEqualStrict(a, b) {
|
|
@@ -2531,10 +2531,10 @@ let Vector3$1 = class Vector3 {
|
|
|
2531
2531
|
* @param {number} [squaredError]
|
|
2532
2532
|
* @return {boolean}
|
|
2533
2533
|
*/
|
|
2534
|
-
isNormalized(squaredError =
|
|
2534
|
+
isNormalized(squaredError = 1e-5) {
|
|
2535
2535
|
const lengthSq = this.lengthSqr();
|
|
2536
2536
|
|
|
2537
|
-
return (lengthSq
|
|
2537
|
+
return epsilonEquals(lengthSq, 1, squaredError);
|
|
2538
2538
|
}
|
|
2539
2539
|
|
|
2540
2540
|
/**
|
|
@@ -2584,10 +2584,6 @@ let Vector3$1 = class Vector3 {
|
|
|
2584
2584
|
return v3_length_sqr(this.x - x, this.y - y, this.z - z);
|
|
2585
2585
|
}
|
|
2586
2586
|
|
|
2587
|
-
distanceToSquared(other) {
|
|
2588
|
-
return v3_length_sqr(this.x - other.x, this.y - other.y, this.z - other.z);
|
|
2589
|
-
}
|
|
2590
|
-
|
|
2591
2587
|
/**
|
|
2592
2588
|
* Angle between two vectors (co-planar) in radians
|
|
2593
2589
|
* @param {Vector3} other
|
|
@@ -2847,31 +2843,6 @@ let Vector3$1 = class Vector3 {
|
|
|
2847
2843
|
this._projectVectors(x0, y0, z0, x1, y1, z1);
|
|
2848
2844
|
}
|
|
2849
2845
|
|
|
2850
|
-
/**
|
|
2851
|
-
* Compute orthogonal vectors given a normal
|
|
2852
|
-
* Orthogonal vectors are normalized vectors pointing at right angles away from the input normal and to one another
|
|
2853
|
-
* @see https://stackoverflow.com/questions/3684269/component-of-a-quaternion-rotation-around-an-axis
|
|
2854
|
-
* @param normal
|
|
2855
|
-
* @param orthonormal1
|
|
2856
|
-
* @param orthonormal2
|
|
2857
|
-
*/
|
|
2858
|
-
static findOrthonormals(normal, orthonormal1, orthonormal2) {
|
|
2859
|
-
throw new Error('Not Implemented');
|
|
2860
|
-
|
|
2861
|
-
// Vector3 w = Vector3.Transform(normal, OrthoX);
|
|
2862
|
-
// float dot = Vector3.Dot(normal, w);
|
|
2863
|
-
// if (Math.Abs(dot) > 0.6)
|
|
2864
|
-
// {
|
|
2865
|
-
// w = Vector3.Transform(normal, OrthoY);
|
|
2866
|
-
// }
|
|
2867
|
-
// w.Normalize();
|
|
2868
|
-
//
|
|
2869
|
-
// orthonormal1 = Vector3.Cross(normal, w);
|
|
2870
|
-
// orthonormal1.Normalize();
|
|
2871
|
-
// orthonormal2 = Vector3.Cross(normal, orthonormal1);
|
|
2872
|
-
// orthonormal2.Normalize();
|
|
2873
|
-
}
|
|
2874
|
-
|
|
2875
2846
|
/**
|
|
2876
2847
|
* Project first vector onto second one
|
|
2877
2848
|
* @param {number} x0
|
|
@@ -3004,24 +2975,6 @@ let Vector3$1 = class Vector3 {
|
|
|
3004
2975
|
this.set(x, y, z);
|
|
3005
2976
|
}
|
|
3006
2977
|
|
|
3007
|
-
/**
|
|
3008
|
-
*
|
|
3009
|
-
* @param {BinaryBuffer} buffer
|
|
3010
|
-
* @deprecated use dedicated method directly instead
|
|
3011
|
-
*/
|
|
3012
|
-
toBinaryBufferFloat32_EqualityEncoded(buffer) {
|
|
3013
|
-
throw new Error('deprecated, use v3_binary_equality_encode')
|
|
3014
|
-
}
|
|
3015
|
-
|
|
3016
|
-
/**
|
|
3017
|
-
* Uses an extra byte for a header. Only writes unique components. Useful for things like scale where all components usually have the same value
|
|
3018
|
-
* @param {BinaryBuffer} buffer
|
|
3019
|
-
* @deprecated use dedicated method directly instead
|
|
3020
|
-
*/
|
|
3021
|
-
fromBinaryBufferFloat32_EqualityEncoded(buffer) {
|
|
3022
|
-
throw new Error('deprecated, use v3_binary_equality_decode')
|
|
3023
|
-
}
|
|
3024
|
-
|
|
3025
2978
|
hash() {
|
|
3026
2979
|
const x = computeHashFloat(this.x);
|
|
3027
2980
|
const y = computeHashFloat(this.y);
|
|
@@ -3109,6 +3062,8 @@ let Vector3$1 = class Vector3 {
|
|
|
3109
3062
|
|
|
3110
3063
|
// Aliases
|
|
3111
3064
|
|
|
3065
|
+
Vector3$1.prototype.distanceToSquared = Vector3$1.prototype.distanceSqrTo;
|
|
3066
|
+
|
|
3112
3067
|
Vector3$1.prototype.lengthSq = Vector3$1.prototype.lengthSqr;
|
|
3113
3068
|
Vector3$1.prototype.fromArray = Vector3$1.prototype.readFromArray;
|
|
3114
3069
|
Vector3$1.prototype.toArray = Vector3$1.prototype.writeToArray;
|
|
@@ -4015,18 +3970,18 @@ let Quaternion$1 = class Quaternion {
|
|
|
4015
3970
|
if (uv_dot < -0.9999999) {
|
|
4016
3971
|
//to vector is opposite, produce a reversal quaternion
|
|
4017
3972
|
|
|
4018
|
-
|
|
3973
|
+
scratch_v3_a.crossVectors(Vector3$1.left, from);
|
|
4019
3974
|
|
|
4020
|
-
if (
|
|
4021
|
-
|
|
3975
|
+
if (scratch_v3_a.lengthSqr() < 0.00001) {
|
|
3976
|
+
scratch_v3_a.crossVectors(Vector3$1.up, from);
|
|
4022
3977
|
}
|
|
4023
3978
|
|
|
4024
|
-
|
|
3979
|
+
scratch_v3_a.normalize();
|
|
4025
3980
|
|
|
4026
3981
|
this.set(
|
|
4027
|
-
|
|
4028
|
-
|
|
4029
|
-
|
|
3982
|
+
scratch_v3_a.x,
|
|
3983
|
+
scratch_v3_a.y,
|
|
3984
|
+
scratch_v3_a.z,
|
|
4030
3985
|
0
|
|
4031
3986
|
);
|
|
4032
3987
|
|
|
@@ -4558,10 +4513,7 @@ Quaternion$1.prototype.toArray = Quaternion$1.prototype.writeToArray;
|
|
|
4558
4513
|
* @readonly
|
|
4559
4514
|
* @type {Quaternion}
|
|
4560
4515
|
*/
|
|
4561
|
-
Quaternion$1.identity = Object.freeze(new Quaternion$1(0, 0, 0, 1));
|
|
4562
|
-
|
|
4563
|
-
|
|
4564
|
-
const tempvec3 = new Vector3$1();
|
|
4516
|
+
Quaternion$1.identity = Object.freeze(new Quaternion$1(0, 0, 0, 1));
|
|
4565
4517
|
|
|
4566
4518
|
/**
|
|
4567
4519
|
* @readonly
|
|
@@ -49010,34 +48962,6 @@ function compute_typed_array_constructor_from_data_type(dt) {
|
|
|
49010
48962
|
return r;
|
|
49011
48963
|
}
|
|
49012
48964
|
|
|
49013
|
-
/**
|
|
49014
|
-
* Useful for computing hashes of large arrays, can pick a relevant stride and skip large chunks of memory while still capturing good amount of unique information from evenly-spaced areas of the array
|
|
49015
|
-
* @param {number[]|Uint32Array|Uint16Array|Uint8Array} array
|
|
49016
|
-
* @param {number} offset
|
|
49017
|
-
* @param {number} length
|
|
49018
|
-
* @param {number} stride
|
|
49019
|
-
* @return {number}
|
|
49020
|
-
*/
|
|
49021
|
-
function computeStridedIntegerArrayHash(
|
|
49022
|
-
array, offset, length, stride
|
|
49023
|
-
) {
|
|
49024
|
-
let hash = length;
|
|
49025
|
-
|
|
49026
|
-
for (let i = offset; i < length; i += stride) {
|
|
49027
|
-
const value = array[i] >>> 0; //force uint32
|
|
49028
|
-
|
|
49029
|
-
/**
|
|
49030
|
-
* Simple hashing scheme, multiplying existing hash by a prime and adding next value
|
|
49031
|
-
* (h<<5) - h === h*31
|
|
49032
|
-
* @type {number}
|
|
49033
|
-
*/
|
|
49034
|
-
hash = ((hash << 5) - hash) + value;
|
|
49035
|
-
}
|
|
49036
|
-
|
|
49037
|
-
// force uint32
|
|
49038
|
-
return hash >>> 0;
|
|
49039
|
-
}
|
|
49040
|
-
|
|
49041
48965
|
/**
|
|
49042
48966
|
*
|
|
49043
48967
|
* @param {*} array
|
|
@@ -49184,6 +49108,62 @@ function is_typed_array_equals(a, b) {
|
|
|
49184
49108
|
return isArrayEqualStrict(a_proxy, b_proxy);
|
|
49185
49109
|
}
|
|
49186
49110
|
|
|
49111
|
+
/**
|
|
49112
|
+
* Useful for computing hashes of large arrays, can pick a relevant stride and skip large chunks of memory while still capturing good amount of unique information from evenly-spaced areas of the array
|
|
49113
|
+
* @template T
|
|
49114
|
+
* @param {T[]|Uint32Array|Uint16Array|Uint8Array} array
|
|
49115
|
+
* @param {number} offset
|
|
49116
|
+
* @param {number} length
|
|
49117
|
+
* @param {number} stride
|
|
49118
|
+
* @param {function(T):number} elementHash
|
|
49119
|
+
* @param {*} [elementHashContext]
|
|
49120
|
+
* @return {number}
|
|
49121
|
+
*/
|
|
49122
|
+
function computeStridedArrayHash(
|
|
49123
|
+
array, offset, length, stride,
|
|
49124
|
+
elementHash, elementHashContext
|
|
49125
|
+
) {
|
|
49126
|
+
|
|
49127
|
+
let hash = length;
|
|
49128
|
+
|
|
49129
|
+
for (let i = offset; i < length; i += stride) {
|
|
49130
|
+
const value = elementHash.call(elementHashContext, array[i]);
|
|
49131
|
+
|
|
49132
|
+
/**
|
|
49133
|
+
* Simple hashing scheme, multiplying existing hash by a prime and adding next value
|
|
49134
|
+
* (h<<5) - h === h*31
|
|
49135
|
+
* @type {number}
|
|
49136
|
+
*/
|
|
49137
|
+
hash = ((hash << 5) - hash) + value;
|
|
49138
|
+
}
|
|
49139
|
+
|
|
49140
|
+
// force uint32
|
|
49141
|
+
return hash >>> 0;
|
|
49142
|
+
}
|
|
49143
|
+
|
|
49144
|
+
/**
|
|
49145
|
+
*
|
|
49146
|
+
* @param {Uint32Array} array
|
|
49147
|
+
* @param {number} offset
|
|
49148
|
+
* @param {number} length
|
|
49149
|
+
* @param {number} [sample_limit]
|
|
49150
|
+
* @returns {number}
|
|
49151
|
+
*/
|
|
49152
|
+
function sparse_typed_array_hash(array, offset, length, sample_limit = 31) {
|
|
49153
|
+
// limit hash evaluation to first 1k of the data to random memory access and keep CPU cache usage more coherent
|
|
49154
|
+
const hash_evaluation_length = min2(length, 1024);
|
|
49155
|
+
|
|
49156
|
+
// compute stride so that we don't have to iterate over the entire buffer, instead picking at most X(509) values to consider
|
|
49157
|
+
const stride = Math.max(1, Math.ceil(hash_evaluation_length / sample_limit));
|
|
49158
|
+
|
|
49159
|
+
// TODO implement fast dedicated float and int paths
|
|
49160
|
+
|
|
49161
|
+
return computeStridedArrayHash(
|
|
49162
|
+
array, 0, hash_evaluation_length, stride,
|
|
49163
|
+
computeHashFloat
|
|
49164
|
+
);
|
|
49165
|
+
}
|
|
49166
|
+
|
|
49187
49167
|
function typedArrayConstructorByInstance(a) {
|
|
49188
49168
|
if (a instanceof Int8Array) {
|
|
49189
49169
|
return Int8Array;
|
|
@@ -49258,19 +49238,19 @@ class Sampler2D {
|
|
|
49258
49238
|
|
|
49259
49239
|
/**
|
|
49260
49240
|
*
|
|
49261
|
-
* @type {
|
|
49241
|
+
* @type {number}
|
|
49262
49242
|
*/
|
|
49263
49243
|
this.width = width;
|
|
49264
49244
|
|
|
49265
49245
|
/**
|
|
49266
49246
|
*
|
|
49267
|
-
* @type {
|
|
49247
|
+
* @type {number}
|
|
49268
49248
|
*/
|
|
49269
49249
|
this.height = height;
|
|
49270
49250
|
|
|
49271
49251
|
/**
|
|
49272
49252
|
* Number of channels
|
|
49273
|
-
* @type {
|
|
49253
|
+
* @type {number}
|
|
49274
49254
|
*/
|
|
49275
49255
|
this.itemSize = itemSize;
|
|
49276
49256
|
|
|
@@ -49287,18 +49267,6 @@ class Sampler2D {
|
|
|
49287
49267
|
this.version = 0;
|
|
49288
49268
|
}
|
|
49289
49269
|
|
|
49290
|
-
/**
|
|
49291
|
-
*
|
|
49292
|
-
* @deprecated
|
|
49293
|
-
* @param {number} x
|
|
49294
|
-
* @param {number}y
|
|
49295
|
-
* @param {Vector1|Vector2|Vector3|Vector4} result
|
|
49296
|
-
* @returns {number}
|
|
49297
|
-
*/
|
|
49298
|
-
get(x, y, result) {
|
|
49299
|
-
throw new Error("Deprecated method, use sampleBilinear instead");
|
|
49300
|
-
}
|
|
49301
|
-
|
|
49302
49270
|
/**
|
|
49303
49271
|
*
|
|
49304
49272
|
* @param {number} u
|
|
@@ -49321,8 +49289,8 @@ class Sampler2D {
|
|
|
49321
49289
|
* @returns {number}
|
|
49322
49290
|
*/
|
|
49323
49291
|
sampleChannelCatmullRomUV(u, v, channel) {
|
|
49324
|
-
const x = u *
|
|
49325
|
-
const y = v *
|
|
49292
|
+
const x = u * this.width - 0.5;
|
|
49293
|
+
const y = v * this.height - 0.5;
|
|
49326
49294
|
|
|
49327
49295
|
return this.sampleChannelCatmullRom(x, y, channel);
|
|
49328
49296
|
}
|
|
@@ -49377,8 +49345,8 @@ class Sampler2D {
|
|
|
49377
49345
|
const texPos12_x = texPos1_x + offset12_x;
|
|
49378
49346
|
const texPos12_y = texPos1_y + offset12_y;
|
|
49379
49347
|
|
|
49380
|
-
|
|
49381
49348
|
let result = 0.0;
|
|
49349
|
+
|
|
49382
49350
|
result += this.sampleChannelBilinear(texPos0_x, texPos0_y, channel) * w0_x * w0_y;
|
|
49383
49351
|
result += this.sampleChannelBilinear(texPos12_x, texPos0_y, channel) * w12_x * w0_y;
|
|
49384
49352
|
result += this.sampleChannelBilinear(texPos3_x, texPos0_y, channel) * w3_x * w0_y;
|
|
@@ -49440,8 +49408,8 @@ class Sampler2D {
|
|
|
49440
49408
|
}
|
|
49441
49409
|
|
|
49442
49410
|
/**
|
|
49443
|
-
*
|
|
49444
|
-
* Bicubic-filtered sampling
|
|
49411
|
+
*
|
|
49412
|
+
* Bicubic-filtered sampling, note values can be negative due to the nature of the cubic curve
|
|
49445
49413
|
* @param {number} x
|
|
49446
49414
|
* @param {number} y
|
|
49447
49415
|
* @param {number} channel
|
|
@@ -49670,7 +49638,11 @@ class Sampler2D {
|
|
|
49670
49638
|
const x = Math.round(u * w - 0.5);
|
|
49671
49639
|
const y = Math.round(v * h - 0.5);
|
|
49672
49640
|
|
|
49673
|
-
this.read(
|
|
49641
|
+
this.read(
|
|
49642
|
+
clamp$1(x, 0, w - 1),
|
|
49643
|
+
clamp$1(y, 0, h - 1),
|
|
49644
|
+
result
|
|
49645
|
+
);
|
|
49674
49646
|
}
|
|
49675
49647
|
|
|
49676
49648
|
/**
|
|
@@ -49725,24 +49697,6 @@ class Sampler2D {
|
|
|
49725
49697
|
}
|
|
49726
49698
|
}
|
|
49727
49699
|
|
|
49728
|
-
/**
|
|
49729
|
-
*
|
|
49730
|
-
* @param {number} u
|
|
49731
|
-
* @param {number} v
|
|
49732
|
-
* @param {Vector4|Vector3|Vector2} [result]
|
|
49733
|
-
* @deprecated
|
|
49734
|
-
*/
|
|
49735
|
-
sample(u, v, result) {
|
|
49736
|
-
|
|
49737
|
-
const temp = [];
|
|
49738
|
-
|
|
49739
|
-
this.sampleBilinear(u * (this.width - 1), v * (this.height - 1), temp, 0);
|
|
49740
|
-
|
|
49741
|
-
result.readFromArray(temp);
|
|
49742
|
-
|
|
49743
|
-
return temp[0];
|
|
49744
|
-
}
|
|
49745
|
-
|
|
49746
49700
|
/**
|
|
49747
49701
|
*
|
|
49748
49702
|
* @param {number} x
|
|
@@ -49872,11 +49826,11 @@ class Sampler2D {
|
|
|
49872
49826
|
|
|
49873
49827
|
/**
|
|
49874
49828
|
*
|
|
49875
|
-
* @param {
|
|
49876
|
-
* @param {
|
|
49877
|
-
* @param {
|
|
49878
|
-
* @param {
|
|
49879
|
-
* @param {Array.<
|
|
49829
|
+
* @param {number} x
|
|
49830
|
+
* @param {number} y
|
|
49831
|
+
* @param {number} width
|
|
49832
|
+
* @param {number} height
|
|
49833
|
+
* @param {Array.<number>} value
|
|
49880
49834
|
*/
|
|
49881
49835
|
fill(x, y, width, height, value) {
|
|
49882
49836
|
|
|
@@ -50054,10 +50008,13 @@ class Sampler2D {
|
|
|
50054
50008
|
computeByteSize() {
|
|
50055
50009
|
let dataSize;
|
|
50056
50010
|
|
|
50057
|
-
|
|
50058
|
-
|
|
50011
|
+
const data = this.data;
|
|
50012
|
+
|
|
50013
|
+
if (Array.isArray(data)) {
|
|
50014
|
+
// Assume IEEE float 64
|
|
50015
|
+
dataSize = 8 * data.length;
|
|
50059
50016
|
} else {
|
|
50060
|
-
dataSize =
|
|
50017
|
+
dataSize = data.buffer.byteLength;
|
|
50061
50018
|
}
|
|
50062
50019
|
|
|
50063
50020
|
return dataSize + 280;
|
|
@@ -50069,6 +50026,11 @@ class Sampler2D {
|
|
|
50069
50026
|
* @return {boolean}
|
|
50070
50027
|
*/
|
|
50071
50028
|
equals(other) {
|
|
50029
|
+
if(this === other){
|
|
50030
|
+
// special case
|
|
50031
|
+
return true;
|
|
50032
|
+
}
|
|
50033
|
+
|
|
50072
50034
|
if (
|
|
50073
50035
|
this.width !== other.width
|
|
50074
50036
|
|| this.height !== other.height
|
|
@@ -50089,9 +50051,7 @@ class Sampler2D {
|
|
|
50089
50051
|
|
|
50090
50052
|
const length = this.data.length;
|
|
50091
50053
|
|
|
50092
|
-
|
|
50093
|
-
|
|
50094
|
-
hash ^= computeStridedIntegerArrayHash(this.data, 0, length, stride);
|
|
50054
|
+
hash ^= sparse_typed_array_hash(this.data, 0, length, 509);
|
|
50095
50055
|
|
|
50096
50056
|
return hash;
|
|
50097
50057
|
}
|
|
@@ -50627,6 +50587,34 @@ Vector1.zero = Object.freeze(new Vector1(0));
|
|
|
50627
50587
|
*/
|
|
50628
50588
|
Vector1.one = Object.freeze(new Vector1(1));
|
|
50629
50589
|
|
|
50590
|
+
/**
|
|
50591
|
+
* Useful for computing hashes of large arrays, can pick a relevant stride and skip large chunks of memory while still capturing good amount of unique information from evenly-spaced areas of the array
|
|
50592
|
+
* @param {number[]|Uint32Array|Uint16Array|Uint8Array} array
|
|
50593
|
+
* @param {number} offset
|
|
50594
|
+
* @param {number} length
|
|
50595
|
+
* @param {number} stride
|
|
50596
|
+
* @return {number}
|
|
50597
|
+
*/
|
|
50598
|
+
function computeStridedIntegerArrayHash(
|
|
50599
|
+
array, offset, length, stride
|
|
50600
|
+
) {
|
|
50601
|
+
let hash = length;
|
|
50602
|
+
|
|
50603
|
+
for (let i = offset; i < length; i += stride) {
|
|
50604
|
+
const value = array[i] >>> 0; //force uint32
|
|
50605
|
+
|
|
50606
|
+
/**
|
|
50607
|
+
* Simple hashing scheme, multiplying existing hash by a prime and adding next value
|
|
50608
|
+
* (h<<5) - h === h*31
|
|
50609
|
+
* @type {number}
|
|
50610
|
+
*/
|
|
50611
|
+
hash = ((hash << 5) - hash) + value;
|
|
50612
|
+
}
|
|
50613
|
+
|
|
50614
|
+
// force uint32
|
|
50615
|
+
return hash >>> 0;
|
|
50616
|
+
}
|
|
50617
|
+
|
|
50630
50618
|
/**
|
|
50631
50619
|
*
|
|
50632
50620
|
* @param {Uint8Array|number[]|ArrayLike<number>|IArguments} data
|
|
@@ -55302,29 +55290,6 @@ function v3_morton_encode_bounded(x, y, z, bounds) {
|
|
|
55302
55290
|
);
|
|
55303
55291
|
}
|
|
55304
55292
|
|
|
55305
|
-
/**
|
|
55306
|
-
* Returns highest value out of 3 supplied
|
|
55307
|
-
* @param {number} a
|
|
55308
|
-
* @param {number} b
|
|
55309
|
-
* @param {number} c
|
|
55310
|
-
* @returns {number}
|
|
55311
|
-
*/
|
|
55312
|
-
function max3(a, b, c) {
|
|
55313
|
-
|
|
55314
|
-
let v = a;
|
|
55315
|
-
|
|
55316
|
-
if (v < b) {
|
|
55317
|
-
v = b;
|
|
55318
|
-
}
|
|
55319
|
-
|
|
55320
|
-
if (v < c) {
|
|
55321
|
-
v = c;
|
|
55322
|
-
}
|
|
55323
|
-
|
|
55324
|
-
return v;
|
|
55325
|
-
|
|
55326
|
-
}
|
|
55327
|
-
|
|
55328
55293
|
/**
|
|
55329
55294
|
* @readonly
|
|
55330
55295
|
* @type {number}
|
|
@@ -55610,73 +55575,6 @@ class BinaryUint32BVH {
|
|
|
55610
55575
|
return result;
|
|
55611
55576
|
}
|
|
55612
55577
|
|
|
55613
|
-
/**
|
|
55614
|
-
*
|
|
55615
|
-
* @param {number} a address
|
|
55616
|
-
* @param {number} b address
|
|
55617
|
-
* @param {number} c address
|
|
55618
|
-
* @returns {number}
|
|
55619
|
-
* @private
|
|
55620
|
-
*/
|
|
55621
|
-
__compute_bounds_area_of_3_boxes(a, b, c) {
|
|
55622
|
-
const float32 = this.__data_float32;
|
|
55623
|
-
|
|
55624
|
-
const x0 = min3(float32[a + 0], float32[b + 0], float32[c + 0]);
|
|
55625
|
-
const y0 = min3(float32[a + 1], float32[b + 1], float32[c + 1]);
|
|
55626
|
-
const z0 = min3(float32[a + 2], float32[b + 2], float32[c + 2]);
|
|
55627
|
-
|
|
55628
|
-
const x1 = max3(float32[a + 3], float32[b + 3], float32[c + 3]);
|
|
55629
|
-
const y1 = max3(float32[a + 4], float32[b + 4], float32[c + 4]);
|
|
55630
|
-
const z1 = max3(float32[a + 5], float32[b + 5], float32[c + 5]);
|
|
55631
|
-
|
|
55632
|
-
return aabb3_compute_half_surface_area(x0, y0, z0, x1, y1, z1);
|
|
55633
|
-
}
|
|
55634
|
-
|
|
55635
|
-
/**
|
|
55636
|
-
*
|
|
55637
|
-
* @param {number} a
|
|
55638
|
-
* @param {number} b
|
|
55639
|
-
* @returns {number}
|
|
55640
|
-
* @private
|
|
55641
|
-
*/
|
|
55642
|
-
__fitness_function_should_swap_leaves_sah(a, b) {
|
|
55643
|
-
const a_0 = max2(a - 1, 0);
|
|
55644
|
-
const a_1 = min2(a + 1, this.__node_count_leaf - 1);
|
|
55645
|
-
|
|
55646
|
-
const leaf_block_offset = this.getLeafBlockAddress();
|
|
55647
|
-
|
|
55648
|
-
const a_c_address = a * BVH_LEAF_NODE_SIZE + leaf_block_offset;
|
|
55649
|
-
const a_0_address = a_0 * BVH_LEAF_NODE_SIZE + leaf_block_offset;
|
|
55650
|
-
const a_1_address = a_1 * BVH_LEAF_NODE_SIZE + leaf_block_offset;
|
|
55651
|
-
|
|
55652
|
-
|
|
55653
|
-
const b_0 = max2(b - 1, 0);
|
|
55654
|
-
const b_1 = min2(b + 1, this.__node_count_leaf - 1);
|
|
55655
|
-
|
|
55656
|
-
const b_c_address = b * BVH_LEAF_NODE_SIZE + leaf_block_offset;
|
|
55657
|
-
const b_0_address = b_0 * BVH_LEAF_NODE_SIZE + leaf_block_offset;
|
|
55658
|
-
const b_1_address = b_1 * BVH_LEAF_NODE_SIZE + leaf_block_offset;
|
|
55659
|
-
|
|
55660
|
-
|
|
55661
|
-
const current_area = this.__compute_bounds_area_of_3_boxes(a_0_address, a_c_address, a_1_address) + this.__compute_bounds_area_of_3_boxes(b_0_address, b_c_address, b_1_address);
|
|
55662
|
-
const swap_area = this.__compute_bounds_area_of_3_boxes(a_0_address, b_c_address, a_1_address) + this.__compute_bounds_area_of_3_boxes(b_0_address, a_c_address, b_1_address);
|
|
55663
|
-
|
|
55664
|
-
return current_area - swap_area;
|
|
55665
|
-
}
|
|
55666
|
-
|
|
55667
|
-
sort_bubble_sah() {
|
|
55668
|
-
const n = this.__node_count_leaf;
|
|
55669
|
-
|
|
55670
|
-
for (let i = 0; i < n; i++) {
|
|
55671
|
-
for (let j = i + 1; j < n; j++) {
|
|
55672
|
-
if (this.__fitness_function_should_swap_leaves_sah(i, j) > 0) {
|
|
55673
|
-
this.__swap_leaves(i, j);
|
|
55674
|
-
}
|
|
55675
|
-
}
|
|
55676
|
-
}
|
|
55677
|
-
}
|
|
55678
|
-
|
|
55679
|
-
|
|
55680
55578
|
/**
|
|
55681
55579
|
* Sort leaf nodes according to their morton codes
|
|
55682
55580
|
* @param {number[]} bounds
|
|
@@ -55690,15 +55588,17 @@ class BinaryUint32BVH {
|
|
|
55690
55588
|
return;
|
|
55691
55589
|
}
|
|
55692
55590
|
|
|
55693
|
-
|
|
55591
|
+
const stack_top = stack$9.pointer;
|
|
55592
|
+
|
|
55593
|
+
let stackPointer = stack_top;
|
|
55694
55594
|
let i, j;
|
|
55695
55595
|
|
|
55696
|
-
stack$9[
|
|
55697
|
-
stack$9[
|
|
55596
|
+
stack$9[stackPointer++] = 0; // first node
|
|
55597
|
+
stack$9[stackPointer++] = this.__node_count_leaf - 1; // last node
|
|
55698
55598
|
|
|
55699
55599
|
const data = this.__data_float32;
|
|
55700
55600
|
|
|
55701
|
-
while (stackPointer >
|
|
55601
|
+
while (stackPointer > stack_top) {
|
|
55702
55602
|
stackPointer -= 2;
|
|
55703
55603
|
|
|
55704
55604
|
const right = stack$9[stackPointer + 1];
|
|
@@ -55707,14 +55607,15 @@ class BinaryUint32BVH {
|
|
|
55707
55607
|
i = left;
|
|
55708
55608
|
j = right;
|
|
55709
55609
|
|
|
55710
|
-
const
|
|
55610
|
+
const pivot_index = (left + right) >> 1;
|
|
55711
55611
|
|
|
55712
|
-
const pivot_address =
|
|
55612
|
+
const pivot_address = pivot_index * BVH_LEAF_NODE_SIZE + leaf_block_address;
|
|
55713
55613
|
|
|
55714
55614
|
const pivot = build_morton(data, pivot_address, bounds);
|
|
55715
55615
|
|
|
55716
55616
|
/* partition */
|
|
55717
55617
|
while (i <= j) {
|
|
55618
|
+
|
|
55718
55619
|
while (build_morton(data, i * BVH_LEAF_NODE_SIZE + leaf_block_address, bounds) < pivot) {
|
|
55719
55620
|
i++;
|
|
55720
55621
|
}
|
|
@@ -55748,7 +55649,7 @@ class BinaryUint32BVH {
|
|
|
55748
55649
|
}
|
|
55749
55650
|
|
|
55750
55651
|
/**
|
|
55751
|
-
*
|
|
55652
|
+
* Does not update intermediate node bounds
|
|
55752
55653
|
* @param {number} i
|
|
55753
55654
|
* @param {number} j
|
|
55754
55655
|
* @private
|
|
@@ -56422,13 +56323,6 @@ class AABB3 {
|
|
|
56422
56323
|
|| (z + tolerance) < this.z0 || (z - tolerance) > this.z1);
|
|
56423
56324
|
}
|
|
56424
56325
|
|
|
56425
|
-
computeMortonCode() {
|
|
56426
|
-
const cx = (this.x0 + this.x1) >> 1;
|
|
56427
|
-
const cy = (this.y0 + this.y1) >> 1;
|
|
56428
|
-
const cz = (this.z0 + this.z1) >> 1;
|
|
56429
|
-
return mortonEncode_magicbits(cx, cy, cz);
|
|
56430
|
-
}
|
|
56431
|
-
|
|
56432
56326
|
/**
|
|
56433
56327
|
*
|
|
56434
56328
|
* @returns {number}
|
|
@@ -57739,7 +57633,7 @@ const m4_tmp = [];
|
|
|
57739
57633
|
class TerrainTile {
|
|
57740
57634
|
gridPosition = new Vector2();
|
|
57741
57635
|
scale = new Vector2(1, 1);
|
|
57742
|
-
size = new Vector2();
|
|
57636
|
+
size = new Vector2(1, 1);
|
|
57743
57637
|
position = new Vector2();
|
|
57744
57638
|
resolution = new ObservedInteger(1);
|
|
57745
57639
|
|
|
@@ -58209,6 +58103,7 @@ class TerrainTile {
|
|
|
58209
58103
|
|
|
58210
58104
|
geometry.boundingSphere = new Sphere(center, radius);
|
|
58211
58105
|
}
|
|
58106
|
+
|
|
58212
58107
|
//pull bounding box from geometry
|
|
58213
58108
|
|
|
58214
58109
|
bb = geometry.boundingBox;
|
|
@@ -58216,6 +58111,7 @@ class TerrainTile {
|
|
|
58216
58111
|
geometry.computeBoundingBox();
|
|
58217
58112
|
bb = geometry.boundingBox;
|
|
58218
58113
|
}
|
|
58114
|
+
|
|
58219
58115
|
}
|
|
58220
58116
|
|
|
58221
58117
|
const x0 = bb.min.x;
|
|
@@ -59113,11 +59009,11 @@ function writeSample2DDataToDataTexture(sampler, texture) {
|
|
|
59113
59009
|
}
|
|
59114
59010
|
} else if (sampler.itemSize === 3) {
|
|
59115
59011
|
if (texture.format !== RGBFormat$1) {
|
|
59116
|
-
throw new Error('itemSize is
|
|
59012
|
+
throw new Error('itemSize is 3 and texture.format is not RGBFormat');
|
|
59117
59013
|
}
|
|
59118
59014
|
} else if (sampler.itemSize === 4) {
|
|
59119
59015
|
if (texture.format !== RGBAFormat) {
|
|
59120
|
-
throw new Error('itemSize is
|
|
59016
|
+
throw new Error('itemSize is 4 and texture.format is not RGBAFormat');
|
|
59121
59017
|
}
|
|
59122
59018
|
} else {
|
|
59123
59019
|
throw new Error('Unsupported itemSize');
|
|
@@ -59635,7 +59531,10 @@ const AmbientOcclusionShader = function () {
|
|
|
59635
59531
|
* @returns {number}
|
|
59636
59532
|
*/
|
|
59637
59533
|
function gaussian$1(sigma, v) {
|
|
59638
|
-
|
|
59534
|
+
const v2 = v * v;
|
|
59535
|
+
const sigma2 = sigma * sigma;
|
|
59536
|
+
|
|
59537
|
+
return Math.exp(- v2 / (2 * sigma2));
|
|
59639
59538
|
}
|
|
59640
59539
|
|
|
59641
59540
|
/**
|
|
@@ -62617,7 +62516,7 @@ function saturated_value_by_constructor(ctor) {
|
|
|
62617
62516
|
* @param {Sampler2D} source
|
|
62618
62517
|
* @param {Sampler2D} destination
|
|
62619
62518
|
*/
|
|
62620
|
-
function
|
|
62519
|
+
function sampler2d_transfer_data(source, destination) {
|
|
62621
62520
|
if (source.width !== destination.width || source.height !== destination.height) {
|
|
62622
62521
|
throw new Error('Source and destination dimensions do not match');
|
|
62623
62522
|
}
|
|
@@ -62824,7 +62723,7 @@ class TerrainLayer {
|
|
|
62824
62723
|
|
|
62825
62724
|
const source = new Sampler2D(source_data, source_item_size, image.width, image.height);
|
|
62826
62725
|
|
|
62827
|
-
|
|
62726
|
+
sampler2d_transfer_data(source, this.diffuse);
|
|
62828
62727
|
|
|
62829
62728
|
this.onChanged.send0();
|
|
62830
62729
|
|
|
@@ -63643,11 +63542,16 @@ class WorkerProxy {
|
|
|
63643
63542
|
__id_counter = 0;
|
|
63644
63543
|
|
|
63645
63544
|
|
|
63545
|
+
/**
|
|
63546
|
+
*
|
|
63547
|
+
* @param {string} url
|
|
63548
|
+
* @param {Object} methods
|
|
63549
|
+
*/
|
|
63646
63550
|
constructor(url, methods) {
|
|
63647
63551
|
this.url = url;
|
|
63648
63552
|
this.methods = methods;
|
|
63649
63553
|
|
|
63650
|
-
this.__generateAPI(
|
|
63554
|
+
this.__generateAPI();
|
|
63651
63555
|
}
|
|
63652
63556
|
|
|
63653
63557
|
/**
|
|
@@ -63726,6 +63630,10 @@ class WorkerProxy {
|
|
|
63726
63630
|
|
|
63727
63631
|
}
|
|
63728
63632
|
|
|
63633
|
+
/**
|
|
63634
|
+
*
|
|
63635
|
+
* @private
|
|
63636
|
+
*/
|
|
63729
63637
|
__generateAPI() {
|
|
63730
63638
|
|
|
63731
63639
|
|
|
@@ -66106,6 +66014,29 @@ function read_three_planes_to_array(planes, array) {
|
|
|
66106
66014
|
}
|
|
66107
66015
|
}
|
|
66108
66016
|
|
|
66017
|
+
/**
|
|
66018
|
+
* Returns highest value out of 3 supplied
|
|
66019
|
+
* @param {number} a
|
|
66020
|
+
* @param {number} b
|
|
66021
|
+
* @param {number} c
|
|
66022
|
+
* @returns {number}
|
|
66023
|
+
*/
|
|
66024
|
+
function max3(a, b, c) {
|
|
66025
|
+
|
|
66026
|
+
let v = a;
|
|
66027
|
+
|
|
66028
|
+
if (v < b) {
|
|
66029
|
+
v = b;
|
|
66030
|
+
}
|
|
66031
|
+
|
|
66032
|
+
if (v < c) {
|
|
66033
|
+
v = c;
|
|
66034
|
+
}
|
|
66035
|
+
|
|
66036
|
+
return v;
|
|
66037
|
+
|
|
66038
|
+
}
|
|
66039
|
+
|
|
66109
66040
|
/**
|
|
66110
66041
|
*
|
|
66111
66042
|
* @param {number[]|Float32Array} output
|
|
@@ -85584,7 +85515,7 @@ class Deque {
|
|
|
85584
85515
|
|
|
85585
85516
|
/**
|
|
85586
85517
|
*
|
|
85587
|
-
* @param {
|
|
85518
|
+
* @param {T} e
|
|
85588
85519
|
* @returns {boolean}
|
|
85589
85520
|
*/
|
|
85590
85521
|
has(e) {
|
|
@@ -90948,6 +90879,10 @@ function configureThreeRenderer(webGLRenderer) {
|
|
|
90948
90879
|
class GraphicsEngine {
|
|
90949
90880
|
#debug = false;
|
|
90950
90881
|
|
|
90882
|
+
get isGraphicsEngine(){
|
|
90883
|
+
return true;
|
|
90884
|
+
}
|
|
90885
|
+
|
|
90951
90886
|
/**
|
|
90952
90887
|
*
|
|
90953
90888
|
* @param {Camera} camera
|
|
@@ -92426,13 +92361,7 @@ class TaskGroup {
|
|
|
92426
92361
|
* @returns {boolean}
|
|
92427
92362
|
*/
|
|
92428
92363
|
addChild(child) {
|
|
92429
|
-
|
|
92430
|
-
return false;
|
|
92431
|
-
}
|
|
92432
|
-
|
|
92433
|
-
this.children.push(child);
|
|
92434
|
-
|
|
92435
|
-
return true;
|
|
92364
|
+
return array_push_if_unique(this.children, child);
|
|
92436
92365
|
}
|
|
92437
92366
|
|
|
92438
92367
|
/**
|
|
@@ -92582,7 +92511,7 @@ class TaskGroup {
|
|
|
92582
92511
|
* @returns {Promise<unknown>}
|
|
92583
92512
|
*/
|
|
92584
92513
|
promise() {
|
|
92585
|
-
return
|
|
92514
|
+
return new Promise((resolve, reject) => this.join(resolve, reject));
|
|
92586
92515
|
}
|
|
92587
92516
|
}
|
|
92588
92517
|
|
|
@@ -92959,14 +92888,12 @@ const LogLevel = {
|
|
|
92959
92888
|
};
|
|
92960
92889
|
|
|
92961
92890
|
class Logger {
|
|
92962
|
-
|
|
92963
|
-
|
|
92964
|
-
|
|
92965
|
-
|
|
92966
|
-
|
|
92967
|
-
|
|
92968
|
-
this.backends = [];
|
|
92969
|
-
}
|
|
92891
|
+
/**
|
|
92892
|
+
*
|
|
92893
|
+
* @private
|
|
92894
|
+
* @type {LoggerBackend[]}
|
|
92895
|
+
*/
|
|
92896
|
+
backends = [];
|
|
92970
92897
|
|
|
92971
92898
|
/**
|
|
92972
92899
|
* Add a logging backend, this is a structure that handles incoming log messages.
|
|
@@ -97801,139 +97728,6 @@ class SimpleLifecycle {
|
|
|
97801
97728
|
}
|
|
97802
97729
|
}
|
|
97803
97730
|
|
|
97804
|
-
class LinearValue {
|
|
97805
|
-
|
|
97806
|
-
/**
|
|
97807
|
-
* @readonly
|
|
97808
|
-
* @type {Signal}
|
|
97809
|
-
*/
|
|
97810
|
-
onChanged = new Signal();
|
|
97811
|
-
|
|
97812
|
-
/**
|
|
97813
|
-
*
|
|
97814
|
-
* @param {number} [x = 0]
|
|
97815
|
-
* @param {number} [a = 0]
|
|
97816
|
-
* @param {number} [b = 1]
|
|
97817
|
-
* @constructor
|
|
97818
|
-
*/
|
|
97819
|
-
constructor(x = 0, a = 0, b = 1) {
|
|
97820
|
-
|
|
97821
|
-
/**
|
|
97822
|
-
*
|
|
97823
|
-
* @type {number}
|
|
97824
|
-
*/
|
|
97825
|
-
this.x = x;
|
|
97826
|
-
/**
|
|
97827
|
-
*
|
|
97828
|
-
* @type {number}
|
|
97829
|
-
*/
|
|
97830
|
-
this.a = a;
|
|
97831
|
-
/**
|
|
97832
|
-
*
|
|
97833
|
-
* @type {number}
|
|
97834
|
-
*/
|
|
97835
|
-
this.b = b;
|
|
97836
|
-
|
|
97837
|
-
}
|
|
97838
|
-
|
|
97839
|
-
/**
|
|
97840
|
-
*
|
|
97841
|
-
* @param {LinearValue} other
|
|
97842
|
-
* @returns {LinearValue}
|
|
97843
|
-
*/
|
|
97844
|
-
copy(other) {
|
|
97845
|
-
return this.set(other.x, other.a, other.b);
|
|
97846
|
-
}
|
|
97847
|
-
|
|
97848
|
-
/**
|
|
97849
|
-
*
|
|
97850
|
-
* @param {number} x
|
|
97851
|
-
* @param {number} a
|
|
97852
|
-
* @param {number} b
|
|
97853
|
-
* @returns {LinearValue}
|
|
97854
|
-
*/
|
|
97855
|
-
set(x, a, b) {
|
|
97856
|
-
this.x = x;
|
|
97857
|
-
this.a = a;
|
|
97858
|
-
this.b = b;
|
|
97859
|
-
|
|
97860
|
-
this.onChanged.dispatch(x, a, b);
|
|
97861
|
-
return this;
|
|
97862
|
-
}
|
|
97863
|
-
|
|
97864
|
-
/**
|
|
97865
|
-
*
|
|
97866
|
-
* @param v
|
|
97867
|
-
* @returns {LinearValue}
|
|
97868
|
-
*/
|
|
97869
|
-
addMultiplier(v) {
|
|
97870
|
-
this.b += v;
|
|
97871
|
-
|
|
97872
|
-
this.onChanged.dispatch(this.x, this.a, this.b);
|
|
97873
|
-
return this;
|
|
97874
|
-
}
|
|
97875
|
-
|
|
97876
|
-
/**
|
|
97877
|
-
*
|
|
97878
|
-
* @param v
|
|
97879
|
-
* @returns {LinearValue}
|
|
97880
|
-
*/
|
|
97881
|
-
subMultiplier(v) {
|
|
97882
|
-
return this.addMultiplier(-v);
|
|
97883
|
-
}
|
|
97884
|
-
|
|
97885
|
-
/**
|
|
97886
|
-
*
|
|
97887
|
-
* @param v
|
|
97888
|
-
* @returns {LinearValue}
|
|
97889
|
-
*/
|
|
97890
|
-
addConstant(v) {
|
|
97891
|
-
this.a += v;
|
|
97892
|
-
|
|
97893
|
-
this.onChanged.dispatch(this.x, this.a, this.b);
|
|
97894
|
-
return this;
|
|
97895
|
-
}
|
|
97896
|
-
|
|
97897
|
-
/**
|
|
97898
|
-
*
|
|
97899
|
-
* @param v
|
|
97900
|
-
* @returns {LinearValue}
|
|
97901
|
-
*/
|
|
97902
|
-
subConstant(v) {
|
|
97903
|
-
return this.addConstant(-v);
|
|
97904
|
-
}
|
|
97905
|
-
|
|
97906
|
-
/**
|
|
97907
|
-
*
|
|
97908
|
-
* @returns {number}
|
|
97909
|
-
*/
|
|
97910
|
-
getValue() {
|
|
97911
|
-
// y = b*x + a
|
|
97912
|
-
return this.x * this.b + this.a;
|
|
97913
|
-
}
|
|
97914
|
-
|
|
97915
|
-
/**
|
|
97916
|
-
*
|
|
97917
|
-
* @param {LinearValue} other
|
|
97918
|
-
* @returns {boolean}
|
|
97919
|
-
*/
|
|
97920
|
-
equals(other) {
|
|
97921
|
-
return this.x === other.x && this.a === other.a && this.b === other.b;
|
|
97922
|
-
}
|
|
97923
|
-
|
|
97924
|
-
toJSON() {
|
|
97925
|
-
return {
|
|
97926
|
-
x: this.x,
|
|
97927
|
-
a: this.a,
|
|
97928
|
-
b: this.b
|
|
97929
|
-
};
|
|
97930
|
-
}
|
|
97931
|
-
|
|
97932
|
-
fromJSON(json) {
|
|
97933
|
-
this.set(json.x, json.a, json.b);
|
|
97934
|
-
}
|
|
97935
|
-
}
|
|
97936
|
-
|
|
97937
97731
|
/**
|
|
97938
97732
|
*
|
|
97939
97733
|
* @param {string} string
|
|
@@ -98113,7 +97907,6 @@ function findProcessor(model) {
|
|
|
98113
97907
|
}
|
|
98114
97908
|
|
|
98115
97909
|
|
|
98116
|
-
|
|
98117
97910
|
class ValueProcessor {
|
|
98118
97911
|
/**
|
|
98119
97912
|
* @template Container, Value
|
|
@@ -98160,7 +97953,6 @@ const processors = [
|
|
|
98160
97953
|
p(isInstanceOf(ObservedBoolean), extractorGetValue, format),
|
|
98161
97954
|
p(isInstanceOf(ObservedValue), extractorGetValue, format),
|
|
98162
97955
|
p(isInstanceOf(ObservedString), extractorGetValue, format),
|
|
98163
|
-
p(isInstanceOf(LinearValue), extractorGetValue, formatNumber),
|
|
98164
97956
|
p(isInstanceOf(BoundedValue), extractBoundedValue, formatArray),
|
|
98165
97957
|
p(isInstanceOf(Stat), extractorGetValue, formatNumber),
|
|
98166
97958
|
p(isInstanceOf(Vector1), extractorGetValue, formatNumber),
|
|
@@ -115645,14 +115437,14 @@ class InputControllerSystem extends System {
|
|
|
115645
115437
|
}
|
|
115646
115438
|
|
|
115647
115439
|
class LoggerBackend {
|
|
115648
|
-
constructor() {
|
|
115649
115440
|
|
|
115650
|
-
|
|
115651
|
-
|
|
115652
|
-
|
|
115653
|
-
|
|
115654
|
-
|
|
115655
|
-
|
|
115441
|
+
|
|
115442
|
+
/**
|
|
115443
|
+
* @private
|
|
115444
|
+
* @type {LogLevel|number}
|
|
115445
|
+
*/
|
|
115446
|
+
level = LogLevel.Info;
|
|
115447
|
+
|
|
115656
115448
|
|
|
115657
115449
|
/**
|
|
115658
115450
|
*
|