setMatrixAt method

void setMatrixAt(
  1. int index,
  2. Matrix4 matrix
)

index - The index of an instance. Values have to be in the range 0, count.

matrix - A 4x4 matrix representing the local transformation of a single instance.

Sets the given local transformation matrix to the defined instance. Make sure you set needsUpdate to true after updating all the matrices.

Implementation

void setMatrixAt(int index, Matrix4 matrix) {
  matrix.copyIntoArray(instanceMatrix!.array.toDartList(), index * 16);
}