getInterpolatedAttribute static method

Vector getInterpolatedAttribute(
  1. BufferAttribute<NativeArray<num>> attr,
  2. int i1,
  3. int i2,
  4. int i3,
  5. Vector3 barycoord,
  6. Vector target,
)

Implementation

static Vector getInterpolatedAttribute(BufferAttribute attr, int i1, int i2, int i3, Vector3 barycoord, Vector target ) {
	_v40.setScalar( 0 );
	_v41.setScalar( 0 );
	_v42.setScalar( 0 );

	_v40.fromBuffer( attr, i1 );
	_v41.fromBuffer( attr, i2 );
	_v42.fromBuffer( attr, i3 );

	target.setScalar( 0 );
	target.addScaled( _v40, barycoord.x );
	target.addScaled( _v41, barycoord.y );
	target.addScaled( _v42, barycoord.z );

	return target;
}