@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.cjs
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
*
|
|
5
|
-
* @param {Array|Uint8Array} a
|
|
6
|
-
* @param {Array|Uint8Array} b
|
|
5
|
+
* @param {Array|Uint8Array|Float32Array} a
|
|
6
|
+
* @param {Array|Uint8Array|Float32Array} b
|
|
7
7
|
* @returns {boolean}
|
|
8
8
|
*/
|
|
9
9
|
function isArrayEqualStrict(a, b) {
|
|
@@ -2533,10 +2533,10 @@ let Vector3$1 = class Vector3 {
|
|
|
2533
2533
|
* @param {number} [squaredError]
|
|
2534
2534
|
* @return {boolean}
|
|
2535
2535
|
*/
|
|
2536
|
-
isNormalized(squaredError =
|
|
2536
|
+
isNormalized(squaredError = 1e-5) {
|
|
2537
2537
|
const lengthSq = this.lengthSqr();
|
|
2538
2538
|
|
|
2539
|
-
return (lengthSq
|
|
2539
|
+
return epsilonEquals(lengthSq, 1, squaredError);
|
|
2540
2540
|
}
|
|
2541
2541
|
|
|
2542
2542
|
/**
|
|
@@ -2586,10 +2586,6 @@ let Vector3$1 = class Vector3 {
|
|
|
2586
2586
|
return v3_length_sqr(this.x - x, this.y - y, this.z - z);
|
|
2587
2587
|
}
|
|
2588
2588
|
|
|
2589
|
-
distanceToSquared(other) {
|
|
2590
|
-
return v3_length_sqr(this.x - other.x, this.y - other.y, this.z - other.z);
|
|
2591
|
-
}
|
|
2592
|
-
|
|
2593
2589
|
/**
|
|
2594
2590
|
* Angle between two vectors (co-planar) in radians
|
|
2595
2591
|
* @param {Vector3} other
|
|
@@ -2849,31 +2845,6 @@ let Vector3$1 = class Vector3 {
|
|
|
2849
2845
|
this._projectVectors(x0, y0, z0, x1, y1, z1);
|
|
2850
2846
|
}
|
|
2851
2847
|
|
|
2852
|
-
/**
|
|
2853
|
-
* Compute orthogonal vectors given a normal
|
|
2854
|
-
* Orthogonal vectors are normalized vectors pointing at right angles away from the input normal and to one another
|
|
2855
|
-
* @see https://stackoverflow.com/questions/3684269/component-of-a-quaternion-rotation-around-an-axis
|
|
2856
|
-
* @param normal
|
|
2857
|
-
* @param orthonormal1
|
|
2858
|
-
* @param orthonormal2
|
|
2859
|
-
*/
|
|
2860
|
-
static findOrthonormals(normal, orthonormal1, orthonormal2) {
|
|
2861
|
-
throw new Error('Not Implemented');
|
|
2862
|
-
|
|
2863
|
-
// Vector3 w = Vector3.Transform(normal, OrthoX);
|
|
2864
|
-
// float dot = Vector3.Dot(normal, w);
|
|
2865
|
-
// if (Math.Abs(dot) > 0.6)
|
|
2866
|
-
// {
|
|
2867
|
-
// w = Vector3.Transform(normal, OrthoY);
|
|
2868
|
-
// }
|
|
2869
|
-
// w.Normalize();
|
|
2870
|
-
//
|
|
2871
|
-
// orthonormal1 = Vector3.Cross(normal, w);
|
|
2872
|
-
// orthonormal1.Normalize();
|
|
2873
|
-
// orthonormal2 = Vector3.Cross(normal, orthonormal1);
|
|
2874
|
-
// orthonormal2.Normalize();
|
|
2875
|
-
}
|
|
2876
|
-
|
|
2877
2848
|
/**
|
|
2878
2849
|
* Project first vector onto second one
|
|
2879
2850
|
* @param {number} x0
|
|
@@ -3006,24 +2977,6 @@ let Vector3$1 = class Vector3 {
|
|
|
3006
2977
|
this.set(x, y, z);
|
|
3007
2978
|
}
|
|
3008
2979
|
|
|
3009
|
-
/**
|
|
3010
|
-
*
|
|
3011
|
-
* @param {BinaryBuffer} buffer
|
|
3012
|
-
* @deprecated use dedicated method directly instead
|
|
3013
|
-
*/
|
|
3014
|
-
toBinaryBufferFloat32_EqualityEncoded(buffer) {
|
|
3015
|
-
throw new Error('deprecated, use v3_binary_equality_encode')
|
|
3016
|
-
}
|
|
3017
|
-
|
|
3018
|
-
/**
|
|
3019
|
-
* Uses an extra byte for a header. Only writes unique components. Useful for things like scale where all components usually have the same value
|
|
3020
|
-
* @param {BinaryBuffer} buffer
|
|
3021
|
-
* @deprecated use dedicated method directly instead
|
|
3022
|
-
*/
|
|
3023
|
-
fromBinaryBufferFloat32_EqualityEncoded(buffer) {
|
|
3024
|
-
throw new Error('deprecated, use v3_binary_equality_decode')
|
|
3025
|
-
}
|
|
3026
|
-
|
|
3027
2980
|
hash() {
|
|
3028
2981
|
const x = computeHashFloat(this.x);
|
|
3029
2982
|
const y = computeHashFloat(this.y);
|
|
@@ -3111,6 +3064,8 @@ let Vector3$1 = class Vector3 {
|
|
|
3111
3064
|
|
|
3112
3065
|
// Aliases
|
|
3113
3066
|
|
|
3067
|
+
Vector3$1.prototype.distanceToSquared = Vector3$1.prototype.distanceSqrTo;
|
|
3068
|
+
|
|
3114
3069
|
Vector3$1.prototype.lengthSq = Vector3$1.prototype.lengthSqr;
|
|
3115
3070
|
Vector3$1.prototype.fromArray = Vector3$1.prototype.readFromArray;
|
|
3116
3071
|
Vector3$1.prototype.toArray = Vector3$1.prototype.writeToArray;
|
|
@@ -4017,18 +3972,18 @@ let Quaternion$1 = class Quaternion {
|
|
|
4017
3972
|
if (uv_dot < -0.9999999) {
|
|
4018
3973
|
//to vector is opposite, produce a reversal quaternion
|
|
4019
3974
|
|
|
4020
|
-
|
|
3975
|
+
scratch_v3_a.crossVectors(Vector3$1.left, from);
|
|
4021
3976
|
|
|
4022
|
-
if (
|
|
4023
|
-
|
|
3977
|
+
if (scratch_v3_a.lengthSqr() < 0.00001) {
|
|
3978
|
+
scratch_v3_a.crossVectors(Vector3$1.up, from);
|
|
4024
3979
|
}
|
|
4025
3980
|
|
|
4026
|
-
|
|
3981
|
+
scratch_v3_a.normalize();
|
|
4027
3982
|
|
|
4028
3983
|
this.set(
|
|
4029
|
-
|
|
4030
|
-
|
|
4031
|
-
|
|
3984
|
+
scratch_v3_a.x,
|
|
3985
|
+
scratch_v3_a.y,
|
|
3986
|
+
scratch_v3_a.z,
|
|
4032
3987
|
0
|
|
4033
3988
|
);
|
|
4034
3989
|
|
|
@@ -4560,10 +4515,7 @@ Quaternion$1.prototype.toArray = Quaternion$1.prototype.writeToArray;
|
|
|
4560
4515
|
* @readonly
|
|
4561
4516
|
* @type {Quaternion}
|
|
4562
4517
|
*/
|
|
4563
|
-
Quaternion$1.identity = Object.freeze(new Quaternion$1(0, 0, 0, 1));
|
|
4564
|
-
|
|
4565
|
-
|
|
4566
|
-
const tempvec3 = new Vector3$1();
|
|
4518
|
+
Quaternion$1.identity = Object.freeze(new Quaternion$1(0, 0, 0, 1));
|
|
4567
4519
|
|
|
4568
4520
|
/**
|
|
4569
4521
|
* @readonly
|
|
@@ -49012,34 +48964,6 @@ function compute_typed_array_constructor_from_data_type(dt) {
|
|
|
49012
48964
|
return r;
|
|
49013
48965
|
}
|
|
49014
48966
|
|
|
49015
|
-
/**
|
|
49016
|
-
* 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
|
|
49017
|
-
* @param {number[]|Uint32Array|Uint16Array|Uint8Array} array
|
|
49018
|
-
* @param {number} offset
|
|
49019
|
-
* @param {number} length
|
|
49020
|
-
* @param {number} stride
|
|
49021
|
-
* @return {number}
|
|
49022
|
-
*/
|
|
49023
|
-
function computeStridedIntegerArrayHash(
|
|
49024
|
-
array, offset, length, stride
|
|
49025
|
-
) {
|
|
49026
|
-
let hash = length;
|
|
49027
|
-
|
|
49028
|
-
for (let i = offset; i < length; i += stride) {
|
|
49029
|
-
const value = array[i] >>> 0; //force uint32
|
|
49030
|
-
|
|
49031
|
-
/**
|
|
49032
|
-
* Simple hashing scheme, multiplying existing hash by a prime and adding next value
|
|
49033
|
-
* (h<<5) - h === h*31
|
|
49034
|
-
* @type {number}
|
|
49035
|
-
*/
|
|
49036
|
-
hash = ((hash << 5) - hash) + value;
|
|
49037
|
-
}
|
|
49038
|
-
|
|
49039
|
-
// force uint32
|
|
49040
|
-
return hash >>> 0;
|
|
49041
|
-
}
|
|
49042
|
-
|
|
49043
48967
|
/**
|
|
49044
48968
|
*
|
|
49045
48969
|
* @param {*} array
|
|
@@ -49186,6 +49110,62 @@ function is_typed_array_equals(a, b) {
|
|
|
49186
49110
|
return isArrayEqualStrict(a_proxy, b_proxy);
|
|
49187
49111
|
}
|
|
49188
49112
|
|
|
49113
|
+
/**
|
|
49114
|
+
* 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
|
|
49115
|
+
* @template T
|
|
49116
|
+
* @param {T[]|Uint32Array|Uint16Array|Uint8Array} array
|
|
49117
|
+
* @param {number} offset
|
|
49118
|
+
* @param {number} length
|
|
49119
|
+
* @param {number} stride
|
|
49120
|
+
* @param {function(T):number} elementHash
|
|
49121
|
+
* @param {*} [elementHashContext]
|
|
49122
|
+
* @return {number}
|
|
49123
|
+
*/
|
|
49124
|
+
function computeStridedArrayHash(
|
|
49125
|
+
array, offset, length, stride,
|
|
49126
|
+
elementHash, elementHashContext
|
|
49127
|
+
) {
|
|
49128
|
+
|
|
49129
|
+
let hash = length;
|
|
49130
|
+
|
|
49131
|
+
for (let i = offset; i < length; i += stride) {
|
|
49132
|
+
const value = elementHash.call(elementHashContext, array[i]);
|
|
49133
|
+
|
|
49134
|
+
/**
|
|
49135
|
+
* Simple hashing scheme, multiplying existing hash by a prime and adding next value
|
|
49136
|
+
* (h<<5) - h === h*31
|
|
49137
|
+
* @type {number}
|
|
49138
|
+
*/
|
|
49139
|
+
hash = ((hash << 5) - hash) + value;
|
|
49140
|
+
}
|
|
49141
|
+
|
|
49142
|
+
// force uint32
|
|
49143
|
+
return hash >>> 0;
|
|
49144
|
+
}
|
|
49145
|
+
|
|
49146
|
+
/**
|
|
49147
|
+
*
|
|
49148
|
+
* @param {Uint32Array} array
|
|
49149
|
+
* @param {number} offset
|
|
49150
|
+
* @param {number} length
|
|
49151
|
+
* @param {number} [sample_limit]
|
|
49152
|
+
* @returns {number}
|
|
49153
|
+
*/
|
|
49154
|
+
function sparse_typed_array_hash(array, offset, length, sample_limit = 31) {
|
|
49155
|
+
// limit hash evaluation to first 1k of the data to random memory access and keep CPU cache usage more coherent
|
|
49156
|
+
const hash_evaluation_length = min2(length, 1024);
|
|
49157
|
+
|
|
49158
|
+
// compute stride so that we don't have to iterate over the entire buffer, instead picking at most X(509) values to consider
|
|
49159
|
+
const stride = Math.max(1, Math.ceil(hash_evaluation_length / sample_limit));
|
|
49160
|
+
|
|
49161
|
+
// TODO implement fast dedicated float and int paths
|
|
49162
|
+
|
|
49163
|
+
return computeStridedArrayHash(
|
|
49164
|
+
array, 0, hash_evaluation_length, stride,
|
|
49165
|
+
computeHashFloat
|
|
49166
|
+
);
|
|
49167
|
+
}
|
|
49168
|
+
|
|
49189
49169
|
function typedArrayConstructorByInstance(a) {
|
|
49190
49170
|
if (a instanceof Int8Array) {
|
|
49191
49171
|
return Int8Array;
|
|
@@ -49260,19 +49240,19 @@ class Sampler2D {
|
|
|
49260
49240
|
|
|
49261
49241
|
/**
|
|
49262
49242
|
*
|
|
49263
|
-
* @type {
|
|
49243
|
+
* @type {number}
|
|
49264
49244
|
*/
|
|
49265
49245
|
this.width = width;
|
|
49266
49246
|
|
|
49267
49247
|
/**
|
|
49268
49248
|
*
|
|
49269
|
-
* @type {
|
|
49249
|
+
* @type {number}
|
|
49270
49250
|
*/
|
|
49271
49251
|
this.height = height;
|
|
49272
49252
|
|
|
49273
49253
|
/**
|
|
49274
49254
|
* Number of channels
|
|
49275
|
-
* @type {
|
|
49255
|
+
* @type {number}
|
|
49276
49256
|
*/
|
|
49277
49257
|
this.itemSize = itemSize;
|
|
49278
49258
|
|
|
@@ -49289,18 +49269,6 @@ class Sampler2D {
|
|
|
49289
49269
|
this.version = 0;
|
|
49290
49270
|
}
|
|
49291
49271
|
|
|
49292
|
-
/**
|
|
49293
|
-
*
|
|
49294
|
-
* @deprecated
|
|
49295
|
-
* @param {number} x
|
|
49296
|
-
* @param {number}y
|
|
49297
|
-
* @param {Vector1|Vector2|Vector3|Vector4} result
|
|
49298
|
-
* @returns {number}
|
|
49299
|
-
*/
|
|
49300
|
-
get(x, y, result) {
|
|
49301
|
-
throw new Error("Deprecated method, use sampleBilinear instead");
|
|
49302
|
-
}
|
|
49303
|
-
|
|
49304
49272
|
/**
|
|
49305
49273
|
*
|
|
49306
49274
|
* @param {number} u
|
|
@@ -49323,8 +49291,8 @@ class Sampler2D {
|
|
|
49323
49291
|
* @returns {number}
|
|
49324
49292
|
*/
|
|
49325
49293
|
sampleChannelCatmullRomUV(u, v, channel) {
|
|
49326
|
-
const x = u *
|
|
49327
|
-
const y = v *
|
|
49294
|
+
const x = u * this.width - 0.5;
|
|
49295
|
+
const y = v * this.height - 0.5;
|
|
49328
49296
|
|
|
49329
49297
|
return this.sampleChannelCatmullRom(x, y, channel);
|
|
49330
49298
|
}
|
|
@@ -49379,8 +49347,8 @@ class Sampler2D {
|
|
|
49379
49347
|
const texPos12_x = texPos1_x + offset12_x;
|
|
49380
49348
|
const texPos12_y = texPos1_y + offset12_y;
|
|
49381
49349
|
|
|
49382
|
-
|
|
49383
49350
|
let result = 0.0;
|
|
49351
|
+
|
|
49384
49352
|
result += this.sampleChannelBilinear(texPos0_x, texPos0_y, channel) * w0_x * w0_y;
|
|
49385
49353
|
result += this.sampleChannelBilinear(texPos12_x, texPos0_y, channel) * w12_x * w0_y;
|
|
49386
49354
|
result += this.sampleChannelBilinear(texPos3_x, texPos0_y, channel) * w3_x * w0_y;
|
|
@@ -49442,8 +49410,8 @@ class Sampler2D {
|
|
|
49442
49410
|
}
|
|
49443
49411
|
|
|
49444
49412
|
/**
|
|
49445
|
-
*
|
|
49446
|
-
* Bicubic-filtered sampling
|
|
49413
|
+
*
|
|
49414
|
+
* Bicubic-filtered sampling, note values can be negative due to the nature of the cubic curve
|
|
49447
49415
|
* @param {number} x
|
|
49448
49416
|
* @param {number} y
|
|
49449
49417
|
* @param {number} channel
|
|
@@ -49672,7 +49640,11 @@ class Sampler2D {
|
|
|
49672
49640
|
const x = Math.round(u * w - 0.5);
|
|
49673
49641
|
const y = Math.round(v * h - 0.5);
|
|
49674
49642
|
|
|
49675
|
-
this.read(
|
|
49643
|
+
this.read(
|
|
49644
|
+
clamp$1(x, 0, w - 1),
|
|
49645
|
+
clamp$1(y, 0, h - 1),
|
|
49646
|
+
result
|
|
49647
|
+
);
|
|
49676
49648
|
}
|
|
49677
49649
|
|
|
49678
49650
|
/**
|
|
@@ -49727,24 +49699,6 @@ class Sampler2D {
|
|
|
49727
49699
|
}
|
|
49728
49700
|
}
|
|
49729
49701
|
|
|
49730
|
-
/**
|
|
49731
|
-
*
|
|
49732
|
-
* @param {number} u
|
|
49733
|
-
* @param {number} v
|
|
49734
|
-
* @param {Vector4|Vector3|Vector2} [result]
|
|
49735
|
-
* @deprecated
|
|
49736
|
-
*/
|
|
49737
|
-
sample(u, v, result) {
|
|
49738
|
-
|
|
49739
|
-
const temp = [];
|
|
49740
|
-
|
|
49741
|
-
this.sampleBilinear(u * (this.width - 1), v * (this.height - 1), temp, 0);
|
|
49742
|
-
|
|
49743
|
-
result.readFromArray(temp);
|
|
49744
|
-
|
|
49745
|
-
return temp[0];
|
|
49746
|
-
}
|
|
49747
|
-
|
|
49748
49702
|
/**
|
|
49749
49703
|
*
|
|
49750
49704
|
* @param {number} x
|
|
@@ -49874,11 +49828,11 @@ class Sampler2D {
|
|
|
49874
49828
|
|
|
49875
49829
|
/**
|
|
49876
49830
|
*
|
|
49877
|
-
* @param {
|
|
49878
|
-
* @param {
|
|
49879
|
-
* @param {
|
|
49880
|
-
* @param {
|
|
49881
|
-
* @param {Array.<
|
|
49831
|
+
* @param {number} x
|
|
49832
|
+
* @param {number} y
|
|
49833
|
+
* @param {number} width
|
|
49834
|
+
* @param {number} height
|
|
49835
|
+
* @param {Array.<number>} value
|
|
49882
49836
|
*/
|
|
49883
49837
|
fill(x, y, width, height, value) {
|
|
49884
49838
|
|
|
@@ -50056,10 +50010,13 @@ class Sampler2D {
|
|
|
50056
50010
|
computeByteSize() {
|
|
50057
50011
|
let dataSize;
|
|
50058
50012
|
|
|
50059
|
-
|
|
50060
|
-
|
|
50013
|
+
const data = this.data;
|
|
50014
|
+
|
|
50015
|
+
if (Array.isArray(data)) {
|
|
50016
|
+
// Assume IEEE float 64
|
|
50017
|
+
dataSize = 8 * data.length;
|
|
50061
50018
|
} else {
|
|
50062
|
-
dataSize =
|
|
50019
|
+
dataSize = data.buffer.byteLength;
|
|
50063
50020
|
}
|
|
50064
50021
|
|
|
50065
50022
|
return dataSize + 280;
|
|
@@ -50071,6 +50028,11 @@ class Sampler2D {
|
|
|
50071
50028
|
* @return {boolean}
|
|
50072
50029
|
*/
|
|
50073
50030
|
equals(other) {
|
|
50031
|
+
if(this === other){
|
|
50032
|
+
// special case
|
|
50033
|
+
return true;
|
|
50034
|
+
}
|
|
50035
|
+
|
|
50074
50036
|
if (
|
|
50075
50037
|
this.width !== other.width
|
|
50076
50038
|
|| this.height !== other.height
|
|
@@ -50091,9 +50053,7 @@ class Sampler2D {
|
|
|
50091
50053
|
|
|
50092
50054
|
const length = this.data.length;
|
|
50093
50055
|
|
|
50094
|
-
|
|
50095
|
-
|
|
50096
|
-
hash ^= computeStridedIntegerArrayHash(this.data, 0, length, stride);
|
|
50056
|
+
hash ^= sparse_typed_array_hash(this.data, 0, length, 509);
|
|
50097
50057
|
|
|
50098
50058
|
return hash;
|
|
50099
50059
|
}
|
|
@@ -50629,6 +50589,34 @@ Vector1.zero = Object.freeze(new Vector1(0));
|
|
|
50629
50589
|
*/
|
|
50630
50590
|
Vector1.one = Object.freeze(new Vector1(1));
|
|
50631
50591
|
|
|
50592
|
+
/**
|
|
50593
|
+
* 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
|
|
50594
|
+
* @param {number[]|Uint32Array|Uint16Array|Uint8Array} array
|
|
50595
|
+
* @param {number} offset
|
|
50596
|
+
* @param {number} length
|
|
50597
|
+
* @param {number} stride
|
|
50598
|
+
* @return {number}
|
|
50599
|
+
*/
|
|
50600
|
+
function computeStridedIntegerArrayHash(
|
|
50601
|
+
array, offset, length, stride
|
|
50602
|
+
) {
|
|
50603
|
+
let hash = length;
|
|
50604
|
+
|
|
50605
|
+
for (let i = offset; i < length; i += stride) {
|
|
50606
|
+
const value = array[i] >>> 0; //force uint32
|
|
50607
|
+
|
|
50608
|
+
/**
|
|
50609
|
+
* Simple hashing scheme, multiplying existing hash by a prime and adding next value
|
|
50610
|
+
* (h<<5) - h === h*31
|
|
50611
|
+
* @type {number}
|
|
50612
|
+
*/
|
|
50613
|
+
hash = ((hash << 5) - hash) + value;
|
|
50614
|
+
}
|
|
50615
|
+
|
|
50616
|
+
// force uint32
|
|
50617
|
+
return hash >>> 0;
|
|
50618
|
+
}
|
|
50619
|
+
|
|
50632
50620
|
/**
|
|
50633
50621
|
*
|
|
50634
50622
|
* @param {Uint8Array|number[]|ArrayLike<number>|IArguments} data
|
|
@@ -55304,29 +55292,6 @@ function v3_morton_encode_bounded(x, y, z, bounds) {
|
|
|
55304
55292
|
);
|
|
55305
55293
|
}
|
|
55306
55294
|
|
|
55307
|
-
/**
|
|
55308
|
-
* Returns highest value out of 3 supplied
|
|
55309
|
-
* @param {number} a
|
|
55310
|
-
* @param {number} b
|
|
55311
|
-
* @param {number} c
|
|
55312
|
-
* @returns {number}
|
|
55313
|
-
*/
|
|
55314
|
-
function max3(a, b, c) {
|
|
55315
|
-
|
|
55316
|
-
let v = a;
|
|
55317
|
-
|
|
55318
|
-
if (v < b) {
|
|
55319
|
-
v = b;
|
|
55320
|
-
}
|
|
55321
|
-
|
|
55322
|
-
if (v < c) {
|
|
55323
|
-
v = c;
|
|
55324
|
-
}
|
|
55325
|
-
|
|
55326
|
-
return v;
|
|
55327
|
-
|
|
55328
|
-
}
|
|
55329
|
-
|
|
55330
55295
|
/**
|
|
55331
55296
|
* @readonly
|
|
55332
55297
|
* @type {number}
|
|
@@ -55612,73 +55577,6 @@ class BinaryUint32BVH {
|
|
|
55612
55577
|
return result;
|
|
55613
55578
|
}
|
|
55614
55579
|
|
|
55615
|
-
/**
|
|
55616
|
-
*
|
|
55617
|
-
* @param {number} a address
|
|
55618
|
-
* @param {number} b address
|
|
55619
|
-
* @param {number} c address
|
|
55620
|
-
* @returns {number}
|
|
55621
|
-
* @private
|
|
55622
|
-
*/
|
|
55623
|
-
__compute_bounds_area_of_3_boxes(a, b, c) {
|
|
55624
|
-
const float32 = this.__data_float32;
|
|
55625
|
-
|
|
55626
|
-
const x0 = min3(float32[a + 0], float32[b + 0], float32[c + 0]);
|
|
55627
|
-
const y0 = min3(float32[a + 1], float32[b + 1], float32[c + 1]);
|
|
55628
|
-
const z0 = min3(float32[a + 2], float32[b + 2], float32[c + 2]);
|
|
55629
|
-
|
|
55630
|
-
const x1 = max3(float32[a + 3], float32[b + 3], float32[c + 3]);
|
|
55631
|
-
const y1 = max3(float32[a + 4], float32[b + 4], float32[c + 4]);
|
|
55632
|
-
const z1 = max3(float32[a + 5], float32[b + 5], float32[c + 5]);
|
|
55633
|
-
|
|
55634
|
-
return aabb3_compute_half_surface_area(x0, y0, z0, x1, y1, z1);
|
|
55635
|
-
}
|
|
55636
|
-
|
|
55637
|
-
/**
|
|
55638
|
-
*
|
|
55639
|
-
* @param {number} a
|
|
55640
|
-
* @param {number} b
|
|
55641
|
-
* @returns {number}
|
|
55642
|
-
* @private
|
|
55643
|
-
*/
|
|
55644
|
-
__fitness_function_should_swap_leaves_sah(a, b) {
|
|
55645
|
-
const a_0 = max2(a - 1, 0);
|
|
55646
|
-
const a_1 = min2(a + 1, this.__node_count_leaf - 1);
|
|
55647
|
-
|
|
55648
|
-
const leaf_block_offset = this.getLeafBlockAddress();
|
|
55649
|
-
|
|
55650
|
-
const a_c_address = a * BVH_LEAF_NODE_SIZE + leaf_block_offset;
|
|
55651
|
-
const a_0_address = a_0 * BVH_LEAF_NODE_SIZE + leaf_block_offset;
|
|
55652
|
-
const a_1_address = a_1 * BVH_LEAF_NODE_SIZE + leaf_block_offset;
|
|
55653
|
-
|
|
55654
|
-
|
|
55655
|
-
const b_0 = max2(b - 1, 0);
|
|
55656
|
-
const b_1 = min2(b + 1, this.__node_count_leaf - 1);
|
|
55657
|
-
|
|
55658
|
-
const b_c_address = b * BVH_LEAF_NODE_SIZE + leaf_block_offset;
|
|
55659
|
-
const b_0_address = b_0 * BVH_LEAF_NODE_SIZE + leaf_block_offset;
|
|
55660
|
-
const b_1_address = b_1 * BVH_LEAF_NODE_SIZE + leaf_block_offset;
|
|
55661
|
-
|
|
55662
|
-
|
|
55663
|
-
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);
|
|
55664
|
-
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);
|
|
55665
|
-
|
|
55666
|
-
return current_area - swap_area;
|
|
55667
|
-
}
|
|
55668
|
-
|
|
55669
|
-
sort_bubble_sah() {
|
|
55670
|
-
const n = this.__node_count_leaf;
|
|
55671
|
-
|
|
55672
|
-
for (let i = 0; i < n; i++) {
|
|
55673
|
-
for (let j = i + 1; j < n; j++) {
|
|
55674
|
-
if (this.__fitness_function_should_swap_leaves_sah(i, j) > 0) {
|
|
55675
|
-
this.__swap_leaves(i, j);
|
|
55676
|
-
}
|
|
55677
|
-
}
|
|
55678
|
-
}
|
|
55679
|
-
}
|
|
55680
|
-
|
|
55681
|
-
|
|
55682
55580
|
/**
|
|
55683
55581
|
* Sort leaf nodes according to their morton codes
|
|
55684
55582
|
* @param {number[]} bounds
|
|
@@ -55692,15 +55590,17 @@ class BinaryUint32BVH {
|
|
|
55692
55590
|
return;
|
|
55693
55591
|
}
|
|
55694
55592
|
|
|
55695
|
-
|
|
55593
|
+
const stack_top = stack$9.pointer;
|
|
55594
|
+
|
|
55595
|
+
let stackPointer = stack_top;
|
|
55696
55596
|
let i, j;
|
|
55697
55597
|
|
|
55698
|
-
stack$9[
|
|
55699
|
-
stack$9[
|
|
55598
|
+
stack$9[stackPointer++] = 0; // first node
|
|
55599
|
+
stack$9[stackPointer++] = this.__node_count_leaf - 1; // last node
|
|
55700
55600
|
|
|
55701
55601
|
const data = this.__data_float32;
|
|
55702
55602
|
|
|
55703
|
-
while (stackPointer >
|
|
55603
|
+
while (stackPointer > stack_top) {
|
|
55704
55604
|
stackPointer -= 2;
|
|
55705
55605
|
|
|
55706
55606
|
const right = stack$9[stackPointer + 1];
|
|
@@ -55709,14 +55609,15 @@ class BinaryUint32BVH {
|
|
|
55709
55609
|
i = left;
|
|
55710
55610
|
j = right;
|
|
55711
55611
|
|
|
55712
|
-
const
|
|
55612
|
+
const pivot_index = (left + right) >> 1;
|
|
55713
55613
|
|
|
55714
|
-
const pivot_address =
|
|
55614
|
+
const pivot_address = pivot_index * BVH_LEAF_NODE_SIZE + leaf_block_address;
|
|
55715
55615
|
|
|
55716
55616
|
const pivot = build_morton(data, pivot_address, bounds);
|
|
55717
55617
|
|
|
55718
55618
|
/* partition */
|
|
55719
55619
|
while (i <= j) {
|
|
55620
|
+
|
|
55720
55621
|
while (build_morton(data, i * BVH_LEAF_NODE_SIZE + leaf_block_address, bounds) < pivot) {
|
|
55721
55622
|
i++;
|
|
55722
55623
|
}
|
|
@@ -55750,7 +55651,7 @@ class BinaryUint32BVH {
|
|
|
55750
55651
|
}
|
|
55751
55652
|
|
|
55752
55653
|
/**
|
|
55753
|
-
*
|
|
55654
|
+
* Does not update intermediate node bounds
|
|
55754
55655
|
* @param {number} i
|
|
55755
55656
|
* @param {number} j
|
|
55756
55657
|
* @private
|
|
@@ -56424,13 +56325,6 @@ class AABB3 {
|
|
|
56424
56325
|
|| (z + tolerance) < this.z0 || (z - tolerance) > this.z1);
|
|
56425
56326
|
}
|
|
56426
56327
|
|
|
56427
|
-
computeMortonCode() {
|
|
56428
|
-
const cx = (this.x0 + this.x1) >> 1;
|
|
56429
|
-
const cy = (this.y0 + this.y1) >> 1;
|
|
56430
|
-
const cz = (this.z0 + this.z1) >> 1;
|
|
56431
|
-
return mortonEncode_magicbits(cx, cy, cz);
|
|
56432
|
-
}
|
|
56433
|
-
|
|
56434
56328
|
/**
|
|
56435
56329
|
*
|
|
56436
56330
|
* @returns {number}
|
|
@@ -57741,7 +57635,7 @@ const m4_tmp = [];
|
|
|
57741
57635
|
class TerrainTile {
|
|
57742
57636
|
gridPosition = new Vector2();
|
|
57743
57637
|
scale = new Vector2(1, 1);
|
|
57744
|
-
size = new Vector2();
|
|
57638
|
+
size = new Vector2(1, 1);
|
|
57745
57639
|
position = new Vector2();
|
|
57746
57640
|
resolution = new ObservedInteger(1);
|
|
57747
57641
|
|
|
@@ -58211,6 +58105,7 @@ class TerrainTile {
|
|
|
58211
58105
|
|
|
58212
58106
|
geometry.boundingSphere = new Sphere(center, radius);
|
|
58213
58107
|
}
|
|
58108
|
+
|
|
58214
58109
|
//pull bounding box from geometry
|
|
58215
58110
|
|
|
58216
58111
|
bb = geometry.boundingBox;
|
|
@@ -58218,6 +58113,7 @@ class TerrainTile {
|
|
|
58218
58113
|
geometry.computeBoundingBox();
|
|
58219
58114
|
bb = geometry.boundingBox;
|
|
58220
58115
|
}
|
|
58116
|
+
|
|
58221
58117
|
}
|
|
58222
58118
|
|
|
58223
58119
|
const x0 = bb.min.x;
|
|
@@ -59115,11 +59011,11 @@ function writeSample2DDataToDataTexture(sampler, texture) {
|
|
|
59115
59011
|
}
|
|
59116
59012
|
} else if (sampler.itemSize === 3) {
|
|
59117
59013
|
if (texture.format !== RGBFormat$1) {
|
|
59118
|
-
throw new Error('itemSize is
|
|
59014
|
+
throw new Error('itemSize is 3 and texture.format is not RGBFormat');
|
|
59119
59015
|
}
|
|
59120
59016
|
} else if (sampler.itemSize === 4) {
|
|
59121
59017
|
if (texture.format !== RGBAFormat) {
|
|
59122
|
-
throw new Error('itemSize is
|
|
59018
|
+
throw new Error('itemSize is 4 and texture.format is not RGBAFormat');
|
|
59123
59019
|
}
|
|
59124
59020
|
} else {
|
|
59125
59021
|
throw new Error('Unsupported itemSize');
|
|
@@ -59637,7 +59533,10 @@ const AmbientOcclusionShader = function () {
|
|
|
59637
59533
|
* @returns {number}
|
|
59638
59534
|
*/
|
|
59639
59535
|
function gaussian$1(sigma, v) {
|
|
59640
|
-
|
|
59536
|
+
const v2 = v * v;
|
|
59537
|
+
const sigma2 = sigma * sigma;
|
|
59538
|
+
|
|
59539
|
+
return Math.exp(- v2 / (2 * sigma2));
|
|
59641
59540
|
}
|
|
59642
59541
|
|
|
59643
59542
|
/**
|
|
@@ -62619,7 +62518,7 @@ function saturated_value_by_constructor(ctor) {
|
|
|
62619
62518
|
* @param {Sampler2D} source
|
|
62620
62519
|
* @param {Sampler2D} destination
|
|
62621
62520
|
*/
|
|
62622
|
-
function
|
|
62521
|
+
function sampler2d_transfer_data(source, destination) {
|
|
62623
62522
|
if (source.width !== destination.width || source.height !== destination.height) {
|
|
62624
62523
|
throw new Error('Source and destination dimensions do not match');
|
|
62625
62524
|
}
|
|
@@ -62826,7 +62725,7 @@ class TerrainLayer {
|
|
|
62826
62725
|
|
|
62827
62726
|
const source = new Sampler2D(source_data, source_item_size, image.width, image.height);
|
|
62828
62727
|
|
|
62829
|
-
|
|
62728
|
+
sampler2d_transfer_data(source, this.diffuse);
|
|
62830
62729
|
|
|
62831
62730
|
this.onChanged.send0();
|
|
62832
62731
|
|
|
@@ -63645,11 +63544,16 @@ class WorkerProxy {
|
|
|
63645
63544
|
__id_counter = 0;
|
|
63646
63545
|
|
|
63647
63546
|
|
|
63547
|
+
/**
|
|
63548
|
+
*
|
|
63549
|
+
* @param {string} url
|
|
63550
|
+
* @param {Object} methods
|
|
63551
|
+
*/
|
|
63648
63552
|
constructor(url, methods) {
|
|
63649
63553
|
this.url = url;
|
|
63650
63554
|
this.methods = methods;
|
|
63651
63555
|
|
|
63652
|
-
this.__generateAPI(
|
|
63556
|
+
this.__generateAPI();
|
|
63653
63557
|
}
|
|
63654
63558
|
|
|
63655
63559
|
/**
|
|
@@ -63728,6 +63632,10 @@ class WorkerProxy {
|
|
|
63728
63632
|
|
|
63729
63633
|
}
|
|
63730
63634
|
|
|
63635
|
+
/**
|
|
63636
|
+
*
|
|
63637
|
+
* @private
|
|
63638
|
+
*/
|
|
63731
63639
|
__generateAPI() {
|
|
63732
63640
|
|
|
63733
63641
|
|
|
@@ -66108,6 +66016,29 @@ function read_three_planes_to_array(planes, array) {
|
|
|
66108
66016
|
}
|
|
66109
66017
|
}
|
|
66110
66018
|
|
|
66019
|
+
/**
|
|
66020
|
+
* Returns highest value out of 3 supplied
|
|
66021
|
+
* @param {number} a
|
|
66022
|
+
* @param {number} b
|
|
66023
|
+
* @param {number} c
|
|
66024
|
+
* @returns {number}
|
|
66025
|
+
*/
|
|
66026
|
+
function max3(a, b, c) {
|
|
66027
|
+
|
|
66028
|
+
let v = a;
|
|
66029
|
+
|
|
66030
|
+
if (v < b) {
|
|
66031
|
+
v = b;
|
|
66032
|
+
}
|
|
66033
|
+
|
|
66034
|
+
if (v < c) {
|
|
66035
|
+
v = c;
|
|
66036
|
+
}
|
|
66037
|
+
|
|
66038
|
+
return v;
|
|
66039
|
+
|
|
66040
|
+
}
|
|
66041
|
+
|
|
66111
66042
|
/**
|
|
66112
66043
|
*
|
|
66113
66044
|
* @param {number[]|Float32Array} output
|
|
@@ -85586,7 +85517,7 @@ class Deque {
|
|
|
85586
85517
|
|
|
85587
85518
|
/**
|
|
85588
85519
|
*
|
|
85589
|
-
* @param {
|
|
85520
|
+
* @param {T} e
|
|
85590
85521
|
* @returns {boolean}
|
|
85591
85522
|
*/
|
|
85592
85523
|
has(e) {
|
|
@@ -90950,6 +90881,10 @@ function configureThreeRenderer(webGLRenderer) {
|
|
|
90950
90881
|
class GraphicsEngine {
|
|
90951
90882
|
#debug = false;
|
|
90952
90883
|
|
|
90884
|
+
get isGraphicsEngine(){
|
|
90885
|
+
return true;
|
|
90886
|
+
}
|
|
90887
|
+
|
|
90953
90888
|
/**
|
|
90954
90889
|
*
|
|
90955
90890
|
* @param {Camera} camera
|
|
@@ -92428,13 +92363,7 @@ class TaskGroup {
|
|
|
92428
92363
|
* @returns {boolean}
|
|
92429
92364
|
*/
|
|
92430
92365
|
addChild(child) {
|
|
92431
|
-
|
|
92432
|
-
return false;
|
|
92433
|
-
}
|
|
92434
|
-
|
|
92435
|
-
this.children.push(child);
|
|
92436
|
-
|
|
92437
|
-
return true;
|
|
92366
|
+
return array_push_if_unique(this.children, child);
|
|
92438
92367
|
}
|
|
92439
92368
|
|
|
92440
92369
|
/**
|
|
@@ -92584,7 +92513,7 @@ class TaskGroup {
|
|
|
92584
92513
|
* @returns {Promise<unknown>}
|
|
92585
92514
|
*/
|
|
92586
92515
|
promise() {
|
|
92587
|
-
return
|
|
92516
|
+
return new Promise((resolve, reject) => this.join(resolve, reject));
|
|
92588
92517
|
}
|
|
92589
92518
|
}
|
|
92590
92519
|
|
|
@@ -92961,14 +92890,12 @@ const LogLevel = {
|
|
|
92961
92890
|
};
|
|
92962
92891
|
|
|
92963
92892
|
class Logger {
|
|
92964
|
-
|
|
92965
|
-
|
|
92966
|
-
|
|
92967
|
-
|
|
92968
|
-
|
|
92969
|
-
|
|
92970
|
-
this.backends = [];
|
|
92971
|
-
}
|
|
92893
|
+
/**
|
|
92894
|
+
*
|
|
92895
|
+
* @private
|
|
92896
|
+
* @type {LoggerBackend[]}
|
|
92897
|
+
*/
|
|
92898
|
+
backends = [];
|
|
92972
92899
|
|
|
92973
92900
|
/**
|
|
92974
92901
|
* Add a logging backend, this is a structure that handles incoming log messages.
|
|
@@ -97803,139 +97730,6 @@ class SimpleLifecycle {
|
|
|
97803
97730
|
}
|
|
97804
97731
|
}
|
|
97805
97732
|
|
|
97806
|
-
class LinearValue {
|
|
97807
|
-
|
|
97808
|
-
/**
|
|
97809
|
-
* @readonly
|
|
97810
|
-
* @type {Signal}
|
|
97811
|
-
*/
|
|
97812
|
-
onChanged = new Signal();
|
|
97813
|
-
|
|
97814
|
-
/**
|
|
97815
|
-
*
|
|
97816
|
-
* @param {number} [x = 0]
|
|
97817
|
-
* @param {number} [a = 0]
|
|
97818
|
-
* @param {number} [b = 1]
|
|
97819
|
-
* @constructor
|
|
97820
|
-
*/
|
|
97821
|
-
constructor(x = 0, a = 0, b = 1) {
|
|
97822
|
-
|
|
97823
|
-
/**
|
|
97824
|
-
*
|
|
97825
|
-
* @type {number}
|
|
97826
|
-
*/
|
|
97827
|
-
this.x = x;
|
|
97828
|
-
/**
|
|
97829
|
-
*
|
|
97830
|
-
* @type {number}
|
|
97831
|
-
*/
|
|
97832
|
-
this.a = a;
|
|
97833
|
-
/**
|
|
97834
|
-
*
|
|
97835
|
-
* @type {number}
|
|
97836
|
-
*/
|
|
97837
|
-
this.b = b;
|
|
97838
|
-
|
|
97839
|
-
}
|
|
97840
|
-
|
|
97841
|
-
/**
|
|
97842
|
-
*
|
|
97843
|
-
* @param {LinearValue} other
|
|
97844
|
-
* @returns {LinearValue}
|
|
97845
|
-
*/
|
|
97846
|
-
copy(other) {
|
|
97847
|
-
return this.set(other.x, other.a, other.b);
|
|
97848
|
-
}
|
|
97849
|
-
|
|
97850
|
-
/**
|
|
97851
|
-
*
|
|
97852
|
-
* @param {number} x
|
|
97853
|
-
* @param {number} a
|
|
97854
|
-
* @param {number} b
|
|
97855
|
-
* @returns {LinearValue}
|
|
97856
|
-
*/
|
|
97857
|
-
set(x, a, b) {
|
|
97858
|
-
this.x = x;
|
|
97859
|
-
this.a = a;
|
|
97860
|
-
this.b = b;
|
|
97861
|
-
|
|
97862
|
-
this.onChanged.dispatch(x, a, b);
|
|
97863
|
-
return this;
|
|
97864
|
-
}
|
|
97865
|
-
|
|
97866
|
-
/**
|
|
97867
|
-
*
|
|
97868
|
-
* @param v
|
|
97869
|
-
* @returns {LinearValue}
|
|
97870
|
-
*/
|
|
97871
|
-
addMultiplier(v) {
|
|
97872
|
-
this.b += v;
|
|
97873
|
-
|
|
97874
|
-
this.onChanged.dispatch(this.x, this.a, this.b);
|
|
97875
|
-
return this;
|
|
97876
|
-
}
|
|
97877
|
-
|
|
97878
|
-
/**
|
|
97879
|
-
*
|
|
97880
|
-
* @param v
|
|
97881
|
-
* @returns {LinearValue}
|
|
97882
|
-
*/
|
|
97883
|
-
subMultiplier(v) {
|
|
97884
|
-
return this.addMultiplier(-v);
|
|
97885
|
-
}
|
|
97886
|
-
|
|
97887
|
-
/**
|
|
97888
|
-
*
|
|
97889
|
-
* @param v
|
|
97890
|
-
* @returns {LinearValue}
|
|
97891
|
-
*/
|
|
97892
|
-
addConstant(v) {
|
|
97893
|
-
this.a += v;
|
|
97894
|
-
|
|
97895
|
-
this.onChanged.dispatch(this.x, this.a, this.b);
|
|
97896
|
-
return this;
|
|
97897
|
-
}
|
|
97898
|
-
|
|
97899
|
-
/**
|
|
97900
|
-
*
|
|
97901
|
-
* @param v
|
|
97902
|
-
* @returns {LinearValue}
|
|
97903
|
-
*/
|
|
97904
|
-
subConstant(v) {
|
|
97905
|
-
return this.addConstant(-v);
|
|
97906
|
-
}
|
|
97907
|
-
|
|
97908
|
-
/**
|
|
97909
|
-
*
|
|
97910
|
-
* @returns {number}
|
|
97911
|
-
*/
|
|
97912
|
-
getValue() {
|
|
97913
|
-
// y = b*x + a
|
|
97914
|
-
return this.x * this.b + this.a;
|
|
97915
|
-
}
|
|
97916
|
-
|
|
97917
|
-
/**
|
|
97918
|
-
*
|
|
97919
|
-
* @param {LinearValue} other
|
|
97920
|
-
* @returns {boolean}
|
|
97921
|
-
*/
|
|
97922
|
-
equals(other) {
|
|
97923
|
-
return this.x === other.x && this.a === other.a && this.b === other.b;
|
|
97924
|
-
}
|
|
97925
|
-
|
|
97926
|
-
toJSON() {
|
|
97927
|
-
return {
|
|
97928
|
-
x: this.x,
|
|
97929
|
-
a: this.a,
|
|
97930
|
-
b: this.b
|
|
97931
|
-
};
|
|
97932
|
-
}
|
|
97933
|
-
|
|
97934
|
-
fromJSON(json) {
|
|
97935
|
-
this.set(json.x, json.a, json.b);
|
|
97936
|
-
}
|
|
97937
|
-
}
|
|
97938
|
-
|
|
97939
97733
|
/**
|
|
97940
97734
|
*
|
|
97941
97735
|
* @param {string} string
|
|
@@ -98115,7 +97909,6 @@ function findProcessor(model) {
|
|
|
98115
97909
|
}
|
|
98116
97910
|
|
|
98117
97911
|
|
|
98118
|
-
|
|
98119
97912
|
class ValueProcessor {
|
|
98120
97913
|
/**
|
|
98121
97914
|
* @template Container, Value
|
|
@@ -98162,7 +97955,6 @@ const processors = [
|
|
|
98162
97955
|
p(isInstanceOf(ObservedBoolean), extractorGetValue, format),
|
|
98163
97956
|
p(isInstanceOf(ObservedValue), extractorGetValue, format),
|
|
98164
97957
|
p(isInstanceOf(ObservedString), extractorGetValue, format),
|
|
98165
|
-
p(isInstanceOf(LinearValue), extractorGetValue, formatNumber),
|
|
98166
97958
|
p(isInstanceOf(BoundedValue), extractBoundedValue, formatArray),
|
|
98167
97959
|
p(isInstanceOf(Stat), extractorGetValue, formatNumber),
|
|
98168
97960
|
p(isInstanceOf(Vector1), extractorGetValue, formatNumber),
|
|
@@ -115647,14 +115439,14 @@ class InputControllerSystem extends System {
|
|
|
115647
115439
|
}
|
|
115648
115440
|
|
|
115649
115441
|
class LoggerBackend {
|
|
115650
|
-
constructor() {
|
|
115651
115442
|
|
|
115652
|
-
|
|
115653
|
-
|
|
115654
|
-
|
|
115655
|
-
|
|
115656
|
-
|
|
115657
|
-
|
|
115443
|
+
|
|
115444
|
+
/**
|
|
115445
|
+
* @private
|
|
115446
|
+
* @type {LogLevel|number}
|
|
115447
|
+
*/
|
|
115448
|
+
level = LogLevel.Info;
|
|
115449
|
+
|
|
115658
115450
|
|
|
115659
115451
|
/**
|
|
115660
115452
|
*
|