getUV static method

Vector2 getUV(
  1. Vector3 point,
  2. Vector3 p1,
  3. Vector3 p2,
  4. Vector3 p3,
  5. Vector2 uv1,
  6. Vector2 uv2,
  7. Vector2 uv3,
  8. Vector2 target,
)

Implementation

static Vector2 getUV(Vector3 point, Vector3 p1, Vector3 p2, Vector3 p3, Vector2 uv1, Vector2 uv2, Vector2 uv3, Vector2 target) {
  getBarycoord(point, p1, p2, p3, _v3);

  target.setValues(0.0, 0.0);
  target.addScaled(uv1, _v3.x);
  target.addScaled(uv2, _v3.y);
  target.addScaled(uv3, _v3.z);

  return target;
}