Преглед на файлове

Merge pull request #13868 from takahirox/BufferAttributeSetArray

BufferAttribute.setArray method chaining
Mr.doob преди 7 години
родител
ревизия
eb352054a2
променени са 4 файла, в които са добавени 14 реда и са изтрити 10 реда
  1. 9 9
      docs/api/core/BufferAttribute.html
  2. 1 1
      docs/api/core/InterleavedBuffer.html
  3. 2 0
      src/core/BufferAttribute.js
  4. 2 0
      src/core/InterleavedBuffer.js

+ 9 - 9
docs/api/core/BufferAttribute.html

@@ -163,7 +163,7 @@
 		after the buffer has been	transfered to the GPU.
 		after the buffer has been	transfered to the GPU.
 		</p>
 		</p>
 
 
-		<h3>[method:null set] ( [param:Array value], [param:Integer offset] ) </h3>
+		<h3>[method:BufferAttribute set] ( [param:Array value], [param:Integer offset] ) </h3>
 		<p>
 		<p>
 		value -- an [page:Array] or [page:TypedArray] from which to copy values. <br />
 		value -- an [page:Array] or [page:TypedArray] from which to copy values. <br />
 		offset -- (optional) index of the [page:BufferAttribute.array array] at which to start copying.<br /><br />
 		offset -- (optional) index of the [page:BufferAttribute.array array] at which to start copying.<br /><br />
@@ -175,7 +175,7 @@
 		being a [page:TypedArray].
 		being a [page:TypedArray].
 		</p>
 		</p>
 
 
-		<h3>[method:null setArray] ( [param:TypedArray array] ) </h3>
+		<h3>[method:BufferAttribute setArray] ( [param:TypedArray array] ) </h3>
 		<p>
 		<p>
 		[page:BufferAttribute.array array] to the TypedArray passed in here.<br /><br />
 		[page:BufferAttribute.array array] to the TypedArray passed in here.<br /><br />
 
 
@@ -185,25 +185,25 @@
 		<h3>[method:BufferAttribute setDynamic] ( [param:Boolean value] ) </h3>
 		<h3>[method:BufferAttribute setDynamic] ( [param:Boolean value] ) </h3>
 		<p>Set [page:BufferAttribute.dynamic dynamic] to value.</p>
 		<p>Set [page:BufferAttribute.dynamic dynamic] to value.</p>
 
 
-		<h3>[method:null setX]( index, x ) </h3>
+		<h3>[method:BufferAttribute setX]( index, x ) </h3>
 		<p>Sets the x component of the vector at the given index.</p>
 		<p>Sets the x component of the vector at the given index.</p>
 
 
-		<h3>[method:null setY]( index, y ) </h3>
+		<h3>[method:BufferAttribute setY]( index, y ) </h3>
 		<p>Sets the y component of the vector at the given index.</p>
 		<p>Sets the y component of the vector at the given index.</p>
 
 
-		<h3>[method:null setZ]( index, z ) </h3>
+		<h3>[method:BufferAttribute setZ]( index, z ) </h3>
 		<p>Sets the z component of the vector at the given index.</p>
 		<p>Sets the z component of the vector at the given index.</p>
 
 
-		<h3>[method:null setW]( index, w ) </h3>
+		<h3>[method:BufferAttribute setW]( index, w ) </h3>
 		<p>Sets the w component of the vector at the given index.</p>
 		<p>Sets the w component of the vector at the given index.</p>
 
 
-		<h3>[method:null setXY]( index, x, y ) </h3>
+		<h3>[method:BufferAttribute setXY]( index, x, y ) </h3>
 		<p>Sets the x and y components of the vector at the given index.</p>
 		<p>Sets the x and y components of the vector at the given index.</p>
 
 
-		<h3>[method:null setXYZ]( index, x, y, z ) </h3>
+		<h3>[method:BufferAttribute setXYZ]( index, x, y, z ) </h3>
 		<p>Sets the x, y and z components of the vector at the given index.</p>
 		<p>Sets the x, y and z components of the vector at the given index.</p>
 
 
-		<h3>[method:null setXYZW]( index, x, y, z, w ) </h3>
+		<h3>[method:BufferAttribute setXYZW]( index, x, y, z, w ) </h3>
 		<p>Sets the x, y, z and w components of the vector at the given index.</p>
 		<p>Sets the x, y, z and w components of the vector at the given index.</p>
 
 
 
 

+ 1 - 1
docs/api/core/InterleavedBuffer.html

@@ -81,7 +81,7 @@
 
 
 		<h2>Methods</h2>
 		<h2>Methods</h2>
 
 
-		<h3>[method:null setArray] ( [param:TypedArray array] ) </h3>
+		<h3>[method:InterleavedBuffer setArray] ( [param:TypedArray array] ) </h3>
 		<p>
 		<p>
 		 array - must be  a Typed Array.
 		 array - must be  a Typed Array.
 		</p>
 		</p>

+ 2 - 0
src/core/BufferAttribute.js

@@ -56,6 +56,8 @@ Object.assign( BufferAttribute.prototype, {
 		this.count = array !== undefined ? array.length / this.itemSize : 0;
 		this.count = array !== undefined ? array.length / this.itemSize : 0;
 		this.array = array;
 		this.array = array;
 
 
+		return this;
+
 	},
 	},
 
 
 	setDynamic: function ( value ) {
 	setDynamic: function ( value ) {

+ 2 - 0
src/core/InterleavedBuffer.js

@@ -43,6 +43,8 @@ Object.assign( InterleavedBuffer.prototype, {
 		this.count = array !== undefined ? array.length / this.stride : 0;
 		this.count = array !== undefined ? array.length / this.stride : 0;
 		this.array = array;
 		this.array = array;
 
 
+		return this;
+
 	},
 	},
 
 
 	setDynamic: function ( value ) {
 	setDynamic: function ( value ) {