preact
This commit is contained in:
parent
6acf267d48
commit
b7614eb3f8
4794 changed files with 1280808 additions and 1546 deletions
54
frontend/node_modules/three/examples/jsm/renderers/common/DataMap.js
generated
vendored
Normal file
54
frontend/node_modules/three/examples/jsm/renderers/common/DataMap.js
generated
vendored
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
class DataMap {
|
||||
|
||||
constructor() {
|
||||
|
||||
this.data = new WeakMap();
|
||||
|
||||
}
|
||||
|
||||
get( object ) {
|
||||
|
||||
let map = this.data.get( object );
|
||||
|
||||
if ( map === undefined ) {
|
||||
|
||||
map = {};
|
||||
this.data.set( object, map );
|
||||
|
||||
}
|
||||
|
||||
return map;
|
||||
|
||||
}
|
||||
|
||||
delete( object ) {
|
||||
|
||||
let map;
|
||||
|
||||
if ( this.data.has( object ) ) {
|
||||
|
||||
map = this.data.get( object );
|
||||
|
||||
this.data.delete( object );
|
||||
|
||||
}
|
||||
|
||||
return map;
|
||||
|
||||
}
|
||||
|
||||
has( object ) {
|
||||
|
||||
return this.data.has( object );
|
||||
|
||||
}
|
||||
|
||||
dispose() {
|
||||
|
||||
this.data = new WeakMap();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default DataMap;
|
||||
Loading…
Add table
Add a link
Reference in a new issue