提交 9b6bc255 编写于 作者: M Mr.doob

Removed ObjectIdCount, MaterialIdCount and TextureIdCount. See #10095.

上级 5c42464f
......@@ -27,10 +27,9 @@ export { CompressedTexture } from './textures/CompressedTexture.js';
export { CubeTexture } from './textures/CubeTexture.js';
export { CanvasTexture } from './textures/CanvasTexture.js';
export { DepthTexture } from './textures/DepthTexture.js';
export { TextureIdCount, Texture } from './textures/Texture.js';
export { Texture } from './textures/Texture.js';
export * from './geometries/Geometries.js';
export * from './materials/Materials.js';
export { MaterialIdCount } from './materials/Material.js';
export { CompressedTextureLoader } from './loaders/CompressedTextureLoader.js';
export { BinaryTextureLoader, DataTextureLoader } from './loaders/BinaryTextureLoader.js';
export { CubeTextureLoader } from './loaders/CubeTextureLoader.js';
......@@ -100,7 +99,7 @@ export {
BufferAttribute
} from './core/BufferAttribute.js';
export { Face3 } from './core/Face3.js';
export { Object3DIdCount, Object3D } from './core/Object3D.js';
export { Object3D } from './core/Object3D.js';
export { Raycaster } from './core/Raycaster.js';
export { Layers } from './core/Layers.js';
export { EventDispatcher } from './core/EventDispatcher.js';
......
......@@ -15,9 +15,11 @@ import { _Math } from '../math/Math';
* @author elephantatwork / www.elephantatwork.ch
*/
var object3DId = 0;
function Object3D() {
Object.defineProperty( this, 'id', { value: Object3DIdCount() } );
Object.defineProperty( this, 'id', { value: object3DId ++ } );
this.uuid = _Math.generateUUID();
......@@ -91,7 +93,7 @@ function Object3D() {
this.userData = {};
this.onBeforeRender = function(){};
this.onBeforeRender = function(){};
this.onAfterRender = function(){};
}
......@@ -727,8 +729,4 @@ Object.assign( Object3D.prototype, EventDispatcher.prototype, {
} );
var count = 0;
function Object3DIdCount() { return count++; };
export { Object3DIdCount, Object3D };
export { Object3D };
......@@ -7,9 +7,11 @@ import { _Math } from '../math/Math';
* @author alteredq / http://alteredqualia.com/
*/
var materialId = 0;
function Material() {
Object.defineProperty( this, 'id', { value: MaterialIdCount() } );
Object.defineProperty( this, 'id', { value: materialId ++ } );
this.uuid = _Math.generateUUID();
......@@ -342,8 +344,4 @@ Material.prototype = {
Object.assign( Material.prototype, EventDispatcher.prototype );
var count = 0;
function MaterialIdCount() { return count++; };
export { MaterialIdCount, Material };
export { Material };
......@@ -10,9 +10,11 @@ import { Vector2 } from '../math/Vector2';
* @author szimek / https://github.com/szimek/
*/
var textureId = 0;
function Texture( image, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, encoding ) {
Object.defineProperty( this, 'id', { value: TextureIdCount() } );
Object.defineProperty( this, 'id', { value: textureId ++ } );
this.uuid = _Math.generateUUID();
......@@ -47,7 +49,7 @@ function Texture( image, mapping, wrapS, wrapT, magFilter, minFilter, format, ty
//
// Also changing the encoding after already used by a Material will not automatically make the Material
// update. You need to explicitly call Material.needsUpdate to trigger it to recompile.
this.encoding = encoding !== undefined ? encoding : LinearEncoding;
this.encoding = encoding !== undefined ? encoding : LinearEncoding;
this.version = 0;
this.onUpdate = null;
......@@ -206,7 +208,7 @@ Texture.prototype = {
transformUv: function ( uv ) {
if ( this.mapping !== UVMapping ) return;
if ( this.mapping !== UVMapping ) return;
uv.multiply( this.repeat );
uv.add( this.offset );
......@@ -285,8 +287,4 @@ Texture.prototype = {
Object.assign( Texture.prototype, EventDispatcher.prototype );
var count = 0;
function TextureIdCount() { return count++; };
export { TextureIdCount, Texture };
export { Texture };
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册