|
@@ -26509,15 +26509,9 @@ InstancedMesh.prototype = Object.assign( Object.create( Mesh.prototype ), {
|
|
|
|
|
|
},
|
|
|
|
|
|
- setColorAt: function ( index, color ) {
|
|
|
-
|
|
|
- if ( this.instanceColor === null ) {
|
|
|
-
|
|
|
- this.instanceColor = new BufferAttribute( new Float32Array( this.count * 3 ), 3 );
|
|
|
+ getColorAt: function ( index, color ) {
|
|
|
|
|
|
- }
|
|
|
-
|
|
|
- color.toArray( this.instanceColor.array, index * 3 );
|
|
|
+ color.fromArray( this.instanceColor.array, index * 3 );
|
|
|
|
|
|
},
|
|
|
|
|
@@ -26568,6 +26562,18 @@ InstancedMesh.prototype = Object.assign( Object.create( Mesh.prototype ), {
|
|
|
|
|
|
},
|
|
|
|
|
|
+ setColorAt: function ( index, color ) {
|
|
|
+
|
|
|
+ if ( this.instanceColor === null ) {
|
|
|
+
|
|
|
+ this.instanceColor = new BufferAttribute( new Float32Array( this.count * 3 ), 3 );
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ color.toArray( this.instanceColor.array, index * 3 );
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
setMatrixAt: function ( index, matrix ) {
|
|
|
|
|
|
matrix.toArray( this.instanceMatrix.array, index * 16 );
|
|
@@ -28120,12 +28126,11 @@ Geometry.prototype = Object.assign( Object.create( EventDispatcher.prototype ),
|
|
|
* and faces' vertices are updated.
|
|
|
*/
|
|
|
|
|
|
- mergeVertices: function () {
|
|
|
+ mergeVertices: function ( precisionPoints = 4 ) {
|
|
|
|
|
|
const verticesMap = {}; // Hashmap for looking up vertices by position coordinates (and making sure they are unique)
|
|
|
const unique = [], changes = [];
|
|
|
|
|
|
- const precisionPoints = 4; // number of decimal points, e.g. 4 for epsilon of 0.0001
|
|
|
const precision = Math.pow( 10, precisionPoints );
|
|
|
|
|
|
for ( let i = 0, il = this.vertices.length; i < il; i ++ ) {
|