|
@@ -1,5 +1,5 @@
|
|
|
import { NodeUpdateType } from './constants.js';
|
|
import { NodeUpdateType } from './constants.js';
|
|
|
-import { getNodeChildren, getCacheKey } from './NodeUtils.js';
|
|
|
|
|
|
|
+import { getNodeChildren, getCacheKey, hash } from './NodeUtils.js';
|
|
|
|
|
|
|
|
import { EventDispatcher } from '../../core/EventDispatcher.js';
|
|
import { EventDispatcher } from '../../core/EventDispatcher.js';
|
|
|
import { MathUtils } from '../../math/MathUtils.js';
|
|
import { MathUtils } from '../../math/MathUtils.js';
|
|
@@ -320,7 +320,7 @@ class Node extends EventDispatcher {
|
|
|
|
|
|
|
|
if ( force === true || this._cacheKey === null ) {
|
|
if ( force === true || this._cacheKey === null ) {
|
|
|
|
|
|
|
|
- this._cacheKey = getCacheKey( this, force );
|
|
|
|
|
|
|
+ this._cacheKey = hash( getCacheKey( this, force ), this.customCacheKey() );
|
|
|
this._cacheKeyVersion = this.version;
|
|
this._cacheKeyVersion = this.version;
|
|
|
|
|
|
|
|
}
|
|
}
|
|
@@ -329,6 +329,18 @@ class Node extends EventDispatcher {
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Generate a custom cache key for this node.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return {Number} The cache key of the node.
|
|
|
|
|
+ * @default 0
|
|
|
|
|
+ */
|
|
|
|
|
+ customCacheKey() {
|
|
|
|
|
+
|
|
|
|
|
+ return 0;
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* Returns the references to this node which is by default `this`.
|
|
* Returns the references to this node which is by default `this`.
|
|
|
*
|
|
*
|