Browse Source

Removed GeometryIdCount(). See #10095.

Mr.doob 7 years ago
parent
commit
8622b1938a
3 changed files with 7 additions and 12 deletions
  1. 1 1
      src/Three.js
  2. 3 2
      src/core/BufferGeometry.js
  3. 3 9
      src/core/Geometry.js

+ 1 - 1
src/Three.js

@@ -84,7 +84,7 @@ export { AnimationClip } from './animation/AnimationClip.js';
 export { Uniform } from './core/Uniform.js';
 export { Uniform } from './core/Uniform.js';
 export { InstancedBufferGeometry } from './core/InstancedBufferGeometry.js';
 export { InstancedBufferGeometry } from './core/InstancedBufferGeometry.js';
 export { BufferGeometry } from './core/BufferGeometry.js';
 export { BufferGeometry } from './core/BufferGeometry.js';
-export { GeometryIdCount, Geometry } from './core/Geometry.js';
+export { Geometry } from './core/Geometry.js';
 export { InterleavedBufferAttribute } from './core/InterleavedBufferAttribute.js';
 export { InterleavedBufferAttribute } from './core/InterleavedBufferAttribute.js';
 export { InstancedInterleavedBuffer } from './core/InstancedInterleavedBuffer.js';
 export { InstancedInterleavedBuffer } from './core/InstancedInterleavedBuffer.js';
 export { InterleavedBuffer } from './core/InterleavedBuffer.js';
 export { InterleavedBuffer } from './core/InterleavedBuffer.js';

+ 3 - 2
src/core/BufferGeometry.js

@@ -9,16 +9,17 @@ import { Matrix4 } from '../math/Matrix4.js';
 import { Matrix3 } from '../math/Matrix3.js';
 import { Matrix3 } from '../math/Matrix3.js';
 import { _Math } from '../math/Math.js';
 import { _Math } from '../math/Math.js';
 import { arrayMax } from '../utils.js';
 import { arrayMax } from '../utils.js';
-import { GeometryIdCount } from './Geometry.js';
 
 
 /**
 /**
  * @author alteredq / http://alteredqualia.com/
  * @author alteredq / http://alteredqualia.com/
  * @author mrdoob / http://mrdoob.com/
  * @author mrdoob / http://mrdoob.com/
  */
  */
 
 
+var bufferGeometryId = 1; // BufferGeometry uses odd numbers as Id
+
 function BufferGeometry() {
 function BufferGeometry() {
 
 
-	Object.defineProperty( this, 'id', { value: GeometryIdCount() } );
+	Object.defineProperty( this, 'id', { value: bufferGeometryId += 2 } );
 
 
 	this.uuid = _Math.generateUUID();
 	this.uuid = _Math.generateUUID();
 
 

+ 3 - 9
src/core/Geometry.js

@@ -19,17 +19,11 @@ import { _Math } from '../math/Math.js';
  * @author bhouston / http://clara.io
  * @author bhouston / http://clara.io
  */
  */
 
 
-var count = 0;
-
-function GeometryIdCount() {
-
-	return count ++;
-
-}
+var geometryId = 0; // Geometry uses even numbers as Id
 
 
 function Geometry() {
 function Geometry() {
 
 
-	Object.defineProperty( this, 'id', { value: GeometryIdCount() } );
+	Object.defineProperty( this, 'id', { value: geometryId += 2 } );
 
 
 	this.uuid = _Math.generateUUID();
 	this.uuid = _Math.generateUUID();
 
 
@@ -1440,4 +1434,4 @@ Object.assign( Geometry.prototype, EventDispatcher.prototype, {
 } );
 } );
 
 
 
 
-export { GeometryIdCount, Geometry };
+export { Geometry };