setTextureValue function

dynamic setTextureValue(
  1. dynamic texture,
  2. dynamic index,
  3. dynamic x,
  4. dynamic y,
  5. dynamic z,
  6. dynamic o,
)

Implementation

setTextureValue(texture, index, x, y, z, o) {
  var image = texture.image;
  var data = image.data;
  var i = channels * textureWidth * o; // Row Offset
  data[index * channels + i + 0] = x;
  data[index * channels + i + 1] = y;
  data[index * channels + i + 2] = z;
  data[index * channels + i + 3] = 1;
}