@woosh/meep-engine 2.110.1 → 2.110.2
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 +13 -5
- package/build/meep.min.js +1 -1
- package/build/meep.module.js +13 -5
- package/package.json +1 -1
- package/src/core/model/object/ObjectPoolFactory.d.ts +7 -7
- package/src/core/model/object/ObjectPoolFactory.d.ts.map +1 -1
- package/src/core/model/object/ObjectPoolFactory.js +16 -6
- package/src/engine/ecs/ik/IKProblem.d.ts +2 -1
- package/src/engine/ecs/ik/IKProblem.d.ts.map +1 -1
package/build/meep.cjs
CHANGED
|
@@ -97940,15 +97940,21 @@ class ImmutableObjectPool {
|
|
|
97940
97940
|
}
|
|
97941
97941
|
}
|
|
97942
97942
|
|
|
97943
|
+
/**
|
|
97944
|
+
* @template T
|
|
97945
|
+
*/
|
|
97943
97946
|
class ObjectPoolFactory {
|
|
97944
97947
|
/**
|
|
97945
|
-
* @template T
|
|
97946
97948
|
* @param {function():T} creator
|
|
97947
97949
|
* @param {function(T)} destroyer
|
|
97948
97950
|
* @param {function(T)} resetter
|
|
97949
|
-
* @constructor
|
|
97950
97951
|
*/
|
|
97951
|
-
constructor(
|
|
97952
|
+
constructor(
|
|
97953
|
+
creator,
|
|
97954
|
+
destroyer = noop,
|
|
97955
|
+
resetter = noop
|
|
97956
|
+
) {
|
|
97957
|
+
|
|
97952
97958
|
/**
|
|
97953
97959
|
* @private
|
|
97954
97960
|
* @type {function(): T}
|
|
@@ -97972,7 +97978,6 @@ class ObjectPoolFactory {
|
|
|
97972
97978
|
this.pool = [];
|
|
97973
97979
|
|
|
97974
97980
|
/**
|
|
97975
|
-
* @private
|
|
97976
97981
|
* @type {number}
|
|
97977
97982
|
*/
|
|
97978
97983
|
this.maxSize = 256;
|
|
@@ -97990,17 +97995,20 @@ class ObjectPoolFactory {
|
|
|
97990
97995
|
this.resetter(oldInstance);
|
|
97991
97996
|
|
|
97992
97997
|
return oldInstance;
|
|
97998
|
+
|
|
97993
97999
|
} else {
|
|
98000
|
+
|
|
97994
98001
|
const newInstance = this.creator();
|
|
97995
98002
|
|
|
97996
98003
|
return newInstance;
|
|
98004
|
+
|
|
97997
98005
|
}
|
|
97998
98006
|
}
|
|
97999
98007
|
|
|
98000
98008
|
/**
|
|
98001
98009
|
*
|
|
98002
98010
|
* @param {T} object
|
|
98003
|
-
* @returns {boolean}
|
|
98011
|
+
* @returns {boolean} true if object was added back to the pool, false if pool was full and object was destroyed instead
|
|
98004
98012
|
*/
|
|
98005
98013
|
release(object) {
|
|
98006
98014
|
|