@woosh/meep-engine 2.110.2 → 2.110.5
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 +147 -124
- package/build/meep.min.js +1 -1
- package/build/meep.module.js +148 -122
- package/package.json +1 -1
- package/src/core/events/signal/Signal.d.ts.map +1 -1
- package/src/core/events/signal/Signal.js +3 -98
- package/src/core/events/signal/dispatchViaProxy.d.ts +7 -0
- package/src/core/events/signal/dispatchViaProxy.d.ts.map +1 -0
- package/src/core/events/signal/dispatchViaProxy.js +60 -0
- package/src/core/events/signal/findSignalHandlerIndexByHandle.d.ts +9 -0
- package/src/core/events/signal/findSignalHandlerIndexByHandle.d.ts.map +1 -0
- package/src/core/events/signal/findSignalHandlerIndexByHandle.js +26 -0
- package/src/core/events/signal/findSignalHandlerIndexByHandleAndContext.d.ts +9 -0
- package/src/core/events/signal/findSignalHandlerIndexByHandleAndContext.d.ts.map +1 -0
- package/src/core/events/signal/findSignalHandlerIndexByHandleAndContext.js +21 -0
- package/src/core/fsm/simple/SimpleStateMachine.d.ts.map +1 -1
- package/src/core/fsm/simple/SimpleStateMachine.js +2 -1
- package/src/core/geom/3d/normal/octahedron/encode_unit_to_octahedron.d.ts +2 -2
- package/src/core/geom/3d/normal/octahedron/encode_unit_to_octahedron.d.ts.map +1 -1
- package/src/core/geom/3d/normal/octahedron/encode_unit_to_octahedron.js +1 -1
- package/src/core/geom/3d/sphere/sphere_fibonacci_point.d.ts +18 -0
- package/src/core/geom/3d/sphere/sphere_fibonacci_point.d.ts.map +1 -0
- package/src/core/geom/3d/sphere/sphere_fibonacci_point.js +51 -0
- package/src/core/model/object/ObjectPoolFactory.d.ts +17 -10
- package/src/core/model/object/ObjectPoolFactory.d.ts.map +1 -1
- package/src/core/model/object/ObjectPoolFactory.js +33 -16
- package/src/engine/animation/clip/AnimationClip.d.ts.map +1 -1
- package/src/engine/animation/clip/AnimationClip.js +4 -0
- package/src/engine/animation/clip/AnimationInterpolationKind.d.ts +7 -0
- package/src/engine/animation/clip/AnimationInterpolationKind.d.ts.map +1 -0
- package/src/engine/animation/clip/AnimationInterpolationKind.js +9 -0
- package/src/engine/animation/clip/AnimationTrack.d.ts +12 -0
- package/src/engine/animation/clip/AnimationTrack.d.ts.map +1 -1
- package/src/engine/animation/clip/AnimationTrack.js +20 -1
- package/src/engine/animation/clip/AnimationTrackBinding.d.ts.map +1 -1
- package/src/engine/animation/clip/AnimationTrackBinding.js +12 -0
- package/src/engine/animation/clip/bind_property_writer.d.ts +9 -0
- package/src/engine/animation/clip/bind_property_writer.d.ts.map +1 -0
- package/src/engine/animation/clip/bind_property_writer.js +118 -0
- package/src/engine/animation/clip/curve_from_track_data.d.ts +12 -0
- package/src/engine/animation/clip/curve_from_track_data.d.ts.map +1 -0
- package/src/engine/animation/clip/curve_from_track_data.js +27 -0
- package/src/engine/animation/clip/curve_from_track_data_cubic_tangents.d.ts +10 -0
- package/src/engine/animation/clip/curve_from_track_data_cubic_tangents.d.ts.map +1 -0
- package/src/engine/animation/clip/curve_from_track_data_cubic_tangents.js +33 -0
- package/src/engine/animation/clip/curve_from_track_data_discrete.d.ts +10 -0
- package/src/engine/animation/clip/curve_from_track_data_discrete.d.ts.map +1 -0
- package/src/engine/animation/clip/curve_from_track_data_discrete.js +30 -0
- package/src/engine/animation/clip/curve_from_track_data_linear.d.ts +10 -0
- package/src/engine/animation/clip/curve_from_track_data_linear.d.ts.map +1 -0
- package/src/engine/animation/clip/curve_from_track_data_linear.js +25 -0
- package/src/engine/animation/clip/ecd_bind_animation_curve.d.ts.map +1 -1
- package/src/engine/animation/clip/ecd_bind_animation_curve.js +14 -239
- package/src/engine/animation/curve/AnimationCurve.d.ts +17 -17
- package/src/engine/animation/curve/AnimationCurve.d.ts.map +1 -1
- package/src/engine/animation/curve/AnimationCurve.js +30 -20
- package/src/engine/animation/curve/Keyframe.d.ts +5 -0
- package/src/engine/animation/curve/Keyframe.d.ts.map +1 -1
- package/src/engine/animation/curve/Keyframe.js +6 -0
- package/src/engine/animation/curve/binding/BoundValueWriter.d.ts +7 -0
- package/src/engine/animation/curve/binding/BoundValueWriter.d.ts.map +1 -1
- package/src/engine/animation/curve/binding/BoundValueWriter.js +9 -1
- package/src/engine/animation/curve/compute_curve_aabb.d.ts +1 -1
- package/src/engine/animation/curve/compute_curve_aabb.js +1 -1
- package/src/engine/ecs/EntityComponentDataset.d.ts.map +1 -1
- package/src/engine/ecs/EntityComponentDataset.js +4 -3
- package/src/engine/ecs/parent/EntityNode.d.ts.map +1 -1
- package/src/engine/ecs/parent/EntityNode.js +2 -1
- package/src/engine/graphics/geometry/buffered/makeGeometryIndexed.d.ts +2 -1
- package/src/engine/graphics/geometry/buffered/makeGeometryIndexed.d.ts.map +1 -1
- package/src/engine/graphics/geometry/buffered/makeGeometryIndexed.js +4 -1
- package/src/engine/graphics/sh3/gi/material/common.glsl +3 -3
- package/src/engine/graphics/sh3/lpv/PathTracerProbeRenderer.d.ts.map +1 -1
- package/src/engine/graphics/sh3/lpv/PathTracerProbeRenderer.js +4 -3
- package/src/engine/graphics/sh3/lpv/depth/octahedral/bake_octahedral_depth_map.d.ts +2 -1
- package/src/engine/graphics/sh3/lpv/depth/octahedral/bake_octahedral_depth_map.d.ts.map +1 -1
- package/src/engine/graphics/sh3/lpv/depth/octahedral/bake_octahedral_depth_map.js +6 -30
- package/src/engine/graphics/sh3/lpv/depth/octahedral/bake_octahedral_depth_map_fibonacci.d.ts +13 -0
- package/src/engine/graphics/sh3/lpv/depth/octahedral/bake_octahedral_depth_map_fibonacci.d.ts.map +1 -0
- package/src/engine/graphics/sh3/lpv/depth/octahedral/bake_octahedral_depth_map_fibonacci.js +163 -0
- package/src/engine/graphics/sh3/prototypeSH3Probe.js +2 -2
- package/src/engine/graphics/trail/x/RibbonXMaterialSpec.d.ts.map +1 -1
- package/src/engine/graphics/trail/x/RibbonXMaterialSpec.js +10 -2
- package/src/engine/graphics/trail/x/RibbonXPlugin.d.ts.map +1 -1
- package/src/engine/graphics/trail/x/RibbonXPlugin.js +7 -5
- package/src/engine/simulation/Ticker.d.ts +9 -0
- package/src/core/model/object/SimpleObjectPoolFactory.d.ts +0 -25
- package/src/core/model/object/SimpleObjectPoolFactory.d.ts.map +0 -1
- package/src/core/model/object/SimpleObjectPoolFactory.js +0 -42
package/build/meep.module.js
CHANGED
|
@@ -897,13 +897,6 @@ function m4_multiply(out, a, b) {
|
|
|
897
897
|
out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;
|
|
898
898
|
}
|
|
899
899
|
|
|
900
|
-
const SignalFlags = {
|
|
901
|
-
/**
|
|
902
|
-
* If set - signal will not invoke handlers when dispatched
|
|
903
|
-
*/
|
|
904
|
-
Silent: 1
|
|
905
|
-
};
|
|
906
|
-
|
|
907
900
|
/**
|
|
908
901
|
*
|
|
909
902
|
* @enum {number}
|
|
@@ -982,6 +975,118 @@ class SignalHandler {
|
|
|
982
975
|
*/
|
|
983
976
|
SignalHandler.prototype.isSignalHandler = true;
|
|
984
977
|
|
|
978
|
+
/**
|
|
979
|
+
* Common dispatch stack
|
|
980
|
+
* @readonly
|
|
981
|
+
* @type {SignalHandler[]}
|
|
982
|
+
*/
|
|
983
|
+
const dispatch_stack$1 = [];
|
|
984
|
+
let dispatch_stack_top$1 = 0;
|
|
985
|
+
|
|
986
|
+
/**
|
|
987
|
+
*
|
|
988
|
+
* @param {function} f
|
|
989
|
+
* @param {*} context
|
|
990
|
+
* @param {Array} args
|
|
991
|
+
*/
|
|
992
|
+
function dispatchCallback(f, context, args) {
|
|
993
|
+
|
|
994
|
+
try {
|
|
995
|
+
f.apply(context, args);
|
|
996
|
+
} catch (e) {
|
|
997
|
+
}
|
|
998
|
+
}
|
|
999
|
+
|
|
1000
|
+
/**
|
|
1001
|
+
*
|
|
1002
|
+
* @param {SignalHandler[]} handlers
|
|
1003
|
+
* @param {Array} [args]
|
|
1004
|
+
*/
|
|
1005
|
+
function dispatchViaProxy(handlers, args) {
|
|
1006
|
+
const length = handlers.length;
|
|
1007
|
+
|
|
1008
|
+
const stack_pointer = dispatch_stack_top$1;
|
|
1009
|
+
const stack_frame_end = stack_pointer + length;
|
|
1010
|
+
dispatch_stack_top$1 = stack_frame_end;
|
|
1011
|
+
|
|
1012
|
+
let i, h;
|
|
1013
|
+
for (i = 0; i < length; i++) {
|
|
1014
|
+
//copy to proxy
|
|
1015
|
+
dispatch_stack$1[stack_pointer + i] = handlers[length - (i + 1)];
|
|
1016
|
+
}
|
|
1017
|
+
|
|
1018
|
+
for (i = stack_frame_end - 1; i >= stack_pointer; i--) {
|
|
1019
|
+
h = dispatch_stack$1[i];
|
|
1020
|
+
|
|
1021
|
+
if (h.getFlag(SignalHandlerFlags.RemoveAfterExecution)) {
|
|
1022
|
+
//handler should be cut
|
|
1023
|
+
const p = handlers.indexOf(h);
|
|
1024
|
+
handlers.splice(p, 1);
|
|
1025
|
+
}
|
|
1026
|
+
|
|
1027
|
+
dispatchCallback(h.handle, h.context, args);
|
|
1028
|
+
}
|
|
1029
|
+
|
|
1030
|
+
//drop stack frame
|
|
1031
|
+
dispatch_stack_top$1 = stack_pointer;
|
|
1032
|
+
}
|
|
1033
|
+
|
|
1034
|
+
/**
|
|
1035
|
+
*
|
|
1036
|
+
* @param {SignalHandler[]} handlers
|
|
1037
|
+
* @param {function} f
|
|
1038
|
+
* @param {*} [thisArg]
|
|
1039
|
+
* @returns {number} index of the handler, or -1 if not found
|
|
1040
|
+
*/
|
|
1041
|
+
function findSignalHandlerIndexByHandle(handlers, f, thisArg) {
|
|
1042
|
+
const l = handlers.length;
|
|
1043
|
+
|
|
1044
|
+
for (let i = 0; i < l; i++) {
|
|
1045
|
+
const signalHandler = handlers[i];
|
|
1046
|
+
|
|
1047
|
+
if (signalHandler.handle === f) {
|
|
1048
|
+
|
|
1049
|
+
if (thisArg !== undefined && thisArg !== signalHandler.context) {
|
|
1050
|
+
//context variable doesn't match
|
|
1051
|
+
continue;
|
|
1052
|
+
}
|
|
1053
|
+
|
|
1054
|
+
return i;
|
|
1055
|
+
}
|
|
1056
|
+
}
|
|
1057
|
+
|
|
1058
|
+
return -1;
|
|
1059
|
+
}
|
|
1060
|
+
|
|
1061
|
+
/**
|
|
1062
|
+
*
|
|
1063
|
+
* @param {SignalHandler[]} handlers
|
|
1064
|
+
* @param {function} f
|
|
1065
|
+
* @param {*} ctx
|
|
1066
|
+
* @returns {number} index of the handler, or -1 if not found
|
|
1067
|
+
*/
|
|
1068
|
+
function findSignalHandlerIndexByHandleAndContext(handlers, f, ctx) {
|
|
1069
|
+
const l = handlers.length;
|
|
1070
|
+
|
|
1071
|
+
for (let i = 0; i < l; i++) {
|
|
1072
|
+
const handler = handlers[i];
|
|
1073
|
+
|
|
1074
|
+
if (handler.handle === f && handler.context === ctx) {
|
|
1075
|
+
return i;
|
|
1076
|
+
}
|
|
1077
|
+
|
|
1078
|
+
}
|
|
1079
|
+
|
|
1080
|
+
return -1;
|
|
1081
|
+
}
|
|
1082
|
+
|
|
1083
|
+
const SignalFlags = {
|
|
1084
|
+
/**
|
|
1085
|
+
* If set - signal will not invoke handlers when dispatched
|
|
1086
|
+
*/
|
|
1087
|
+
Silent: 1
|
|
1088
|
+
};
|
|
1089
|
+
|
|
985
1090
|
/**
|
|
986
1091
|
* Common dispatch stack
|
|
987
1092
|
* @readonly
|
|
@@ -1560,55 +1665,6 @@ class Signal {
|
|
|
1560
1665
|
*/
|
|
1561
1666
|
Signal.prototype.isSignal = true;
|
|
1562
1667
|
|
|
1563
|
-
/**
|
|
1564
|
-
*
|
|
1565
|
-
* @param {SignalHandler[]} handlers
|
|
1566
|
-
* @param {function} f
|
|
1567
|
-
* @param {*} [thisArg]
|
|
1568
|
-
* @returns {number} index of the handler, or -1 if not found
|
|
1569
|
-
*/
|
|
1570
|
-
function findSignalHandlerIndexByHandle(handlers, f, thisArg) {
|
|
1571
|
-
const l = handlers.length;
|
|
1572
|
-
|
|
1573
|
-
for (let i = 0; i < l; i++) {
|
|
1574
|
-
const signalHandler = handlers[i];
|
|
1575
|
-
|
|
1576
|
-
if (signalHandler.handle === f) {
|
|
1577
|
-
|
|
1578
|
-
if (thisArg !== undefined && thisArg !== signalHandler.context) {
|
|
1579
|
-
//context variable doesn't match
|
|
1580
|
-
continue;
|
|
1581
|
-
}
|
|
1582
|
-
|
|
1583
|
-
return i;
|
|
1584
|
-
}
|
|
1585
|
-
}
|
|
1586
|
-
|
|
1587
|
-
return -1;
|
|
1588
|
-
}
|
|
1589
|
-
|
|
1590
|
-
/**
|
|
1591
|
-
*
|
|
1592
|
-
* @param {SignalHandler[]} handlers
|
|
1593
|
-
* @param {function} f
|
|
1594
|
-
* @param {*} ctx
|
|
1595
|
-
* @returns {number} index of the handler, or -1 if not found
|
|
1596
|
-
*/
|
|
1597
|
-
function findSignalHandlerIndexByHandleAndContext(handlers, f, ctx) {
|
|
1598
|
-
const l = handlers.length;
|
|
1599
|
-
|
|
1600
|
-
for (let i = 0; i < l; i++) {
|
|
1601
|
-
const handler = handlers[i];
|
|
1602
|
-
|
|
1603
|
-
if (handler.handle === f && handler.context === ctx) {
|
|
1604
|
-
return i;
|
|
1605
|
-
}
|
|
1606
|
-
|
|
1607
|
-
}
|
|
1608
|
-
|
|
1609
|
-
return -1;
|
|
1610
|
-
}
|
|
1611
|
-
|
|
1612
1668
|
/**
|
|
1613
1669
|
*
|
|
1614
1670
|
* @param {Signal} signal
|
|
@@ -1644,54 +1700,6 @@ function removeHandlerByHandlerAndContext(signal, h, ctx) {
|
|
|
1644
1700
|
}
|
|
1645
1701
|
|
|
1646
1702
|
return false;
|
|
1647
|
-
}
|
|
1648
|
-
|
|
1649
|
-
/**
|
|
1650
|
-
*
|
|
1651
|
-
* @param {function} f
|
|
1652
|
-
* @param {*} context
|
|
1653
|
-
* @param {Array} args
|
|
1654
|
-
*/
|
|
1655
|
-
function dispatchCallback(f, context, args) {
|
|
1656
|
-
|
|
1657
|
-
try {
|
|
1658
|
-
f.apply(context, args);
|
|
1659
|
-
} catch (e) {
|
|
1660
|
-
}
|
|
1661
|
-
}
|
|
1662
|
-
|
|
1663
|
-
/**
|
|
1664
|
-
*
|
|
1665
|
-
* @param {SignalHandler[]} handlers
|
|
1666
|
-
* @param {Array} [args]
|
|
1667
|
-
*/
|
|
1668
|
-
function dispatchViaProxy(handlers, args) {
|
|
1669
|
-
const length = handlers.length;
|
|
1670
|
-
|
|
1671
|
-
const stack_pointer = dispatch_stack_top;
|
|
1672
|
-
const stack_frame_end = stack_pointer + length;
|
|
1673
|
-
dispatch_stack_top = stack_frame_end;
|
|
1674
|
-
|
|
1675
|
-
let i, h;
|
|
1676
|
-
for (i = 0; i < length; i++) {
|
|
1677
|
-
//copy to proxy
|
|
1678
|
-
dispatch_stack[stack_pointer + i] = handlers[length - (i + 1)];
|
|
1679
|
-
}
|
|
1680
|
-
|
|
1681
|
-
for (i = stack_frame_end - 1; i >= stack_pointer; i--) {
|
|
1682
|
-
h = dispatch_stack[i];
|
|
1683
|
-
|
|
1684
|
-
if (h.getFlag(SignalHandlerFlags.RemoveAfterExecution)) {
|
|
1685
|
-
//handler should be cut
|
|
1686
|
-
const p = handlers.indexOf(h);
|
|
1687
|
-
handlers.splice(p, 1);
|
|
1688
|
-
}
|
|
1689
|
-
|
|
1690
|
-
dispatchCallback(h.handle, h.context, args);
|
|
1691
|
-
}
|
|
1692
|
-
|
|
1693
|
-
//drop stack frame
|
|
1694
|
-
dispatch_stack_top = stack_pointer;
|
|
1695
1703
|
}
|
|
1696
1704
|
|
|
1697
1705
|
/**
|
|
@@ -74517,7 +74525,8 @@ class EntityNode {
|
|
|
74517
74525
|
// destroy children first
|
|
74518
74526
|
const children = this.__children;
|
|
74519
74527
|
const child_count = children.length;
|
|
74520
|
-
|
|
74528
|
+
|
|
74529
|
+
for (let i = child_count - 1; i >= 0; i--) {
|
|
74521
74530
|
const child = children[i];
|
|
74522
74531
|
|
|
74523
74532
|
child.destroy();
|
|
@@ -97939,9 +97948,22 @@ class ImmutableObjectPool {
|
|
|
97939
97948
|
}
|
|
97940
97949
|
|
|
97941
97950
|
/**
|
|
97951
|
+
* Object Pool pattern implementation.
|
|
97952
|
+
* Reuse objects instead of relying on garbage collector. Useful in cases where creating or destroying an object is costly, and objects are relatively short-lived
|
|
97942
97953
|
* @template T
|
|
97943
97954
|
*/
|
|
97944
97955
|
class ObjectPoolFactory {
|
|
97956
|
+
/**
|
|
97957
|
+
* @private
|
|
97958
|
+
* @type {Array<T>}
|
|
97959
|
+
*/
|
|
97960
|
+
pool = [];
|
|
97961
|
+
|
|
97962
|
+
/**
|
|
97963
|
+
* @type {number}
|
|
97964
|
+
*/
|
|
97965
|
+
maxSize = 256;
|
|
97966
|
+
|
|
97945
97967
|
/**
|
|
97946
97968
|
* @param {function():T} creator
|
|
97947
97969
|
* @param {function(T)} destroyer
|
|
@@ -97958,36 +97980,31 @@ class ObjectPoolFactory {
|
|
|
97958
97980
|
* @type {function(): T}
|
|
97959
97981
|
*/
|
|
97960
97982
|
this.creator = creator;
|
|
97983
|
+
|
|
97961
97984
|
/**
|
|
97962
97985
|
* @private
|
|
97963
97986
|
* @type {function(T)}
|
|
97964
97987
|
*/
|
|
97965
97988
|
this.destroyer = destroyer;
|
|
97989
|
+
|
|
97966
97990
|
/**
|
|
97967
97991
|
* @private
|
|
97968
97992
|
* @type {function(T)}
|
|
97969
97993
|
*/
|
|
97970
97994
|
this.resetter = resetter;
|
|
97971
97995
|
|
|
97972
|
-
/**
|
|
97973
|
-
* @private
|
|
97974
|
-
* @type {Array<T>}
|
|
97975
|
-
*/
|
|
97976
|
-
this.pool = [];
|
|
97977
|
-
|
|
97978
|
-
/**
|
|
97979
|
-
* @type {number}
|
|
97980
|
-
*/
|
|
97981
|
-
this.maxSize = 256;
|
|
97982
97996
|
}
|
|
97983
97997
|
|
|
97984
97998
|
/**
|
|
97985
97999
|
*
|
|
97986
98000
|
* @returns {T}
|
|
97987
98001
|
*/
|
|
97988
|
-
|
|
97989
|
-
|
|
97990
|
-
|
|
98002
|
+
get() {
|
|
98003
|
+
const pool = this.pool;
|
|
98004
|
+
|
|
98005
|
+
if (pool.length > 0) {
|
|
98006
|
+
|
|
98007
|
+
const oldInstance = pool.pop();
|
|
97991
98008
|
|
|
97992
98009
|
//reset the object
|
|
97993
98010
|
this.resetter(oldInstance);
|
|
@@ -98010,7 +98027,9 @@ class ObjectPoolFactory {
|
|
|
98010
98027
|
*/
|
|
98011
98028
|
release(object) {
|
|
98012
98029
|
|
|
98013
|
-
|
|
98030
|
+
const pool = this.pool;
|
|
98031
|
+
|
|
98032
|
+
if (pool.length >= this.maxSize) {
|
|
98014
98033
|
//pool is too large, destroy and discard the object
|
|
98015
98034
|
if (this.destroyer !== noop) {
|
|
98016
98035
|
this.destroyer(object);
|
|
@@ -98020,11 +98039,18 @@ class ObjectPoolFactory {
|
|
|
98020
98039
|
}
|
|
98021
98040
|
|
|
98022
98041
|
//add it to the pool
|
|
98023
|
-
|
|
98042
|
+
pool.push(object);
|
|
98024
98043
|
|
|
98025
98044
|
return true;
|
|
98026
98045
|
}
|
|
98027
|
-
}
|
|
98046
|
+
}
|
|
98047
|
+
|
|
98048
|
+
|
|
98049
|
+
/**
|
|
98050
|
+
* @deprecated use `get` instead
|
|
98051
|
+
* @type {function(): T}
|
|
98052
|
+
*/
|
|
98053
|
+
ObjectPoolFactory.prototype.create = ObjectPoolFactory.prototype.get;
|
|
98028
98054
|
|
|
98029
98055
|
/**
|
|
98030
98056
|
* Will invoke A.equals(B) on members if such exists
|
|
@@ -118129,4 +118155,4 @@ function v4_distance_sqr(
|
|
|
118129
118155
|
return v4_length_sqr(x0 - x1, y0 - y1, z0 - z1, w0 - w1);
|
|
118130
118156
|
}
|
|
118131
118157
|
|
|
118132
|
-
export { AmbientOcclusionPostProcessEffect, Behavior, BehaviorStatus, Blackboard, Cache, EngineConfiguration, EngineHarness, ForwardPlusRenderingPlugin, HashMap, Light, ParallelBehavior, ParallelBehaviorPolicy, SGMesh, SGMeshSystem, SelectorBehavior, SequenceBehavior, ShadedGeometry, ShadedGeometrySystem, Signal, SignalBinding, Transform,
|
|
118158
|
+
export { AmbientOcclusionPostProcessEffect, Behavior, BehaviorStatus, Blackboard, Cache, EngineConfiguration, EngineHarness, ForwardPlusRenderingPlugin, HashMap, Light, ParallelBehavior, ParallelBehaviorPolicy, SGMesh, SGMeshSystem, SelectorBehavior, SequenceBehavior, ShadedGeometry, ShadedGeometrySystem, Signal, SignalBinding, Transform, find_path_on_grid_astar, quat3_createFromAxisAngle, three_update_shadow_camera_extents, v2_angle_between, v2_bearing_angle_towards, v2_distance, v2_dot, v2_length_sqr, v2_magnitude, v4_distance_sqr, v4_dot, v4_length_sqr, v4_multiply_mat4 };
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Signal.d.ts","sourceRoot":"","sources":["../../../../../src/core/events/signal/Signal.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Signal.d.ts","sourceRoot":"","sources":["../../../../../src/core/events/signal/Signal.js"],"names":[],"mappings":"AAeA;;;;GAIG;AACH;IACI;;;OAGG;IACH,iBAAc;IAEd;;;;OAIG;IACH,cAAU;IAWV;;;OAGG;IACH,yBAEC;IAfD;;;OAGG;IACH,sBAEC;IAYD;;;;OAIG;IACH,cAHW,MAAM;;KAAY,GAChB,IAAI,CAIhB;IAED;;;;OAIG;IACH,gBAHW,MAAM;;KAAY,GAChB,IAAI,CAIhB;IAED;;;;OAIG;IACH,gBAHW,MAAM;;KAAY,SAClB,OAAO,QAQjB;IAED;;;;OAIG;IACH,cAHW,MAAM;;KAAY,GAChB,OAAO,CAInB;IAGD;;;;;OAKG;IACH,4CAFa,OAAO,CAQnB;IAED,aAEC;IAED,eAEC;IAED;;;OAGG;IACH,eAFa,OAAO,CAInB;IAED;;;;OAIG;IACH,yCAQC;IAED;;;;OAIG;IACH,sCAYC;IAED;;;;;OAKG;IACH,oCAFa,OAAO,CAUnB;IAED;;;;;;OAMG;IACH,kBAGC;IAED;;;OAGG;IACH,+BAQC;IAED;;;OAGG;IACH,cA4CC;IAED;;;;OAIG;IACH,sBA6CC;IAED;;;;OAIG;IACH,4BA4CC;IAED;;;;;OAKG;IACH,oCA4CC;IAED;;;;;;OAMG;IACH,4CA4CC;IAED;;;;;;;;OAQG;IACH,4DA4CC;IAED;;;;;;;;;;OAUG;IACH,4EA4CC;IAED;;;;OAIG;IACH,aAHW,MAAM,GACJ,MAAM,CAalB;IAIL;;;OAGG;IACH,mBAFU,OAAO,CAEQ;CAPxB"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { assert } from "../../assert.js";
|
|
2
|
+
import { dispatchViaProxy } from "./dispatchViaProxy.js";
|
|
3
|
+
import { findSignalHandlerIndexByHandle } from "./findSignalHandlerIndexByHandle.js";
|
|
4
|
+
import { findSignalHandlerIndexByHandleAndContext } from "./findSignalHandlerIndexByHandleAndContext.js";
|
|
2
5
|
import { SignalFlags } from "./SignalFlags.js";
|
|
3
6
|
import { SignalHandler, SignalHandlerFlags } from "./SignalHandler.js";
|
|
4
7
|
|
|
@@ -590,55 +593,6 @@ export class Signal {
|
|
|
590
593
|
*/
|
|
591
594
|
Signal.prototype.isSignal = true;
|
|
592
595
|
|
|
593
|
-
/**
|
|
594
|
-
*
|
|
595
|
-
* @param {SignalHandler[]} handlers
|
|
596
|
-
* @param {function} f
|
|
597
|
-
* @param {*} [thisArg]
|
|
598
|
-
* @returns {number} index of the handler, or -1 if not found
|
|
599
|
-
*/
|
|
600
|
-
export function findSignalHandlerIndexByHandle(handlers, f, thisArg) {
|
|
601
|
-
const l = handlers.length;
|
|
602
|
-
|
|
603
|
-
for (let i = 0; i < l; i++) {
|
|
604
|
-
const signalHandler = handlers[i];
|
|
605
|
-
|
|
606
|
-
if (signalHandler.handle === f) {
|
|
607
|
-
|
|
608
|
-
if (thisArg !== undefined && thisArg !== signalHandler.context) {
|
|
609
|
-
//context variable doesn't match
|
|
610
|
-
continue;
|
|
611
|
-
}
|
|
612
|
-
|
|
613
|
-
return i;
|
|
614
|
-
}
|
|
615
|
-
}
|
|
616
|
-
|
|
617
|
-
return -1;
|
|
618
|
-
}
|
|
619
|
-
|
|
620
|
-
/**
|
|
621
|
-
*
|
|
622
|
-
* @param {SignalHandler[]} handlers
|
|
623
|
-
* @param {function} f
|
|
624
|
-
* @param {*} ctx
|
|
625
|
-
* @returns {number} index of the handler, or -1 if not found
|
|
626
|
-
*/
|
|
627
|
-
export function findSignalHandlerIndexByHandleAndContext(handlers, f, ctx) {
|
|
628
|
-
const l = handlers.length;
|
|
629
|
-
|
|
630
|
-
for (let i = 0; i < l; i++) {
|
|
631
|
-
const handler = handlers[i];
|
|
632
|
-
|
|
633
|
-
if (handler.handle === f && handler.context === ctx) {
|
|
634
|
-
return i;
|
|
635
|
-
}
|
|
636
|
-
|
|
637
|
-
}
|
|
638
|
-
|
|
639
|
-
return -1;
|
|
640
|
-
}
|
|
641
|
-
|
|
642
596
|
/**
|
|
643
597
|
*
|
|
644
598
|
* @param {Signal} signal
|
|
@@ -676,54 +630,5 @@ function removeHandlerByHandlerAndContext(signal, h, ctx) {
|
|
|
676
630
|
return false;
|
|
677
631
|
}
|
|
678
632
|
|
|
679
|
-
/**
|
|
680
|
-
*
|
|
681
|
-
* @param {function} f
|
|
682
|
-
* @param {*} context
|
|
683
|
-
* @param {Array} args
|
|
684
|
-
*/
|
|
685
|
-
function dispatchCallback(f, context, args) {
|
|
686
|
-
assert.isFunction(f, 'f');
|
|
687
|
-
|
|
688
|
-
try {
|
|
689
|
-
f.apply(context, args)
|
|
690
|
-
} catch (e) {
|
|
691
|
-
console.error("Failed to dispatch handler", f, e);
|
|
692
|
-
}
|
|
693
|
-
}
|
|
694
|
-
|
|
695
|
-
/**
|
|
696
|
-
*
|
|
697
|
-
* @param {SignalHandler[]} handlers
|
|
698
|
-
* @param {Array} [args]
|
|
699
|
-
*/
|
|
700
|
-
export function dispatchViaProxy(handlers, args) {
|
|
701
|
-
const length = handlers.length;
|
|
702
|
-
|
|
703
|
-
const stack_pointer = dispatch_stack_top;
|
|
704
|
-
const stack_frame_end = stack_pointer + length;
|
|
705
|
-
dispatch_stack_top = stack_frame_end;
|
|
706
|
-
|
|
707
|
-
let i, h;
|
|
708
|
-
for (i = 0; i < length; i++) {
|
|
709
|
-
//copy to proxy
|
|
710
|
-
dispatch_stack[stack_pointer + i] = handlers[length - (i + 1)];
|
|
711
|
-
}
|
|
712
|
-
|
|
713
|
-
for (i = stack_frame_end - 1; i >= stack_pointer; i--) {
|
|
714
|
-
h = dispatch_stack[i];
|
|
715
|
-
|
|
716
|
-
if (h.getFlag(SignalHandlerFlags.RemoveAfterExecution)) {
|
|
717
|
-
//handler should be cut
|
|
718
|
-
const p = handlers.indexOf(h);
|
|
719
|
-
handlers.splice(p, 1);
|
|
720
|
-
}
|
|
721
|
-
|
|
722
|
-
dispatchCallback(h.handle, h.context, args);
|
|
723
|
-
}
|
|
724
|
-
|
|
725
|
-
//drop stack frame
|
|
726
|
-
dispatch_stack_top = stack_pointer;
|
|
727
|
-
}
|
|
728
633
|
|
|
729
634
|
export default Signal;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dispatchViaProxy.d.ts","sourceRoot":"","sources":["../../../../../src/core/events/signal/dispatchViaProxy.js"],"names":[],"mappings":"AA2BA;;;;GAIG;AACH,2CAHW,eAAe,sBA8BzB"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { assert } from "../../assert.js";
|
|
2
|
+
import { SignalHandlerFlags } from "./SignalHandler.js";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Common dispatch stack
|
|
6
|
+
* @readonly
|
|
7
|
+
* @type {SignalHandler[]}
|
|
8
|
+
*/
|
|
9
|
+
const dispatch_stack = [];
|
|
10
|
+
let dispatch_stack_top = 0;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
*
|
|
14
|
+
* @param {function} f
|
|
15
|
+
* @param {*} context
|
|
16
|
+
* @param {Array} args
|
|
17
|
+
*/
|
|
18
|
+
function dispatchCallback(f, context, args) {
|
|
19
|
+
assert.isFunction(f, 'f');
|
|
20
|
+
|
|
21
|
+
try {
|
|
22
|
+
f.apply(context, args)
|
|
23
|
+
} catch (e) {
|
|
24
|
+
console.error("Failed to dispatch handler", f, e);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
* @param {SignalHandler[]} handlers
|
|
31
|
+
* @param {Array} [args]
|
|
32
|
+
*/
|
|
33
|
+
export function dispatchViaProxy(handlers, args) {
|
|
34
|
+
const length = handlers.length;
|
|
35
|
+
|
|
36
|
+
const stack_pointer = dispatch_stack_top;
|
|
37
|
+
const stack_frame_end = stack_pointer + length;
|
|
38
|
+
dispatch_stack_top = stack_frame_end;
|
|
39
|
+
|
|
40
|
+
let i, h;
|
|
41
|
+
for (i = 0; i < length; i++) {
|
|
42
|
+
//copy to proxy
|
|
43
|
+
dispatch_stack[stack_pointer + i] = handlers[length - (i + 1)];
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
for (i = stack_frame_end - 1; i >= stack_pointer; i--) {
|
|
47
|
+
h = dispatch_stack[i];
|
|
48
|
+
|
|
49
|
+
if (h.getFlag(SignalHandlerFlags.RemoveAfterExecution)) {
|
|
50
|
+
//handler should be cut
|
|
51
|
+
const p = handlers.indexOf(h);
|
|
52
|
+
handlers.splice(p, 1);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
dispatchCallback(h.handle, h.context, args);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
//drop stack frame
|
|
59
|
+
dispatch_stack_top = stack_pointer;
|
|
60
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @param {SignalHandler[]} handlers
|
|
4
|
+
* @param {function} f
|
|
5
|
+
* @param {*} [thisArg]
|
|
6
|
+
* @returns {number} index of the handler, or -1 if not found
|
|
7
|
+
*/
|
|
8
|
+
export function findSignalHandlerIndexByHandle(handlers: SignalHandler[], f: Function, thisArg?: any): number;
|
|
9
|
+
//# sourceMappingURL=findSignalHandlerIndexByHandle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"findSignalHandlerIndexByHandle.d.ts","sourceRoot":"","sources":["../../../../../src/core/events/signal/findSignalHandlerIndexByHandle.js"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,yDALW,eAAe,+BAGb,MAAM,CAoBlB"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @param {SignalHandler[]} handlers
|
|
4
|
+
* @param {function} f
|
|
5
|
+
* @param {*} [thisArg]
|
|
6
|
+
* @returns {number} index of the handler, or -1 if not found
|
|
7
|
+
*/
|
|
8
|
+
export function findSignalHandlerIndexByHandle(handlers, f, thisArg) {
|
|
9
|
+
const l = handlers.length;
|
|
10
|
+
|
|
11
|
+
for (let i = 0; i < l; i++) {
|
|
12
|
+
const signalHandler = handlers[i];
|
|
13
|
+
|
|
14
|
+
if (signalHandler.handle === f) {
|
|
15
|
+
|
|
16
|
+
if (thisArg !== undefined && thisArg !== signalHandler.context) {
|
|
17
|
+
//context variable doesn't match
|
|
18
|
+
continue;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
return i;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return -1;
|
|
26
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @param {SignalHandler[]} handlers
|
|
4
|
+
* @param {function} f
|
|
5
|
+
* @param {*} ctx
|
|
6
|
+
* @returns {number} index of the handler, or -1 if not found
|
|
7
|
+
*/
|
|
8
|
+
export function findSignalHandlerIndexByHandleAndContext(handlers: SignalHandler[], f: Function, ctx: any): number;
|
|
9
|
+
//# sourceMappingURL=findSignalHandlerIndexByHandleAndContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"findSignalHandlerIndexByHandleAndContext.d.ts","sourceRoot":"","sources":["../../../../../src/core/events/signal/findSignalHandlerIndexByHandleAndContext.js"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,mEALW,eAAe,0BAGb,MAAM,CAelB"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @param {SignalHandler[]} handlers
|
|
4
|
+
* @param {function} f
|
|
5
|
+
* @param {*} ctx
|
|
6
|
+
* @returns {number} index of the handler, or -1 if not found
|
|
7
|
+
*/
|
|
8
|
+
export function findSignalHandlerIndexByHandleAndContext(handlers, f, ctx) {
|
|
9
|
+
const l = handlers.length;
|
|
10
|
+
|
|
11
|
+
for (let i = 0; i < l; i++) {
|
|
12
|
+
const handler = handlers[i];
|
|
13
|
+
|
|
14
|
+
if (handler.handle === f && handler.context === ctx) {
|
|
15
|
+
return i;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return -1;
|
|
21
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SimpleStateMachine.d.ts","sourceRoot":"","sources":["../../../../../src/core/fsm/simple/SimpleStateMachine.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SimpleStateMachine.d.ts","sourceRoot":"","sources":["../../../../../src/core/fsm/simple/SimpleStateMachine.js"],"names":[],"mappings":"AAOA;IAuBI;;;OAGG;IACH,yBAFW,6BAA6B,EAUvC;IAjCD;;;;OAIG;IACH,gBAAa;IAEb;;;;OAIG;IACH,kCAA+B;IAE/B;;;;OAIG;IACH,iCAA8B;IAS1B;;;OAGG;IACH,aAFU,6BAA6B,CAET;IAGlC;;;;;OAKG;IACH,iCAJW,MAAM,0CAgBhB;IAED;;;;;OAKG;IACH,oCAJW,MAAM,6CAmBhB;IAED;;;;;OAKG;IACH,gCAJW,MAAM,0CAgBhB;IAED;;;;;OAKG;IACH,mCAJW,MAAM,6CAqBhB;IAED;;;OAGG;IACH,YAFW,MAAM,QAuBhB;IAED;;;OAGG;IACH,YAFa,MAAM,CAIlB;IAED;;;;OAIG;IACH,wBAFW,MAAM,QAyBhB;IAED;;;;;OAKG;IACH,sDAFY,OAAO,CAmClB;CACJ;8CAxO6C,oCAAoC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { dispatchViaProxy
|
|
1
|
+
import { dispatchViaProxy } from "../../events/signal/dispatchViaProxy.js";
|
|
2
|
+
import { findSignalHandlerIndexByHandle } from "../../events/signal/findSignalHandlerIndexByHandle.js";
|
|
2
3
|
import { SignalHandler } from "../../events/signal/SignalHandler.js";
|
|
3
4
|
|
|
4
5
|
import { noop } from "../../function/noop.js";
|
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
* @see A Survey of Efficient Representations for Independent Unit Vectors (Journal of Computer Graphics Techniques Vol. 3, No. 2, 2014) - page 13
|
|
5
5
|
* @see https://gamedev.stackexchange.com/questions/169508/octahedral-impostors-octahedral-mapping
|
|
6
6
|
*
|
|
7
|
-
* @param {number[]} output
|
|
7
|
+
* @param {number[]|Float32Array} output
|
|
8
8
|
* @param {number} output_offset
|
|
9
9
|
* @param {number} x range [-1,1]
|
|
10
10
|
* @param {number} y range [-1,1]
|
|
11
11
|
* @param {number} z range [-1,1]
|
|
12
12
|
*/
|
|
13
|
-
export function encode_unit_to_octahedron(output: number[], output_offset: number, x: number, y: number, z: number): void;
|
|
13
|
+
export function encode_unit_to_octahedron(output: number[] | Float32Array, output_offset: number, x: number, y: number, z: number): void;
|
|
14
14
|
//# sourceMappingURL=encode_unit_to_octahedron.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"encode_unit_to_octahedron.d.ts","sourceRoot":"","sources":["../../../../../../../src/core/geom/3d/normal/octahedron/encode_unit_to_octahedron.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AACH,kDANW,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"encode_unit_to_octahedron.d.ts","sourceRoot":"","sources":["../../../../../../../src/core/geom/3d/normal/octahedron/encode_unit_to_octahedron.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AACH,kDANW,MAAM,EAAE,GAAC,YAAY,iBACrB,MAAM,KACN,MAAM,KACN,MAAM,KACN,MAAM,QA0BhB"}
|
|
@@ -6,7 +6,7 @@ import { sign_not_zero } from "../../../../math/sign_not_zero.js";
|
|
|
6
6
|
* @see A Survey of Efficient Representations for Independent Unit Vectors (Journal of Computer Graphics Techniques Vol. 3, No. 2, 2014) - page 13
|
|
7
7
|
* @see https://gamedev.stackexchange.com/questions/169508/octahedral-impostors-octahedral-mapping
|
|
8
8
|
*
|
|
9
|
-
* @param {number[]} output
|
|
9
|
+
* @param {number[]|Float32Array} output
|
|
10
10
|
* @param {number} output_offset
|
|
11
11
|
* @param {number} x range [-1,1]
|
|
12
12
|
* @param {number} y range [-1,1]
|