setXYZ method

  1. @override
InterleavedBufferAttribute setXYZ(
  1. int index,
  2. double x,
  3. double y,
  4. double z,
)
override

Sets the x, y and z components of the item at the given index.

Implementation

@override
InterleavedBufferAttribute setXYZ(int index, x, y, z) {
		index = index * this.data!.stride + this.offset;

		if ( this.normalized ) {
			x = MathUtils.normalize( x, this.array );
			y = MathUtils.normalize( y, this.array );
			z = MathUtils.normalize( z, this.array );
		}

		this.data!.array[ index + 0 ] = x;
		this.data!.array[ index + 1 ] = y;
		this.data!.array[ index + 2 ] = z;

		return this;
}