initSplineTexture function

dynamic initSplineTexture({
  1. int numberOfCurves = 1,
})

Make a new DataTexture to store the descriptions of the curves.

@param { number } numberOfCurves the number of curves needed to be described by this texture.

Implementation

initSplineTexture({int numberOfCurves = 1}) {
  var dataArray = new Float32Array(
      (TEXTURE_WIDTH * TEXTURE_HEIGHT * numberOfCurves * CHANNELS).toInt());
  var dataTexture = new DataTexture(
      dataArray,
      TEXTURE_WIDTH,
      TEXTURE_HEIGHT * numberOfCurves,
      RGBAFormat,
      FloatType,
      null,
      null,
      null,
      null,
      null,
      null,
      null);

  dataTexture.wrapS = RepeatWrapping;
  // dataTexture.wrapY = RepeatWrapping;
  dataTexture.magFilter = NearestFilter;
  dataTexture.needsUpdate = true;

  return dataTexture;
}