|
@@ -9617,29 +9617,6 @@ BufferGeometry.prototype = Object.assign( Object.create( EventDispatcher.prototy
|
|
|
|
|
|
},
|
|
|
|
|
|
- addAttribute: function ( name, attribute ) {
|
|
|
-
|
|
|
- if ( ! ( attribute && attribute.isBufferAttribute ) && ! ( attribute && attribute.isInterleavedBufferAttribute ) ) {
|
|
|
-
|
|
|
- console.warn( 'THREE.BufferGeometry: .addAttribute() now expects ( name, attribute ).' );
|
|
|
-
|
|
|
- return this.addAttribute( name, new BufferAttribute( arguments[ 1 ], arguments[ 2 ] ) );
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- if ( name === 'index' ) {
|
|
|
-
|
|
|
- console.warn( 'THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute.' );
|
|
|
- this.setIndex( attribute );
|
|
|
-
|
|
|
- return this;
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- return this.setAttribute( name, attribute );
|
|
|
-
|
|
|
- },
|
|
|
-
|
|
|
getAttribute: function ( name ) {
|
|
|
|
|
|
return this.attributes[ name ];
|
|
@@ -9654,7 +9631,7 @@ BufferGeometry.prototype = Object.assign( Object.create( EventDispatcher.prototy
|
|
|
|
|
|
},
|
|
|
|
|
|
- removeAttribute: function ( name ) {
|
|
|
+ deleteAttribute: function ( name ) {
|
|
|
|
|
|
delete this.attributes[ name ];
|
|
|
|
|
@@ -9832,14 +9809,14 @@ BufferGeometry.prototype = Object.assign( Object.create( EventDispatcher.prototy
|
|
|
var positions = new Float32BufferAttribute( geometry.vertices.length * 3, 3 );
|
|
|
var colors = new Float32BufferAttribute( geometry.colors.length * 3, 3 );
|
|
|
|
|
|
- this.addAttribute( 'position', positions.copyVector3sArray( geometry.vertices ) );
|
|
|
- this.addAttribute( 'color', colors.copyColorsArray( geometry.colors ) );
|
|
|
+ this.setAttribute( 'position', positions.copyVector3sArray( geometry.vertices ) );
|
|
|
+ this.setAttribute( 'color', colors.copyColorsArray( geometry.colors ) );
|
|
|
|
|
|
if ( geometry.lineDistances && geometry.lineDistances.length === geometry.vertices.length ) {
|
|
|
|
|
|
var lineDistances = new Float32BufferAttribute( geometry.lineDistances.length, 1 );
|
|
|
|
|
|
- this.addAttribute( 'lineDistance', lineDistances.copyArray( geometry.lineDistances ) );
|
|
|
+ this.setAttribute( 'lineDistance', lineDistances.copyArray( geometry.lineDistances ) );
|
|
|
|
|
|
}
|
|
|
|
|
@@ -9880,7 +9857,7 @@ BufferGeometry.prototype = Object.assign( Object.create( EventDispatcher.prototy
|
|
|
|
|
|
}
|
|
|
|
|
|
- this.addAttribute( 'position', new Float32BufferAttribute( position, 3 ) );
|
|
|
+ this.setAttribute( 'position', new Float32BufferAttribute( position, 3 ) );
|
|
|
|
|
|
return this;
|
|
|
|
|
@@ -10024,33 +10001,33 @@ BufferGeometry.prototype = Object.assign( Object.create( EventDispatcher.prototy
|
|
|
fromDirectGeometry: function ( geometry ) {
|
|
|
|
|
|
var positions = new Float32Array( geometry.vertices.length * 3 );
|
|
|
- this.addAttribute( 'position', new BufferAttribute( positions, 3 ).copyVector3sArray( geometry.vertices ) );
|
|
|
+ this.setAttribute( 'position', new BufferAttribute( positions, 3 ).copyVector3sArray( geometry.vertices ) );
|
|
|
|
|
|
if ( geometry.normals.length > 0 ) {
|
|
|
|
|
|
var normals = new Float32Array( geometry.normals.length * 3 );
|
|
|
- this.addAttribute( 'normal', new BufferAttribute( normals, 3 ).copyVector3sArray( geometry.normals ) );
|
|
|
+ this.setAttribute( 'normal', new BufferAttribute( normals, 3 ).copyVector3sArray( geometry.normals ) );
|
|
|
|
|
|
}
|
|
|
|
|
|
if ( geometry.colors.length > 0 ) {
|
|
|
|
|
|
var colors = new Float32Array( geometry.colors.length * 3 );
|
|
|
- this.addAttribute( 'color', new BufferAttribute( colors, 3 ).copyColorsArray( geometry.colors ) );
|
|
|
+ this.setAttribute( 'color', new BufferAttribute( colors, 3 ).copyColorsArray( geometry.colors ) );
|
|
|
|
|
|
}
|
|
|
|
|
|
if ( geometry.uvs.length > 0 ) {
|
|
|
|
|
|
var uvs = new Float32Array( geometry.uvs.length * 2 );
|
|
|
- this.addAttribute( 'uv', new BufferAttribute( uvs, 2 ).copyVector2sArray( geometry.uvs ) );
|
|
|
+ this.setAttribute( 'uv', new BufferAttribute( uvs, 2 ).copyVector2sArray( geometry.uvs ) );
|
|
|
|
|
|
}
|
|
|
|
|
|
if ( geometry.uvs2.length > 0 ) {
|
|
|
|
|
|
var uvs2 = new Float32Array( geometry.uvs2.length * 2 );
|
|
|
- this.addAttribute( 'uv2', new BufferAttribute( uvs2, 2 ).copyVector2sArray( geometry.uvs2 ) );
|
|
|
+ this.setAttribute( 'uv2', new BufferAttribute( uvs2, 2 ).copyVector2sArray( geometry.uvs2 ) );
|
|
|
|
|
|
}
|
|
|
|
|
@@ -10085,14 +10062,14 @@ BufferGeometry.prototype = Object.assign( Object.create( EventDispatcher.prototy
|
|
|
if ( geometry.skinIndices.length > 0 ) {
|
|
|
|
|
|
var skinIndices = new Float32BufferAttribute( geometry.skinIndices.length * 4, 4 );
|
|
|
- this.addAttribute( 'skinIndex', skinIndices.copyVector4sArray( geometry.skinIndices ) );
|
|
|
+ this.setAttribute( 'skinIndex', skinIndices.copyVector4sArray( geometry.skinIndices ) );
|
|
|
|
|
|
}
|
|
|
|
|
|
if ( geometry.skinWeights.length > 0 ) {
|
|
|
|
|
|
var skinWeights = new Float32BufferAttribute( geometry.skinWeights.length * 4, 4 );
|
|
|
- this.addAttribute( 'skinWeight', skinWeights.copyVector4sArray( geometry.skinWeights ) );
|
|
|
+ this.setAttribute( 'skinWeight', skinWeights.copyVector4sArray( geometry.skinWeights ) );
|
|
|
|
|
|
}
|
|
|
|
|
@@ -10258,7 +10235,7 @@ BufferGeometry.prototype = Object.assign( Object.create( EventDispatcher.prototy
|
|
|
|
|
|
if ( attributes.normal === undefined ) {
|
|
|
|
|
|
- this.addAttribute( 'normal', new BufferAttribute( new Float32Array( positions.length ), 3 ) );
|
|
|
+ this.setAttribute( 'normal', new BufferAttribute( new Float32Array( positions.length ), 3 ) );
|
|
|
|
|
|
} else {
|
|
|
|
|
@@ -10466,7 +10443,7 @@ BufferGeometry.prototype = Object.assign( Object.create( EventDispatcher.prototy
|
|
|
|
|
|
var newAttribute = convertBufferAttribute( attribute, indices );
|
|
|
|
|
|
- geometry2.addAttribute( name, newAttribute );
|
|
|
+ geometry2.setAttribute( name, newAttribute );
|
|
|
|
|
|
}
|
|
|
|
|
@@ -10686,7 +10663,7 @@ BufferGeometry.prototype = Object.assign( Object.create( EventDispatcher.prototy
|
|
|
for ( name in attributes ) {
|
|
|
|
|
|
var attribute = attributes[ name ];
|
|
|
- this.addAttribute( name, attribute.clone() );
|
|
|
+ this.setAttribute( name, attribute.clone() );
|
|
|
|
|
|
}
|
|
|
|
|
@@ -12688,9 +12665,9 @@ class BoxBufferGeometry extends BufferGeometry {
|
|
|
// build geometry
|
|
|
|
|
|
this.setIndex( indices );
|
|
|
- this.addAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );
|
|
|
- this.addAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) );
|
|
|
- this.addAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) );
|
|
|
+ this.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );
|
|
|
+ this.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) );
|
|
|
+ this.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) );
|
|
|
|
|
|
function buildPlane( u, v, w, udir, vdir, width, height, depth, gridX, gridY, materialIndex ) {
|
|
|
|
|
@@ -15184,9 +15161,9 @@ function PlaneBufferGeometry( width, height, widthSegments, heightSegments ) {
|
|
|
// build geometry
|
|
|
|
|
|
this.setIndex( indices );
|
|
|
- this.addAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );
|
|
|
- this.addAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) );
|
|
|
- this.addAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) );
|
|
|
+ this.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );
|
|
|
+ this.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) );
|
|
|
+ this.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) );
|
|
|
|
|
|
}
|
|
|
|
|
@@ -15264,8 +15241,8 @@ function WebGLBackground( renderer, state, objects, premultipliedAlpha ) {
|
|
|
} )
|
|
|
);
|
|
|
|
|
|
- boxMesh.geometry.removeAttribute( 'normal' );
|
|
|
- boxMesh.geometry.removeAttribute( 'uv' );
|
|
|
+ boxMesh.geometry.deleteAttribute( 'normal' );
|
|
|
+ boxMesh.geometry.deleteAttribute( 'uv' );
|
|
|
|
|
|
boxMesh.onBeforeRender = function ( renderer, scene, camera ) {
|
|
|
|
|
@@ -15323,7 +15300,7 @@ function WebGLBackground( renderer, state, objects, premultipliedAlpha ) {
|
|
|
} )
|
|
|
);
|
|
|
|
|
|
- planeMesh.geometry.removeAttribute( 'normal' );
|
|
|
+ planeMesh.geometry.deleteAttribute( 'normal' );
|
|
|
|
|
|
// enable code injection for non-built-in material
|
|
|
Object.defineProperty( planeMesh.material, 'map', {
|
|
@@ -16218,8 +16195,8 @@ function WebGLMorphtargets( gl ) {
|
|
|
|
|
|
if ( influence[ 1 ] !== 0 ) {
|
|
|
|
|
|
- if ( morphTargets ) geometry.removeAttribute( 'morphTarget' + i );
|
|
|
- if ( morphNormals ) geometry.removeAttribute( 'morphNormal' + i );
|
|
|
+ if ( morphTargets ) geometry.deleteAttribute( 'morphTarget' + i );
|
|
|
+ if ( morphNormals ) geometry.deleteAttribute( 'morphNormal' + i );
|
|
|
|
|
|
}
|
|
|
|
|
@@ -16251,8 +16228,8 @@ function WebGLMorphtargets( gl ) {
|
|
|
|
|
|
if ( value ) {
|
|
|
|
|
|
- if ( morphTargets ) geometry.addAttribute( 'morphTarget' + i, morphTargets[ index ] );
|
|
|
- if ( morphNormals ) geometry.addAttribute( 'morphNormal' + i, morphNormals[ index ] );
|
|
|
+ if ( morphTargets ) geometry.setAttribute( 'morphTarget' + i, morphTargets[ index ] );
|
|
|
+ if ( morphNormals ) geometry.setAttribute( 'morphNormal' + i, morphNormals[ index ] );
|
|
|
|
|
|
morphInfluences[ i ] = value;
|
|
|
continue;
|
|
@@ -19490,7 +19467,7 @@ function WebGLShadowMap( _renderer, _objects, maxTextureSize ) {
|
|
|
shadowMaterialHorizonal.defines.HORIZONAL_PASS = 1;
|
|
|
|
|
|
var fullScreenTri = new BufferGeometry();
|
|
|
- fullScreenTri.addAttribute(
|
|
|
+ fullScreenTri.setAttribute(
|
|
|
"position",
|
|
|
new BufferAttribute(
|
|
|
new Float32Array( [ - 1, - 1, 0.5, 3, - 1, 0.5, - 1, 3, 0.5 ] ),
|
|
@@ -26574,8 +26551,8 @@ function Sprite( material ) {
|
|
|
var interleavedBuffer = new InterleavedBuffer( float32Array, 5 );
|
|
|
|
|
|
_geometry.setIndex( [ 0, 1, 2, 0, 2, 3 ] );
|
|
|
- _geometry.addAttribute( 'position', new InterleavedBufferAttribute( interleavedBuffer, 3, 0, false ) );
|
|
|
- _geometry.addAttribute( 'uv', new InterleavedBufferAttribute( interleavedBuffer, 2, 3, false ) );
|
|
|
+ _geometry.setAttribute( 'position', new InterleavedBufferAttribute( interleavedBuffer, 3, 0, false ) );
|
|
|
+ _geometry.setAttribute( 'uv', new InterleavedBufferAttribute( interleavedBuffer, 2, 3, false ) );
|
|
|
|
|
|
}
|
|
|
|
|
@@ -27324,7 +27301,7 @@ Line.prototype = Object.assign( Object.create( Object3D.prototype ), {
|
|
|
|
|
|
}
|
|
|
|
|
|
- geometry.addAttribute( 'lineDistance', new Float32BufferAttribute( lineDistances, 1 ) );
|
|
|
+ geometry.setAttribute( 'lineDistance', new Float32BufferAttribute( lineDistances, 1 ) );
|
|
|
|
|
|
} else {
|
|
|
|
|
@@ -27548,7 +27525,7 @@ LineSegments.prototype = Object.assign( Object.create( Line.prototype ), {
|
|
|
|
|
|
}
|
|
|
|
|
|
- geometry.addAttribute( 'lineDistance', new Float32BufferAttribute( lineDistances, 1 ) );
|
|
|
+ geometry.setAttribute( 'lineDistance', new Float32BufferAttribute( lineDistances, 1 ) );
|
|
|
|
|
|
} else {
|
|
|
|
|
@@ -28124,7 +28101,7 @@ function WireframeGeometry( geometry ) {
|
|
|
|
|
|
// build geometry
|
|
|
|
|
|
- this.addAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );
|
|
|
+ this.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );
|
|
|
|
|
|
}
|
|
|
|
|
@@ -28288,9 +28265,9 @@ function ParametricBufferGeometry( func, slices, stacks ) {
|
|
|
// build geometry
|
|
|
|
|
|
this.setIndex( indices );
|
|
|
- this.addAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );
|
|
|
- this.addAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) );
|
|
|
- this.addAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) );
|
|
|
+ this.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );
|
|
|
+ this.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) );
|
|
|
+ this.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) );
|
|
|
|
|
|
}
|
|
|
|
|
@@ -28374,9 +28351,9 @@ function PolyhedronBufferGeometry( vertices, indices, radius, detail ) {
|
|
|
|
|
|
// build non-indexed geometry
|
|
|
|
|
|
- this.addAttribute( 'position', new Float32BufferAttribute( vertexBuffer, 3 ) );
|
|
|
- this.addAttribute( 'normal', new Float32BufferAttribute( vertexBuffer.slice(), 3 ) );
|
|
|
- this.addAttribute( 'uv', new Float32BufferAttribute( uvBuffer, 2 ) );
|
|
|
+ this.setAttribute( 'position', new Float32BufferAttribute( vertexBuffer, 3 ) );
|
|
|
+ this.setAttribute( 'normal', new Float32BufferAttribute( vertexBuffer.slice(), 3 ) );
|
|
|
+ this.setAttribute( 'uv', new Float32BufferAttribute( uvBuffer, 2 ) );
|
|
|
|
|
|
if ( detail === 0 ) {
|
|
|
|
|
@@ -28987,9 +28964,9 @@ function TubeBufferGeometry( path, tubularSegments, radius, radialSegments, clos
|
|
|
// build geometry
|
|
|
|
|
|
this.setIndex( indices );
|
|
|
- this.addAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );
|
|
|
- this.addAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) );
|
|
|
- this.addAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) );
|
|
|
+ this.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );
|
|
|
+ this.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) );
|
|
|
+ this.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) );
|
|
|
|
|
|
// functions
|
|
|
|
|
@@ -29277,9 +29254,9 @@ function TorusKnotBufferGeometry( radius, tube, tubularSegments, radialSegments,
|
|
|
// build geometry
|
|
|
|
|
|
this.setIndex( indices );
|
|
|
- this.addAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );
|
|
|
- this.addAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) );
|
|
|
- this.addAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) );
|
|
|
+ this.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );
|
|
|
+ this.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) );
|
|
|
+ this.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) );
|
|
|
|
|
|
// this function calculates the current position on the torus curve
|
|
|
|
|
@@ -29427,9 +29404,9 @@ function TorusBufferGeometry( radius, tube, radialSegments, tubularSegments, arc
|
|
|
// build geometry
|
|
|
|
|
|
this.setIndex( indices );
|
|
|
- this.addAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );
|
|
|
- this.addAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) );
|
|
|
- this.addAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) );
|
|
|
+ this.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );
|
|
|
+ this.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) );
|
|
|
+ this.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) );
|
|
|
|
|
|
}
|
|
|
|
|
@@ -30373,8 +30350,8 @@ function ExtrudeBufferGeometry( shapes, options ) {
|
|
|
|
|
|
// build geometry
|
|
|
|
|
|
- this.addAttribute( 'position', new Float32BufferAttribute( verticesArray, 3 ) );
|
|
|
- this.addAttribute( 'uv', new Float32BufferAttribute( uvArray, 2 ) );
|
|
|
+ this.setAttribute( 'position', new Float32BufferAttribute( verticesArray, 3 ) );
|
|
|
+ this.setAttribute( 'uv', new Float32BufferAttribute( uvArray, 2 ) );
|
|
|
|
|
|
this.computeVertexNormals();
|
|
|
|
|
@@ -31341,9 +31318,9 @@ function SphereBufferGeometry( radius, widthSegments, heightSegments, phiStart,
|
|
|
// build geometry
|
|
|
|
|
|
this.setIndex( indices );
|
|
|
- this.addAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );
|
|
|
- this.addAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) );
|
|
|
- this.addAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) );
|
|
|
+ this.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );
|
|
|
+ this.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) );
|
|
|
+ this.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) );
|
|
|
|
|
|
}
|
|
|
|
|
@@ -31485,9 +31462,9 @@ function RingBufferGeometry( innerRadius, outerRadius, thetaSegments, phiSegment
|
|
|
// build geometry
|
|
|
|
|
|
this.setIndex( indices );
|
|
|
- this.addAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );
|
|
|
- this.addAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) );
|
|
|
- this.addAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) );
|
|
|
+ this.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );
|
|
|
+ this.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) );
|
|
|
+ this.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) );
|
|
|
|
|
|
}
|
|
|
|
|
@@ -31617,8 +31594,8 @@ function LatheBufferGeometry( points, segments, phiStart, phiLength ) {
|
|
|
// build geometry
|
|
|
|
|
|
this.setIndex( indices );
|
|
|
- this.addAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );
|
|
|
- this.addAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) );
|
|
|
+ this.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );
|
|
|
+ this.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) );
|
|
|
|
|
|
// generate normals
|
|
|
|
|
@@ -31766,9 +31743,9 @@ function ShapeBufferGeometry( shapes, curveSegments ) {
|
|
|
// build geometry
|
|
|
|
|
|
this.setIndex( indices );
|
|
|
- this.addAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );
|
|
|
- this.addAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) );
|
|
|
- this.addAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) );
|
|
|
+ this.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );
|
|
|
+ this.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) );
|
|
|
+ this.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) );
|
|
|
|
|
|
|
|
|
// helper functions
|
|
@@ -31983,7 +31960,7 @@ function EdgesGeometry( geometry, thresholdAngle ) {
|
|
|
|
|
|
// build geometry
|
|
|
|
|
|
- this.addAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );
|
|
|
+ this.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );
|
|
|
|
|
|
}
|
|
|
|
|
@@ -32082,9 +32059,9 @@ function CylinderBufferGeometry( radiusTop, radiusBottom, height, radialSegments
|
|
|
// build geometry
|
|
|
|
|
|
this.setIndex( indices );
|
|
|
- this.addAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );
|
|
|
- this.addAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) );
|
|
|
- this.addAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) );
|
|
|
+ this.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );
|
|
|
+ this.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) );
|
|
|
+ this.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) );
|
|
|
|
|
|
function generateTorso() {
|
|
|
|
|
@@ -32452,9 +32429,9 @@ function CircleBufferGeometry( radius, segments, thetaStart, thetaLength ) {
|
|
|
// build geometry
|
|
|
|
|
|
this.setIndex( indices );
|
|
|
- this.addAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );
|
|
|
- this.addAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) );
|
|
|
- this.addAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) );
|
|
|
+ this.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );
|
|
|
+ this.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) );
|
|
|
+ this.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) );
|
|
|
|
|
|
}
|
|
|
|
|
@@ -32464,6 +32441,7 @@ CircleBufferGeometry.prototype.constructor = CircleBufferGeometry;
|
|
|
|
|
|
|
|
|
var Geometries = /*#__PURE__*/Object.freeze({
|
|
|
+ __proto__: null,
|
|
|
WireframeGeometry: WireframeGeometry,
|
|
|
ParametricGeometry: ParametricGeometry,
|
|
|
ParametricBufferGeometry: ParametricBufferGeometry,
|
|
@@ -33377,6 +33355,7 @@ LineDashedMaterial.prototype.copy = function ( source ) {
|
|
|
|
|
|
|
|
|
var Materials = /*#__PURE__*/Object.freeze({
|
|
|
+ __proto__: null,
|
|
|
ShadowMaterial: ShadowMaterial,
|
|
|
SpriteMaterial: SpriteMaterial,
|
|
|
RawShaderMaterial: RawShaderMaterial,
|
|
@@ -37611,6 +37590,7 @@ SplineCurve.prototype.fromJSON = function ( json ) {
|
|
|
|
|
|
|
|
|
var Curves = /*#__PURE__*/Object.freeze({
|
|
|
+ __proto__: null,
|
|
|
ArcCurve: ArcCurve,
|
|
|
CatmullRomCurve3: CatmullRomCurve3,
|
|
|
CubicBezierCurve: CubicBezierCurve,
|
|
@@ -39355,7 +39335,7 @@ BufferGeometryLoader.prototype = Object.assign( Object.create( Loader.prototype
|
|
|
var bufferAttributeConstr = attribute.isInstancedBufferAttribute ? InstancedBufferAttribute : BufferAttribute;
|
|
|
var bufferAttribute = new bufferAttributeConstr( typedArray, attribute.itemSize, attribute.normalized );
|
|
|
if ( attribute.name !== undefined ) bufferAttribute.name = attribute.name;
|
|
|
- geometry.addAttribute( key, bufferAttribute );
|
|
|
+ geometry.setAttribute( key, bufferAttribute );
|
|
|
|
|
|
}
|
|
|
|
|
@@ -45779,7 +45759,7 @@ function VertexNormalsHelper( object, size, hex, linewidth ) {
|
|
|
|
|
|
var positions = new Float32BufferAttribute( nNormals * 2 * 3, 3 );
|
|
|
|
|
|
- geometry.addAttribute( 'position', positions );
|
|
|
+ geometry.setAttribute( 'position', positions );
|
|
|
|
|
|
LineSegments.call( this, geometry, new LineBasicMaterial( { color: color, linewidth: width } ) );
|
|
|
|
|
@@ -45918,7 +45898,7 @@ function SpotLightHelper( light, color ) {
|
|
|
|
|
|
}
|
|
|
|
|
|
- geometry.addAttribute( 'position', new Float32BufferAttribute( positions, 3 ) );
|
|
|
+ geometry.setAttribute( 'position', new Float32BufferAttribute( positions, 3 ) );
|
|
|
|
|
|
var material = new LineBasicMaterial( { fog: false } );
|
|
|
|
|
@@ -46023,8 +46003,8 @@ function SkeletonHelper( object ) {
|
|
|
|
|
|
}
|
|
|
|
|
|
- geometry.addAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );
|
|
|
- geometry.addAttribute( 'color', new Float32BufferAttribute( colors, 3 ) );
|
|
|
+ geometry.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );
|
|
|
+ geometry.setAttribute( 'color', new Float32BufferAttribute( colors, 3 ) );
|
|
|
|
|
|
var material = new LineBasicMaterial( { vertexColors: VertexColors, depthTest: false, depthWrite: false, transparent: true } );
|
|
|
|
|
@@ -46181,7 +46161,7 @@ function RectAreaLightHelper( light, color ) {
|
|
|
var positions = [ 1, 1, 0, - 1, 1, 0, - 1, - 1, 0, 1, - 1, 0, 1, 1, 0 ];
|
|
|
|
|
|
var geometry = new BufferGeometry();
|
|
|
- geometry.addAttribute( 'position', new Float32BufferAttribute( positions, 3 ) );
|
|
|
+ geometry.setAttribute( 'position', new Float32BufferAttribute( positions, 3 ) );
|
|
|
geometry.computeBoundingSphere();
|
|
|
|
|
|
var material = new LineBasicMaterial( { fog: false } );
|
|
@@ -46193,7 +46173,7 @@ function RectAreaLightHelper( light, color ) {
|
|
|
var positions2 = [ 1, 1, 0, - 1, 1, 0, - 1, - 1, 0, 1, 1, 0, - 1, - 1, 0, 1, - 1, 0 ];
|
|
|
|
|
|
var geometry2 = new BufferGeometry();
|
|
|
- geometry2.addAttribute( 'position', new Float32BufferAttribute( positions2, 3 ) );
|
|
|
+ geometry2.setAttribute( 'position', new Float32BufferAttribute( positions2, 3 ) );
|
|
|
geometry2.computeBoundingSphere();
|
|
|
|
|
|
this.add( new Mesh( geometry2, new MeshBasicMaterial( { side: BackSide, fog: false } ) ) );
|
|
@@ -46269,7 +46249,7 @@ function HemisphereLightHelper( light, size, color ) {
|
|
|
var position = geometry.getAttribute( 'position' );
|
|
|
var colors = new Float32Array( position.count * 3 );
|
|
|
|
|
|
- geometry.addAttribute( 'color', new BufferAttribute( colors, 3 ) );
|
|
|
+ geometry.setAttribute( 'color', new BufferAttribute( colors, 3 ) );
|
|
|
|
|
|
this.add( new Mesh( geometry, this.material ) );
|
|
|
|
|
@@ -46496,8 +46476,8 @@ function GridHelper( size, divisions, color1, color2 ) {
|
|
|
}
|
|
|
|
|
|
var geometry = new BufferGeometry();
|
|
|
- geometry.addAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );
|
|
|
- geometry.addAttribute( 'color', new Float32BufferAttribute( colors, 3 ) );
|
|
|
+ geometry.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );
|
|
|
+ geometry.setAttribute( 'color', new Float32BufferAttribute( colors, 3 ) );
|
|
|
|
|
|
var material = new LineBasicMaterial( { vertexColors: VertexColors } );
|
|
|
|
|
@@ -46603,8 +46583,8 @@ function PolarGridHelper( radius, radials, circles, divisions, color1, color2 )
|
|
|
}
|
|
|
|
|
|
var geometry = new BufferGeometry();
|
|
|
- geometry.addAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );
|
|
|
- geometry.addAttribute( 'color', new Float32BufferAttribute( colors, 3 ) );
|
|
|
+ geometry.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );
|
|
|
+ geometry.setAttribute( 'color', new Float32BufferAttribute( colors, 3 ) );
|
|
|
|
|
|
var material = new LineBasicMaterial( { vertexColors: VertexColors } );
|
|
|
|
|
@@ -46629,7 +46609,7 @@ function PositionalAudioHelper( audio, range, divisionsInnerAngle, divisionsOute
|
|
|
var geometry = new BufferGeometry();
|
|
|
var divisions = this.divisionsInnerAngle + this.divisionsOuterAngle * 2;
|
|
|
var positions = new Float32Array( ( divisions * 3 + 3 ) * 3 );
|
|
|
- geometry.addAttribute( 'position', new BufferAttribute( positions, 3 ) );
|
|
|
+ geometry.setAttribute( 'position', new BufferAttribute( positions, 3 ) );
|
|
|
|
|
|
var materialInnerAngle = new LineBasicMaterial( { color: 0x00ff00 } );
|
|
|
var materialOuterAngle = new LineBasicMaterial( { color: 0xffff00 } );
|
|
@@ -46758,7 +46738,7 @@ function FaceNormalsHelper( object, size, hex, linewidth ) {
|
|
|
|
|
|
var positions = new Float32BufferAttribute( nNormals * 2 * 3, 3 );
|
|
|
|
|
|
- geometry.addAttribute( 'position', positions );
|
|
|
+ geometry.setAttribute( 'position', positions );
|
|
|
|
|
|
LineSegments.call( this, geometry, new LineBasicMaterial( { color: color, linewidth: width } ) );
|
|
|
|
|
@@ -46845,7 +46825,7 @@ function DirectionalLightHelper( light, size, color ) {
|
|
|
if ( size === undefined ) size = 1;
|
|
|
|
|
|
var geometry = new BufferGeometry();
|
|
|
- geometry.addAttribute( 'position', new Float32BufferAttribute( [
|
|
|
+ geometry.setAttribute( 'position', new Float32BufferAttribute( [
|
|
|
- size, size, 0,
|
|
|
size, size, 0,
|
|
|
size, - size, 0,
|
|
@@ -46859,7 +46839,7 @@ function DirectionalLightHelper( light, size, color ) {
|
|
|
this.add( this.lightPlane );
|
|
|
|
|
|
geometry = new BufferGeometry();
|
|
|
- geometry.addAttribute( 'position', new Float32BufferAttribute( [ 0, 0, 0, 0, 0, 1 ], 3 ) );
|
|
|
+ geometry.setAttribute( 'position', new Float32BufferAttribute( [ 0, 0, 0, 0, 0, 1 ], 3 ) );
|
|
|
|
|
|
this.targetLine = new Line( geometry, material );
|
|
|
this.add( this.targetLine );
|
|
@@ -47005,8 +46985,8 @@ function CameraHelper( camera ) {
|
|
|
|
|
|
}
|
|
|
|
|
|
- geometry.addAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );
|
|
|
- geometry.addAttribute( 'color', new Float32BufferAttribute( colors, 3 ) );
|
|
|
+ geometry.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );
|
|
|
+ geometry.setAttribute( 'color', new Float32BufferAttribute( colors, 3 ) );
|
|
|
|
|
|
LineSegments.call( this, geometry, material );
|
|
|
|
|
@@ -47116,7 +47096,7 @@ function BoxHelper( object, color ) {
|
|
|
|
|
|
var geometry = new BufferGeometry();
|
|
|
geometry.setIndex( new BufferAttribute( indices, 1 ) );
|
|
|
- geometry.addAttribute( 'position', new BufferAttribute( positions, 3 ) );
|
|
|
+ geometry.setAttribute( 'position', new BufferAttribute( positions, 3 ) );
|
|
|
|
|
|
LineSegments.call( this, geometry, new LineBasicMaterial( { color: color } ) );
|
|
|
|
|
@@ -47228,7 +47208,7 @@ function Box3Helper( box, color ) {
|
|
|
|
|
|
geometry.setIndex( new BufferAttribute( indices, 1 ) );
|
|
|
|
|
|
- geometry.addAttribute( 'position', new Float32BufferAttribute( positions, 3 ) );
|
|
|
+ geometry.setAttribute( 'position', new Float32BufferAttribute( positions, 3 ) );
|
|
|
|
|
|
LineSegments.call( this, geometry, new LineBasicMaterial( { color: color } ) );
|
|
|
|
|
@@ -47272,7 +47252,7 @@ function PlaneHelper( plane, size, hex ) {
|
|
|
var positions = [ 1, - 1, 1, - 1, 1, 1, - 1, - 1, 1, 1, 1, 1, - 1, 1, 1, - 1, - 1, 1, 1, - 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0 ];
|
|
|
|
|
|
var geometry = new BufferGeometry();
|
|
|
- geometry.addAttribute( 'position', new Float32BufferAttribute( positions, 3 ) );
|
|
|
+ geometry.setAttribute( 'position', new Float32BufferAttribute( positions, 3 ) );
|
|
|
geometry.computeBoundingSphere();
|
|
|
|
|
|
Line.call( this, geometry, new LineBasicMaterial( { color: color } ) );
|
|
@@ -47282,7 +47262,7 @@ function PlaneHelper( plane, size, hex ) {
|
|
|
var positions2 = [ 1, 1, 1, - 1, 1, 1, - 1, - 1, 1, 1, 1, 1, - 1, - 1, 1, 1, - 1, 1 ];
|
|
|
|
|
|
var geometry2 = new BufferGeometry();
|
|
|
- geometry2.addAttribute( 'position', new Float32BufferAttribute( positions2, 3 ) );
|
|
|
+ geometry2.setAttribute( 'position', new Float32BufferAttribute( positions2, 3 ) );
|
|
|
geometry2.computeBoundingSphere();
|
|
|
|
|
|
this.add( new Mesh( geometry2, new MeshBasicMaterial( { color: color, opacity: 0.2, transparent: true, depthWrite: false } ) ) );
|
|
@@ -47343,7 +47323,7 @@ function ArrowHelper( dir, origin, length, color, headLength, headWidth ) {
|
|
|
if ( _lineGeometry === undefined ) {
|
|
|
|
|
|
_lineGeometry = new BufferGeometry();
|
|
|
- _lineGeometry.addAttribute( 'position', new Float32BufferAttribute( [ 0, 0, 0, 0, 1, 0 ], 3 ) );
|
|
|
+ _lineGeometry.setAttribute( 'position', new Float32BufferAttribute( [ 0, 0, 0, 0, 1, 0 ], 3 ) );
|
|
|
|
|
|
_coneGeometry = new CylinderBufferGeometry( 0, 0.5, 1, 5, 1 );
|
|
|
_coneGeometry.translate( 0, - 0.5, 0 );
|
|
@@ -47452,8 +47432,8 @@ function AxesHelper( size ) {
|
|
|
];
|
|
|
|
|
|
var geometry = new BufferGeometry();
|
|
|
- geometry.addAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );
|
|
|
- geometry.addAttribute( 'color', new Float32BufferAttribute( colors, 3 ) );
|
|
|
+ geometry.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );
|
|
|
+ geometry.setAttribute( 'color', new Float32BufferAttribute( colors, 3 ) );
|
|
|
|
|
|
var material = new LineBasicMaterial( { vertexColors: VertexColors } );
|
|
|
|
|
@@ -48594,6 +48574,30 @@ Object.assign( BufferGeometry.prototype, {
|
|
|
console.warn( 'THREE.BufferGeometry: .addIndex() has been renamed to .setIndex().' );
|
|
|
this.setIndex( index );
|
|
|
|
|
|
+ },
|
|
|
+ addAttribute: function ( name, attribute ) {
|
|
|
+
|
|
|
+ console.warn( 'THREE.BufferGeometry: .addAttribute() has been renamed to .setAttribute().' );
|
|
|
+
|
|
|
+ if ( ! ( attribute && attribute.isBufferAttribute ) && ! ( attribute && attribute.isInterleavedBufferAttribute ) ) {
|
|
|
+
|
|
|
+ console.warn( 'THREE.BufferGeometry: .addAttribute() now expects ( name, attribute ).' );
|
|
|
+
|
|
|
+ return this.setAttribute( name, new BufferAttribute( arguments[ 1 ], arguments[ 2 ] ) );
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ if ( name === 'index' ) {
|
|
|
+
|
|
|
+ console.warn( 'THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute.' );
|
|
|
+ this.setIndex( attribute );
|
|
|
+
|
|
|
+ return this;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ return this.setAttribute( name, attribute );
|
|
|
+
|
|
|
},
|
|
|
addDrawCall: function ( start, count, indexOffset ) {
|
|
|
|
|
@@ -48621,8 +48625,14 @@ Object.assign( BufferGeometry.prototype, {
|
|
|
|
|
|
console.warn( 'THREE.BufferGeometry: .computeOffsets() has been removed.' );
|
|
|
|
|
|
- }
|
|
|
+ },
|
|
|
+ removeAttribute: function ( name ) {
|
|
|
|
|
|
+ console.warn( 'THREE.BufferGeometry: .removeAttribute() has been renamed to .deleteAttribute().' );
|
|
|
+
|
|
|
+ return this.deleteAttribute( name );
|
|
|
+
|
|
|
+ }
|
|
|
} );
|
|
|
|
|
|
Object.defineProperties( BufferGeometry.prototype, {
|