Browse Source

rename to ExternalBufferAttribute

raub 7 years ago
parent
commit
36425d2f3f

+ 2 - 2
examples/webgl_buffergeometry_points_dynamicbufferattribute.html → examples/webgl_buffergeometry_points_externalbufferattribute.html

@@ -122,7 +122,7 @@
 				gl.bindBuffer(gl.ARRAY_BUFFER, rgb);
 				gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(colors), gl.STATIC_DRAW);
 
-				var posAttr = new THREE.DynamicBufferAttribute( gl, pos, gl.FLOAT, 3, particles );
+				var posAttr = new THREE.ExternalBufferAttribute( gl, pos, gl.FLOAT, 3, particles );
 				geometry.addAttribute( 'position', posAttr );
 
 				setInterval(function () {
@@ -136,7 +136,7 @@
 					geometry.setDrawRange(0, drawCount);
 				}, 20);
 
-				geometry.addAttribute( 'color', new THREE.DynamicBufferAttribute( gl, rgb, gl.FLOAT, 3, particles ) );
+				geometry.addAttribute( 'color', new THREE.ExternalBufferAttribute( gl, rgb, gl.FLOAT, 3, particles ) );
 
 				geometry.computeBoundingSphere();
 

+ 1 - 1
src/Three.js

@@ -90,7 +90,7 @@ export { InterleavedBufferAttribute } from './core/InterleavedBufferAttribute.js
 export { InstancedInterleavedBuffer } from './core/InstancedInterleavedBuffer.js';
 export { InterleavedBuffer } from './core/InterleavedBuffer.js';
 export { InstancedBufferAttribute } from './core/InstancedBufferAttribute.js';
-export { DynamicBufferAttribute } from './core/DynamicBufferAttribute.js';
+export { ExternalBufferAttribute } from './core/ExternalBufferAttribute.js';
 export * from './core/BufferAttribute.js';
 export { Face3 } from './core/Face3.js';
 export { Object3D } from './core/Object3D.js';

+ 3 - 3
src/core/BufferGeometry.js

@@ -68,7 +68,7 @@ BufferGeometry.prototype = Object.assign( Object.create( EventDispatcher.prototy
 
 	addAttribute: function ( name, attribute ) {
 
-		if ( ! (attribute && (attribute.isBufferAttribute || attribute.isInterleavedBufferAttribute || attribute.isDynamicBufferAttribute) ) ) {
+		if ( ! (attribute && (attribute.isBufferAttribute || attribute.isInterleavedBufferAttribute || attribute.isExternalBufferAttribute) ) ) {
 
 			console.warn( 'THREE.BufferGeometry: .addAttribute() now expects ( name, attribute ).' );
 
@@ -598,7 +598,7 @@ BufferGeometry.prototype = Object.assign( Object.create( EventDispatcher.prototy
 
 		var position = this.attributes.position;
 
-		if ( position && position.isDynamicBufferAttribute ) {
+		if ( position && position.isExternalBufferAttribute ) {
 
 			this.boundingBox.set(
 				new Vector3( - Infinity, - Infinity, - Infinity ),
@@ -642,7 +642,7 @@ BufferGeometry.prototype = Object.assign( Object.create( EventDispatcher.prototy
 
 			var position = this.attributes.position;
 
-			if ( position && position.isDynamicBufferAttribute ) {
+			if ( position && position.isExternalBufferAttribute ) {
 
 				this.boundingSphere.set(new Vector3(), Infinity)
 

+ 7 - 7
src/core/DynamicBufferAttribute.js → src/core/ExternalBufferAttribute.js

@@ -5,7 +5,7 @@ import { _Math } from '../math/Math.js';
  */
 
 
-function DynamicBufferAttribute( gl, buffer, type, itemSize, count ) {
+function ExternalBufferAttribute( gl, buffer, type, itemSize, count ) {
 
 	this.sizes = [
 		[gl.FLOAT, 4],
@@ -21,7 +21,7 @@ function DynamicBufferAttribute( gl, buffer, type, itemSize, count ) {
 	}, {});
 
 	if ( ! this.sizes[type] ) {
-		throw new TypeError( 'THREE.DynamicBufferAttribute: unsupported GL data type.' );
+		throw new TypeError( 'THREE.ExternalBufferAttribute: unsupported GL data type.' );
 	}
 
 	this.uuid = _Math.generateUUID();
@@ -36,7 +36,7 @@ function DynamicBufferAttribute( gl, buffer, type, itemSize, count ) {
 
 }
 
-Object.defineProperty( DynamicBufferAttribute.prototype, 'needsUpdate', {
+Object.defineProperty( ExternalBufferAttribute.prototype, 'needsUpdate', {
 
 	set: function ( value ) {
 
@@ -46,9 +46,9 @@ Object.defineProperty( DynamicBufferAttribute.prototype, 'needsUpdate', {
 
 } );
 
-Object.assign( DynamicBufferAttribute.prototype, {
+Object.assign( ExternalBufferAttribute.prototype, {
 
-	isDynamicBufferAttribute: true,
+	isExternalBufferAttribute: true,
 
 	setBuffer: function ( buffer ) {
 
@@ -61,7 +61,7 @@ Object.assign( DynamicBufferAttribute.prototype, {
 	setType: function ( type ) {
 
 		if ( ! sizes[type] ) {
-			throw new TypeError( 'THREE.DynamicBufferAttribute: unsupported GL data type.' );
+			throw new TypeError( 'THREE.ExternalBufferAttribute: unsupported GL data type.' );
 		}
 
 		this.type = type;
@@ -90,4 +90,4 @@ Object.assign( DynamicBufferAttribute.prototype, {
 } );
 
 
-export { DynamicBufferAttribute };
+export { ExternalBufferAttribute };

+ 1 - 1
src/renderers/webgl/WebGLAttributes.js

@@ -123,7 +123,7 @@ function WebGLAttributes( gl ) {
 
 	function update( attribute, bufferType ) {
 
-		if (attribute.isDynamicBufferAttribute) {
+		if (attribute.isExternalBufferAttribute) {
 
 			var cached = buffers[ attribute.uuid ];