writeChanges method

dynamic writeChanges(
  1. dynamic index
)
  • The extra information about which curve and curve position is stored in the translation components of the matrix for the instanced objects
    • This writes that information to the matrix and marks it as needing update. *
      • @param {number} index of the instanced element to update

Implementation

writeChanges(index) {
  matrix.makeTranslation(this.curveLengthArray[this.whichCurve[index]],
      this.whichCurve[index], this.offsets[index]);

  var _object3D = this.object3D as InstancedMesh;

  _object3D.setMatrixAt(index, matrix);
  _object3D.instanceMatrix?.needsUpdate = true;
}