|
@@ -1,8 +1,11 @@
|
|
|
+import { Vector3 } from '../math/Vector3.js';
|
|
|
|
|
|
/**
|
|
|
* @author benaadams / https://twitter.com/ben_a_adams
|
|
|
*/
|
|
|
|
|
|
+var _vector = new Vector3();
|
|
|
+
|
|
|
function InterleavedBufferAttribute( interleavedBuffer, itemSize, offset, normalized ) {
|
|
|
|
|
|
this.data = interleavedBuffer;
|
|
@@ -41,6 +44,24 @@ Object.assign( InterleavedBufferAttribute.prototype, {
|
|
|
|
|
|
isInterleavedBufferAttribute: true,
|
|
|
|
|
|
+ applyMatrix4: function ( m ) {
|
|
|
+
|
|
|
+ for ( var i = 0, l = this.data.count; i < l; i ++ ) {
|
|
|
+
|
|
|
+ _vector.x = this.getX( i );
|
|
|
+ _vector.y = this.getY( i );
|
|
|
+ _vector.z = this.getZ( i );
|
|
|
+
|
|
|
+ _vector.applyMatrix4( m );
|
|
|
+
|
|
|
+ this.setXYZ( i, _vector.x, _vector.y, _vector.z );
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ return this;
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
setX: function ( index, x ) {
|
|
|
|
|
|
this.data.array[ index * this.data.stride + this.offset ] = x;
|