Browse Source

Merge pull request #19864 from Mugen87/dev51

InterleavedBufferAttribute: Introduce needsUpdate.
Mr.doob 5 years ago
parent
commit
c144af8f67

+ 7 - 2
docs/api/en/core/InterleavedBufferAttribute.html

@@ -50,9 +50,9 @@
 		Optional name for this attribute instance. Default is an empty string.
 		</p>
 
-		<h3>[property:Integer offset]</h3>
+		<h3>[property:Boolean needsUpdate]</h3>
 		<p>
-			The offset in the underlying array buffer where an item starts.
+			Default is *false*. Setting this to *true* will send the entire interleaved buffer (not just the specific attribute data) to the GPU again.
 		</p>
 
 		<h3>[property:Boolean normalized]</h3>
@@ -60,6 +60,11 @@
 			Default is *false*.
 		</p>
 
+		<h3>[property:Integer offset]</h3>
+		<p>
+			The offset in the underlying array buffer where an item starts.
+		</p>
+
 		<h2>Methods</h2>
 
 		<h3>[method:this applyMatrix4]( [param:Matrix4 m] )</h3>

+ 7 - 2
docs/api/zh/core/InterleavedBufferAttribute.html

@@ -49,9 +49,9 @@
 		Optional name for this attribute instance. Default is an empty string.
 		</p>
 
-		<h3>[property:Integer offset]</h3>
+		<h3>[property:Boolean needsUpdate]</h3>
 		<p>
-			缓存队列中每个元素的起始位置的偏移量。
+			Default is *false*. Setting this to *true* will send the entire interleaved buffer (not just the specific attribute data) to the GPU again.
 		</p>
 
 		<h3>[property:Boolean normalized]</h3>
@@ -59,6 +59,11 @@
 			默认值为 *false*。
 		</p>
 
+		<h3>[property:Integer offset]</h3>
+		<p>
+			缓存队列中每个元素的起始位置的偏移量。
+		</p>
+
 		<h2>方法</h2>
 
 		<h3>[method:Number getX]( [param:Integer index] ) </h3>

+ 1 - 0
src/core/InterleavedBufferAttribute.d.ts

@@ -21,6 +21,7 @@ export class InterleavedBufferAttribute {
 
 	get count(): number;
 	get array(): ArrayLike<number>;
+	set needsUpdate( value: boolean );
 
 	readonly isInterleavedBufferAttribute: true;
 

+ 10 - 0
src/core/InterleavedBufferAttribute.js

@@ -39,6 +39,16 @@ Object.defineProperties( InterleavedBufferAttribute.prototype, {
 
 		}
 
+	},
+
+	needsUpdate: {
+
+		set: function ( value ) {
+
+			this.data.needsUpdate = value;
+
+		}
+
 	}
 
 } );