|
@@ -39,15 +39,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 );
|
|
|
|
|
|
},
|
|
|
|
|
@@ -98,6 +92,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 );
|