getParameter method

Vector2 getParameter(
  1. Vector2 point,
  2. Vector2 target
)

Implementation

Vector2 getParameter(Vector2 point, Vector2 target) {
  // This can potentially have a divide by zero if the box
  // has a size dimension of 0.

  return target.set((point.x - min.x) / (max.x - min.x), (point.y - min.y) / (max.y - min.y));
}