|
@@ -4,7 +4,7 @@
|
|
|
|
|
|
function WebGLObjects( gl, geometries, attributes, info ) {
|
|
|
|
|
|
- var updateList = {};
|
|
|
+ var updateMap = new WeakMap();
|
|
|
|
|
|
function update( object ) {
|
|
|
|
|
@@ -15,7 +15,7 @@ function WebGLObjects( gl, geometries, attributes, info ) {
|
|
|
|
|
|
// Update once per frame
|
|
|
|
|
|
- if ( updateList[ buffergeometry.id ] !== frame ) {
|
|
|
+ if ( updateMap.get( buffergeometry ) !== frame ) {
|
|
|
|
|
|
if ( geometry.isGeometry ) {
|
|
|
|
|
@@ -25,7 +25,7 @@ function WebGLObjects( gl, geometries, attributes, info ) {
|
|
|
|
|
|
geometries.update( buffergeometry );
|
|
|
|
|
|
- updateList[ buffergeometry.id ] = frame;
|
|
|
+ updateMap.set( buffergeometry, frame );
|
|
|
|
|
|
}
|
|
|
|
|
@@ -41,7 +41,7 @@ function WebGLObjects( gl, geometries, attributes, info ) {
|
|
|
|
|
|
function dispose() {
|
|
|
|
|
|
- updateList = {};
|
|
|
+ updateMap.clear();
|
|
|
|
|
|
}
|
|
|
|