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 * TEXTURE_WIDTH * 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;
}