|
@@ -7431,7 +7431,7 @@ class Plane {
|
|
|
}
|
|
|
|
|
|
// Unsure if this is the correct method to handle this case.
|
|
|
- return undefined;
|
|
|
+ return null;
|
|
|
|
|
|
}
|
|
|
|
|
@@ -7439,7 +7439,7 @@ class Plane {
|
|
|
|
|
|
if ( t < 0 || t > 1 ) {
|
|
|
|
|
|
- return undefined;
|
|
|
+ return null;
|
|
|
|
|
|
}
|
|
|
|
|
@@ -9402,13 +9402,19 @@ Object.assign( BufferAttribute.prototype, {
|
|
|
|
|
|
toJSON: function () {
|
|
|
|
|
|
- return {
|
|
|
+ const data = {
|
|
|
itemSize: this.itemSize,
|
|
|
type: this.array.constructor.name,
|
|
|
array: Array.prototype.slice.call( this.array ),
|
|
|
normalized: this.normalized
|
|
|
};
|
|
|
|
|
|
+ if ( this.name !== '' ) data.name = this.name;
|
|
|
+ if ( this.usage !== StaticDrawUsage ) data.usage = this.usage;
|
|
|
+ if ( this.updateRange.offset !== 0 || this.updateRange.count !== - 1 ) data.updateRange = this.updateRange;
|
|
|
+
|
|
|
+ return data;
|
|
|
+
|
|
|
}
|
|
|
|
|
|
} );
|
|
@@ -10447,6 +10453,8 @@ BufferGeometry.prototype = Object.assign( Object.create( EventDispatcher.prototy
|
|
|
|
|
|
}
|
|
|
|
|
|
+ // for simplicity the code assumes attributes are not shared across geometries, see #15811
|
|
|
+
|
|
|
data.data = { attributes: {} };
|
|
|
|
|
|
const index = this.index;
|
|
@@ -10466,11 +10474,7 @@ BufferGeometry.prototype = Object.assign( Object.create( EventDispatcher.prototy
|
|
|
|
|
|
const attribute = attributes[ key ];
|
|
|
|
|
|
- const attributeData = attribute.toJSON( data.data );
|
|
|
-
|
|
|
- if ( attribute.name !== '' ) attributeData.name = attribute.name;
|
|
|
-
|
|
|
- data.data.attributes[ key ] = attributeData;
|
|
|
+ data.data.attributes[ key ] = attribute.toJSON( data.data );
|
|
|
|
|
|
}
|
|
|
|
|
@@ -10487,11 +10491,7 @@ BufferGeometry.prototype = Object.assign( Object.create( EventDispatcher.prototy
|
|
|
|
|
|
const attribute = attributeArray[ i ];
|
|
|
|
|
|
- const attributeData = attribute.toJSON( data.data );
|
|
|
-
|
|
|
- if ( attribute.name !== '' ) attributeData.name = attribute.name;
|
|
|
-
|
|
|
- array.push( attributeData );
|
|
|
+ array.push( attribute.toJSON( data.data ) );
|
|
|
|
|
|
}
|
|
|
|
|
@@ -24010,12 +24010,6 @@ function WebGLRenderer( parameters ) {
|
|
|
|
|
|
if ( _isContextLost === true ) return;
|
|
|
|
|
|
- // reset caching for this frame
|
|
|
-
|
|
|
- bindingStates.resetDefaultState();
|
|
|
- _currentMaterialId = - 1;
|
|
|
- _currentCamera = null;
|
|
|
-
|
|
|
// update scene graph
|
|
|
|
|
|
if ( scene.autoUpdate === true ) scene.updateMatrixWorld();
|
|
@@ -24122,6 +24116,10 @@ function WebGLRenderer( parameters ) {
|
|
|
|
|
|
// _gl.finish();
|
|
|
|
|
|
+ bindingStates.resetDefaultState();
|
|
|
+ _currentMaterialId = - 1;
|
|
|
+ _currentCamera = null;
|
|
|
+
|
|
|
renderStateStack.pop();
|
|
|
|
|
|
if ( renderStateStack.length > 0 ) {
|
|
@@ -26763,12 +26761,10 @@ Line.prototype = Object.assign( Object.create( Object3D.prototype ), {
|
|
|
|
|
|
if ( index !== null ) {
|
|
|
|
|
|
- const indices = index.array;
|
|
|
+ for ( let i = 0, l = index.count - 1; i < l; i += step ) {
|
|
|
|
|
|
- for ( let i = 0, l = indices.length - 1; i < l; i += step ) {
|
|
|
-
|
|
|
- const a = indices[ i ];
|
|
|
- const b = indices[ i + 1 ];
|
|
|
+ const a = index.getX( i );
|
|
|
+ const b = index.getX( i + 1 );
|
|
|
|
|
|
vStart.fromBufferAttribute( positionAttribute, a );
|
|
|
vEnd.fromBufferAttribute( positionAttribute, b );
|
|
@@ -27088,11 +27084,9 @@ Points.prototype = Object.assign( Object.create( Object3D.prototype ), {
|
|
|
|
|
|
if ( index !== null ) {
|
|
|
|
|
|
- const indices = index.array;
|
|
|
-
|
|
|
- for ( let i = 0, il = indices.length; i < il; i ++ ) {
|
|
|
+ for ( let i = 0, il = index.count; i < il; i ++ ) {
|
|
|
|
|
|
- const a = indices[ i ];
|
|
|
+ const a = index.getX( i );
|
|
|
|
|
|
_position$1.fromBufferAttribute( positionAttribute, a );
|
|
|
|
|
@@ -38515,6 +38509,15 @@ class BufferGeometryLoader extends Loader {
|
|
|
}
|
|
|
|
|
|
if ( attribute.name !== undefined ) bufferAttribute.name = attribute.name;
|
|
|
+ if ( attribute.usage !== undefined ) bufferAttribute.setUsage( attribute.usage );
|
|
|
+
|
|
|
+ if ( attribute.updateRange !== undefined ) {
|
|
|
+
|
|
|
+ bufferAttribute.updateRange.offset = attribute.updateRange.offset;
|
|
|
+ bufferAttribute.updateRange.count = attribute.updateRange.count;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
geometry.setAttribute( key, bufferAttribute );
|
|
|
|
|
|
}
|