|
|
@@ -10881,7 +10881,9 @@ class BufferGeometry extends EventDispatcher {
|
|
|
|
|
|
} else {
|
|
|
|
|
|
- for ( let i = 0, l = positionAttribute.count; i < l; i ++ ) {
|
|
|
+ const l = Math.min( points.length, positionAttribute.count ); // make sure data do not exceed buffer size
|
|
|
+
|
|
|
+ for ( let i = 0; i < l; i ++ ) {
|
|
|
|
|
|
const point = points[ i ];
|
|
|
positionAttribute.setXYZ( i, point.x, point.y, point.z || 0 );
|
|
|
@@ -31253,6 +31255,43 @@ class Audio extends Object3D {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ copy( source, recursive ) {
|
|
|
+
|
|
|
+ super.copy( source, recursive );
|
|
|
+
|
|
|
+ if ( source.sourceType !== 'buffer' ) {
|
|
|
+
|
|
|
+ console.warn( 'THREE.Audio: Audio source type cannot be copied.' );
|
|
|
+
|
|
|
+ return this;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ this.autoplay = source.autoplay;
|
|
|
+
|
|
|
+ this.buffer = source.buffer;
|
|
|
+ this.detune = source.detune;
|
|
|
+ this.loop = source.loop;
|
|
|
+ this.loopStart = source.loopStart;
|
|
|
+ this.loopEnd = source.loopEnd;
|
|
|
+ this.offset = source.offset;
|
|
|
+ this.duration = source.duration;
|
|
|
+ this.playbackRate = source.playbackRate;
|
|
|
+ this.hasPlaybackControl = source.hasPlaybackControl;
|
|
|
+ this.sourceType = source.sourceType;
|
|
|
+
|
|
|
+ this.filters = source.filters.slice();
|
|
|
+
|
|
|
+ return this;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ clone( recursive ) {
|
|
|
+
|
|
|
+ return new this.constructor( this.listener ).copy( this, recursive );
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
const _position = /*@__PURE__*/ new Vector3();
|