diff --git a/src/Three.js b/src/Three.js index c7e488812a4f741f528d1f9fbb7124b04bdd9323..0323b92b00f5c788407475e67d53fb27b1df84c5 100644 --- a/src/Three.js +++ b/src/Three.js @@ -84,7 +84,7 @@ export { AnimationClip } from './animation/AnimationClip.js'; export { Uniform } from './core/Uniform.js'; export { InstancedBufferGeometry } from './core/InstancedBufferGeometry.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 { InstancedInterleavedBuffer } from './core/InstancedInterleavedBuffer.js'; export { InterleavedBuffer } from './core/InterleavedBuffer.js'; diff --git a/src/core/BufferGeometry.js b/src/core/BufferGeometry.js index c81ebffd5ead64e81a30587bbd14c44631a73166..16ab3421dcf9cf8f6a452fd57e444c78186ecc0e 100644 --- a/src/core/BufferGeometry.js +++ b/src/core/BufferGeometry.js @@ -9,16 +9,17 @@ import { Matrix4 } from '../math/Matrix4.js'; import { Matrix3 } from '../math/Matrix3.js'; import { _Math } from '../math/Math.js'; import { arrayMax } from '../utils.js'; -import { GeometryIdCount } from './Geometry.js'; /** * @author alteredq / http://alteredqualia.com/ * @author mrdoob / http://mrdoob.com/ */ +var bufferGeometryId = 1; // BufferGeometry uses odd numbers as Id + function BufferGeometry() { - Object.defineProperty( this, 'id', { value: GeometryIdCount() } ); + Object.defineProperty( this, 'id', { value: bufferGeometryId += 2 } ); this.uuid = _Math.generateUUID(); diff --git a/src/core/Geometry.js b/src/core/Geometry.js index 0018e0af8308086fec9c2ea3bbdf473367e030d9..c470556d0785c242d9fe2eec76ba38fa5052d4cb 100644 --- a/src/core/Geometry.js +++ b/src/core/Geometry.js @@ -19,17 +19,11 @@ import { _Math } from '../math/Math.js'; * @author bhouston / http://clara.io */ -var count = 0; - -function GeometryIdCount() { - - return count ++; - -} +var geometryId = 0; // Geometry uses even numbers as Id function Geometry() { - Object.defineProperty( this, 'id', { value: GeometryIdCount() } ); + Object.defineProperty( this, 'id', { value: geometryId += 2 } ); this.uuid = _Math.generateUUID(); @@ -1440,4 +1434,4 @@ Object.assign( Geometry.prototype, EventDispatcher.prototype, { } ); -export { GeometryIdCount, Geometry }; +export { Geometry };