@woosh/meep-engine 2.76.2 → 2.76.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/meep.cjs CHANGED
@@ -973,6 +973,7 @@ const SignalFlags = {
973
973
  * @copyright Alex Goldring 2014
974
974
  */
975
975
 
976
+
976
977
  /**
977
978
  * Common dispatch stack
978
979
  * @type {SignalHandler[]}
@@ -2191,6 +2192,7 @@ function v3_slerp(
2191
2192
  * @copyright Alex Goldring 2015
2192
2193
  */
2193
2194
 
2195
+
2194
2196
  let Vector3$1 = class Vector3 {
2195
2197
  /**
2196
2198
  *
@@ -3208,6 +3210,7 @@ Vector3$1._dot = v3_dot;
3208
3210
  */
3209
3211
 
3210
3212
 
3213
+
3211
3214
  const forward = new Vector3$1();
3212
3215
  const up = new Vector3$1();
3213
3216
  const right = new Vector3$1();
@@ -4755,6 +4758,7 @@ const TransformFlags = {
4755
4758
  * Created by Alex on 02/04/2014.
4756
4759
  */
4757
4760
 
4761
+
4758
4762
  /**
4759
4763
  *
4760
4764
  * @type {Float32Array}
@@ -5110,6 +5114,7 @@ Transform.adjustRotation = function (sourceQuaternion, targetVector, limit = Inf
5110
5114
  * Common utilities
5111
5115
  * @module glMatrix
5112
5116
  */
5117
+ // Configuration Constants
5113
5118
  var ARRAY_TYPE = typeof Float32Array !== 'undefined' ? Float32Array : Array;
5114
5119
  if (!Math.hypot) Math.hypot = function () {
5115
5120
  var y = 0,
@@ -47391,6 +47396,7 @@ function max2(a, b) {
47391
47396
  * @copyright Alex Goldring 14/02/14.
47392
47397
  */
47393
47398
 
47399
+
47394
47400
  class Vector2 {
47395
47401
  /**
47396
47402
  *
@@ -48223,6 +48229,7 @@ const chunks = {
48223
48229
  * Created by Alex on 22/06/2015.
48224
48230
  */
48225
48231
 
48232
+
48226
48233
  function vertex$1() {
48227
48234
  return `
48228
48235
  #define PHYSICAL
@@ -49048,6 +49055,7 @@ function typedArrayConstructorByInstance(a) {
49048
49055
  * Created by Alex on 11/11/2014.
49049
49056
  */
49050
49057
 
49058
+
49051
49059
  /**
49052
49060
  * Data Texture class, providing an abstraction around 2d numerical arrays, mostly for sampling purposes
49053
49061
  * Inspired by OpenGL's glsl sampler2d API
@@ -50421,6 +50429,7 @@ function array_copy(
50421
50429
  */
50422
50430
 
50423
50431
 
50432
+
50424
50433
  class Vector1 extends Number {
50425
50434
  /**
50426
50435
  *
@@ -50747,6 +50756,7 @@ function computeHashIntegerArray(...value) {
50747
50756
  * Created by Alex on 29/12/2015.
50748
50757
  */
50749
50758
 
50759
+
50750
50760
  /**
50751
50761
  *
50752
50762
  * @param {number[]} result
@@ -51228,6 +51238,7 @@ function computeStringHash(string) {
51228
51238
  * @copyright Alex Goldring 2018
51229
51239
  */
51230
51240
 
51241
+
51231
51242
  class ObservedString extends String {
51232
51243
  /**
51233
51244
  *
@@ -51698,6 +51709,7 @@ function sampler2d_paint(
51698
51709
  * Created by Alex on 28/12/2015.
51699
51710
  */
51700
51711
 
51712
+
51701
51713
  let Context$1 = class Context {
51702
51714
  /**
51703
51715
  *
@@ -52002,6 +52014,7 @@ class TerrainOverlay {
52002
52014
  * Created by Alex on 04/05/2016.
52003
52015
  */
52004
52016
 
52017
+
52005
52018
  const texture_cache = new Map();
52006
52019
 
52007
52020
  /**
@@ -53659,6 +53672,7 @@ function hex2rgb(hex) {
53659
53672
  */
53660
53673
 
53661
53674
 
53675
+
53662
53676
  const rgbRegEx = /rgb\(\s*([0-9]+),\s*([0-9]+),\s*([0-9]+)\s*\)/;
53663
53677
  const rgbaRegEx = /rgba\(\s*([0-9]+(?:\.[0-9]*)?),\s*([0-9]+(?:\.[0-9]*)?),\s*([0-9]+(?:\.[0-9]*)?),\s*([0-9]+(?:\.[0-9]*)?)\s*\)/;
53664
53678
  const hsvRegEx = /hsv\(([0-9]+(?:\.[0-9]*)?),\s*([0-9]+(?:\.[0-9]*)?),\s*([0-9]+(?:\.[0-9]*)?)\)/;
@@ -55079,6 +55093,7 @@ ObservedInteger.prototype.isObservedInteger = true;
55079
55093
  * Created by Alex on 21/03/2016.
55080
55094
  */
55081
55095
 
55096
+
55082
55097
  /**
55083
55098
  *
55084
55099
  * @template T
@@ -55256,6 +55271,7 @@ function array_swap(a, a_offset, b, b_offset, length) {
55256
55271
 
55257
55272
  //
55258
55273
 
55274
+
55259
55275
  /**
55260
55276
  * Merge bounds of two axis-aligned bounding boxes, the result is a box that tightly bounds inputs
55261
55277
  * @param {ArrayLike<number>|number[]|Float32Array} result where resulting value is written to
@@ -56121,6 +56137,7 @@ function aabb3_intersects_clipping_volume_array(
56121
56137
 
56122
56138
  //
56123
56139
 
56140
+
56124
56141
  /**
56125
56142
  *
56126
56143
  * @param {number} x0
@@ -56363,6 +56380,7 @@ function aabb3_signed_distance_to_aabb3(
56363
56380
  * Created by Alex on 16/11/2014.
56364
56381
  */
56365
56382
 
56383
+
56366
56384
  /**
56367
56385
  * Axis-Aligned bounding box in 3D
56368
56386
  * NOTE: In cases where all you want is raw performance - prefer to use typed arrays instead along with `aabb3_` functions
@@ -57337,6 +57355,7 @@ function ray3_array_compose(output, origin_x, origin_y, origin_z, direction_x, d
57337
57355
 
57338
57356
  //
57339
57357
 
57358
+
57340
57359
  /**
57341
57360
  *
57342
57361
  * @param {ArrayLike<number>|number[]|Float32Array} aabb bounding box, order: x0,y0,z0,x1,y1,z1
@@ -57683,6 +57702,7 @@ function bvh32_geometry_raycast(
57683
57702
  * Created by Alex on 28/01/2017.
57684
57703
  */
57685
57704
 
57705
+
57686
57706
  function prepareObject(object) {
57687
57707
  //turn off automatic matrix re-calculations each frame
57688
57708
  object.matrixAutoUpdate = false;
@@ -57757,6 +57777,7 @@ var ThreeFactory = {
57757
57777
  */
57758
57778
 
57759
57779
 
57780
+
57760
57781
  const EMPTY_GEOMETRY = new BufferGeometry();
57761
57782
  const DEFAULT_MATERIAL = new MeshBasicMaterial();
57762
57783
 
@@ -59178,6 +59199,7 @@ const FULL_SCREEN_QUAD_VERTEX_SHADER = `
59178
59199
  * Created by Alex on 09/11/2014.
59179
59200
  */
59180
59201
 
59202
+
59181
59203
  /**
59182
59204
  *
59183
59205
  * @param {WebGLRenderer} renderer
@@ -59487,6 +59509,7 @@ function DenoiseShader(sigma = 10, filterSmoothness = 0.2) {
59487
59509
  * Created by Alex on 15/11/2014.
59488
59510
  */
59489
59511
 
59512
+
59490
59513
  function filterResult2Texture(data, width, height) {
59491
59514
  const result = new DataTexture();
59492
59515
  result.format = RGBAFormat;
@@ -59565,6 +59588,7 @@ function normalMap2OcclusionMap(
59565
59588
  * Created by Alex on 10/11/2014.
59566
59589
  */
59567
59590
 
59591
+
59568
59592
  const NormalMapShader = function () {
59569
59593
  return {
59570
59594
 
@@ -59629,6 +59653,7 @@ const NormalMapShader = function () {
59629
59653
  */
59630
59654
 
59631
59655
 
59656
+
59632
59657
  function convertChannel(v) {
59633
59658
  return (v) / 255 - 0.5;
59634
59659
  }
@@ -61409,6 +61434,7 @@ function arraySetDiff(a, b, equals = strictEquals) {
61409
61434
  */
61410
61435
 
61411
61436
 
61437
+
61412
61438
  /**
61413
61439
  *
61414
61440
  * List structure with event signals for observing changes.
@@ -63465,6 +63491,7 @@ class WorkerProxy {
63465
63491
  * Created by Alex on 21/05/2016.
63466
63492
  */
63467
63493
 
63494
+
63468
63495
  const RxMatchFunctionName = /(function\s*)([a-zA-Z0-9_]+)?(\s*\([^\]]*\)\s*\{.*)/g;
63469
63496
 
63470
63497
  class WorkerBuilder {
@@ -63800,6 +63827,7 @@ const TaskState = {
63800
63827
  * Created by Alex on 22/05/2016.
63801
63828
  */
63802
63829
 
63830
+
63803
63831
  /**
63804
63832
  *
63805
63833
  * @type {number}
@@ -64673,6 +64701,7 @@ const TerrainFlags = {
64673
64701
  * Created by Alex on 28/10/2014.
64674
64702
  */
64675
64703
 
64704
+
64676
64705
  let idCounter = 0;
64677
64706
 
64678
64707
  class Terrain {
@@ -67051,6 +67080,7 @@ function aabb3_array_intersects_frustum_degree(aabb, frustum) {
67051
67080
 
67052
67081
  //
67053
67082
 
67083
+
67054
67084
  const stack$5 = SCRATCH_UINT32_TRAVERSAL_STACK;
67055
67085
 
67056
67086
  /**
@@ -68255,6 +68285,7 @@ function array_copy_unique(source, source_position, destination, destination_pos
68255
68285
  * Created by Alex on 01/04/2014.
68256
68286
  */
68257
68287
 
68288
+
68258
68289
  /**
68259
68290
  *
68260
68291
  * @template C
@@ -68847,6 +68878,7 @@ function unprojectPoint(result, input, projection_matrix_inverse, world_matrix)
68847
68878
  * Created by Alex on 31/12/2014.
68848
68879
  */
68849
68880
 
68881
+
68850
68882
  /**
68851
68883
  * @class
68852
68884
  */
@@ -69211,6 +69243,7 @@ function update_camera_transform(camera) {
69211
69243
  * Created by Alex on 31/12/2014.
69212
69244
  */
69213
69245
 
69246
+
69214
69247
  class CameraSystem extends System {
69215
69248
  /**
69216
69249
  *
@@ -70503,6 +70536,7 @@ class EntityObserver {
70503
70536
  * Created by Alex on 29/01/14.
70504
70537
  */
70505
70538
 
70539
+
70506
70540
  /**
70507
70541
  *
70508
70542
  * @enum {number}
@@ -71480,6 +71514,7 @@ function validateSystem(system) {
71480
71514
  * Created by Alex on 01/04/2014.
71481
71515
  */
71482
71516
 
71517
+
71483
71518
  /**
71484
71519
  *
71485
71520
  * @enum {string}
@@ -72234,6 +72269,7 @@ class EntityManager {
72234
72269
  * @copyright Alex Goldring 2017
72235
72270
  */
72236
72271
 
72272
+
72237
72273
  /**
72238
72274
  *
72239
72275
  * @param {*} value
@@ -79137,6 +79173,7 @@ function line_segment_compute_line_segment_intersection_2d(
79137
79173
  * @copyright Alex Goldring 2016
79138
79174
  */
79139
79175
 
79176
+
79140
79177
  /**
79141
79178
  *
79142
79179
  * Axis-Aligned Bounding Box in 2D
@@ -79734,6 +79771,7 @@ function m3_cm_compose_transform(
79734
79771
  */
79735
79772
 
79736
79773
 
79774
+
79737
79775
  const scratch_m3_0 = new Float32Array(9);
79738
79776
 
79739
79777
  /**
@@ -80501,6 +80539,7 @@ View.prototype.isView = true;
80501
80539
  * Created by Alex on 06/03/2017.
80502
80540
  */
80503
80541
 
80542
+
80504
80543
  class EmptyView extends View {
80505
80544
  /**
80506
80545
  * @param {string[]} [classList]
@@ -80676,6 +80715,7 @@ SerializationMetadata.typeName = "SerializationMetadata";
80676
80715
  * Created by Alex on 23/04/2014.
80677
80716
  */
80678
80717
 
80718
+
80679
80719
  /**
80680
80720
  * Stores textual tags, useful for marking entities
80681
80721
  */
@@ -83086,6 +83126,7 @@ function domify(x, namespace) {
83086
83126
  * Created by Alex on 04/11/2016.
83087
83127
  */
83088
83128
 
83129
+
83089
83130
  /**
83090
83131
  *
83091
83132
  * @param {View} view
@@ -84211,6 +84252,7 @@ const AssetLoadState = {
84211
84252
  * Created by Alex on 21/03/2016.
84212
84253
  */
84213
84254
 
84255
+
84214
84256
  /**
84215
84257
  *
84216
84258
  * @param {Number} currentValue
@@ -84553,6 +84595,7 @@ AssetRequestScope.GLOBAL = Object.freeze(new AssetRequestScope());
84553
84595
  */
84554
84596
 
84555
84597
 
84598
+
84556
84599
  let Response$1 = class Response {
84557
84600
  /**
84558
84601
  *
@@ -86058,6 +86101,7 @@ class PeriodicConsolePrinter {
86058
86101
  * Created by Alex on 29/01/14.
86059
86102
  */
86060
86103
 
86104
+
86061
86105
  /**
86062
86106
  * @callback Graph~visitor
86063
86107
  * @param {*} node
@@ -88476,6 +88520,7 @@ class RenderLayerState {
88476
88520
  * Created by Alex on 11/10/2016.
88477
88521
  */
88478
88522
 
88523
+
88479
88524
  class RenderLayer {
88480
88525
 
88481
88526
  /**
@@ -89582,6 +89627,7 @@ class ShadowMapRenderer {
89582
89627
  * Created by Alex on 14/03/14.
89583
89628
  */
89584
89629
 
89630
+
89585
89631
  /**
89586
89632
  *
89587
89633
  * @param {WebGLRenderer} webGLRenderer
@@ -90291,6 +90337,7 @@ class InputDeviceSwitch {
90291
90337
  * Created by Alex on 06/03/2017.
90292
90338
  */
90293
90339
 
90340
+
90294
90341
  /**
90295
90342
  *
90296
90343
  * @param thing
@@ -91949,6 +91996,7 @@ class Option extends OptionAbstract {
91949
91996
  * Created by Alex on 03/11/2016.
91950
91997
  */
91951
91998
 
91999
+
91952
92000
  /**
91953
92001
  *
91954
92002
  * @param {object|number|string|null|array} json
@@ -94690,6 +94738,7 @@ function promiseTask(promise, name) {
94690
94738
  * Created by Alex on 11/08/2015.
94691
94739
  */
94692
94740
 
94741
+
94693
94742
  class Scene {
94694
94743
  /**
94695
94744
  *
@@ -95545,6 +95594,7 @@ function current_time_in_seconds() {
95545
95594
  * Created by Alex on 11/02/14.
95546
95595
  */
95547
95596
 
95597
+
95548
95598
  /**
95549
95599
  *
95550
95600
  * @param {Clock} clock
@@ -96838,6 +96888,7 @@ GUIElement.serializable = true;
96838
96888
  * Created by Alex on 28/01/2015.
96839
96889
  */
96840
96890
 
96891
+
96841
96892
  class ViewportPosition {
96842
96893
  /**
96843
96894
  *
@@ -98001,6 +98052,7 @@ class ImmutableObjectPool {
98001
98052
  * Created by Alex on 27/02/2017.
98002
98053
  */
98003
98054
 
98055
+
98004
98056
  /**
98005
98057
  *
98006
98058
  * @type {ObjectPoolFactory<HTMLElementCacheKey>}
@@ -98140,6 +98192,7 @@ class ImageView extends View {
98140
98192
  * Created by Alex on 21/03/2017.
98141
98193
  */
98142
98194
 
98195
+
98143
98196
  class ButtonView extends View {
98144
98197
  /**
98145
98198
  *
@@ -98257,6 +98310,7 @@ class ButtonView extends View {
98257
98310
  * Created by Alex on 07/09/2016.
98258
98311
  */
98259
98312
 
98313
+
98260
98314
  /**
98261
98315
  * @typedef {Object} ConfirmationDialogView~Option
98262
98316
  * @property {string} name
@@ -98330,6 +98384,7 @@ class ConfirmationDialogView extends View {
98330
98384
  * @author Alex Goldring, travnick@gmail.com
98331
98385
  */
98332
98386
 
98387
+
98333
98388
  class DraggableAspect {
98334
98389
  /**
98335
98390
  *
@@ -101939,6 +101994,7 @@ class ModalStack {
101939
101994
  * Created by Alex on 16/04/2016.
101940
101995
  */
101941
101996
 
101997
+
101942
101998
  /**
101943
101999
  * @class
101944
102000
  */
@@ -101974,6 +102030,7 @@ Notification.prototype.isNotification = true;
101974
102030
  * Created by Alex on 16/04/2016.
101975
102031
  */
101976
102032
 
102033
+
101977
102034
  function NotificationLog() {
101978
102035
  /**
101979
102036
  * @readonly
@@ -102902,6 +102959,7 @@ class SceneGUIContext {
102902
102959
  */
102903
102960
 
102904
102961
 
102962
+
102905
102963
  class GUIEngine {
102906
102964
  windows = new List();
102907
102965
 
@@ -103433,6 +103491,7 @@ function createTextView(text) {
103433
103491
  */
103434
103492
 
103435
103493
 
103494
+
103436
103495
  function EngineSettings() {
103437
103496
  this.graphics_control_viewport_size = new ObservedBoolean(true);
103438
103497
  this.simulation_speed = new Vector1(1);
@@ -104135,6 +104194,7 @@ function normalize_angle_rad(angle) {
104135
104194
 
104136
104195
  //
104137
104196
 
104197
+
104138
104198
  function atan2(a, b) {
104139
104199
  return Math.atan2(a, b);
104140
104200
  }
@@ -104251,6 +104311,7 @@ function eulerAnglesFromMatrix(res, m4, a0, a1, a2) {
104251
104311
  * Created by Alex on 17/08/2015.
104252
104312
  */
104253
104313
 
104314
+
104254
104315
  const m4 = new Matrix4();
104255
104316
  const angles = [];
104256
104317
 
@@ -104531,6 +104592,7 @@ class InputBinding {
104531
104592
  */
104532
104593
 
104533
104594
 
104595
+
104534
104596
  class InputController {
104535
104597
  /**
104536
104598
  *
@@ -104680,6 +104742,7 @@ function makeOrbitalCameraController({
104680
104742
  */
104681
104743
 
104682
104744
 
104745
+
104683
104746
  const v3_scratch = new Vector3$1();
104684
104747
 
104685
104748
  class TopDownCameraControllerSystem extends System {
@@ -104773,6 +104836,7 @@ const LightType = {
104773
104836
  */
104774
104837
 
104775
104838
 
104839
+
104776
104840
  const DEFAULT_DISTANCE = 1;
104777
104841
 
104778
104842
  class Light {
@@ -106937,6 +107001,7 @@ class MaxRectanglesPacker {
106937
107001
  * Created by Alex on 01/04/2014.
106938
107002
  */
106939
107003
 
107004
+
106940
107005
  /**
106941
107006
  * Pool of unsigned integer IDs, useful when you don't want to just keep incrementing ID counter and want to re-use IDs after they are no longer needed
106942
107007
  * Main use case is when your IDs are array indices, having compact IDs lets you use fixed size array even as objects are added and removed as you're able to reuse slots in an efficient manner
@@ -111109,6 +111174,7 @@ class ForwardPlusRenderingPlugin extends EnginePlugin {
111109
111174
  */
111110
111175
 
111111
111176
 
111177
+
111112
111178
  const corners = [
111113
111179
  new Vector3(-1, -1, 0),
111114
111180
  new Vector3(-1, -1, 0),
@@ -112368,6 +112434,7 @@ class ThreeLightCache {
112368
112434
  * Created by Alex on 01/06/2016.
112369
112435
  */
112370
112436
 
112437
+
112371
112438
  class LightSystem extends AbstractContextSystem {
112372
112439
  /**
112373
112440
  *
@@ -112663,6 +112730,7 @@ const WATER_SIZE = 800;
112663
112730
  * Created by Alex on 17/02/2017.
112664
112731
  */
112665
112732
 
112733
+
112666
112734
  class Water {
112667
112735
  level = new Vector1(0);
112668
112736
  /**
@@ -113484,6 +113552,7 @@ Script.serializable = false;
113484
113552
  * Created by Alex on 06/03/2017.
113485
113553
  */
113486
113554
 
113555
+
113487
113556
  const v3$1 = new Vector3$1();
113488
113557
 
113489
113558
  class KeyboardCameraController {
@@ -113675,6 +113744,7 @@ function resolvePath(object, path, missingPropertyHandler) {
113675
113744
  * Created by Alex on 09/10/2015.
113676
113745
  */
113677
113746
 
113747
+
113678
113748
  /**
113679
113749
  *
113680
113750
  * @param {Object} object
@@ -116719,15 +116789,15 @@ function heuristic(index0, index1, width) {
116719
116789
  const x1 = index0 % width;
116720
116790
  const y1 = (index0 / width) | 0;
116721
116791
 
116722
- //
116723
116792
  const x2 = index1 % width;
116724
116793
  const y2 = (index1 / width) | 0;
116725
116794
 
116726
- //
116727
- const dx = Math.abs(x1 - x2);
116728
- const dy = Math.abs(y1 - y2);
116795
+ // deltas
116796
+ const dx = x2 - x1;
116797
+ const dy = y2 - y1;
116729
116798
 
116730
- return dx + dy;
116799
+ // we skip expensive SQRT, but still get a good guiding heuristic which has the same monotonic order
116800
+ return dx * dx + dy * dy;
116731
116801
  }
116732
116802
 
116733
116803