function isSeparatingAxis(aPos, bPos, aPoints, bPoints, axis, response) {
	const rangeA = T_ARRAYS.pop();
	const rangeB = T_ARRAYS.pop();
	// The magnitude of the offset between the two polygons
	const offsetV = T_VECTORS.pop().copy(bPos).sub(aPos);
	const projectedOffset = offsetV.dot(axis);

	// Project the polygons onto the axis.
	flattenPointsOn(aPoints, axis, rangeA);
	flattenPointsOn(bPoints, axis, rangeB);
	// Move B's range to its position relative to A.
	rangeB[0] += projectedOffset;
	rangeB[1] += projectedOffset;
	// Check if there is a gap. If there is, this is a separating axis and we can stop
	if (rangeA[0] > rangeB[1] || rangeB[0] > rangeA[1]) {
		T_VECTORS.push(offsetV);
		T_ARRAYS.push(rangeA);
		T_ARRAYS.push(rangeB);
		return true;
	}

	// This is not a separating axis. If we're calculating a response, calculate the overlap.
	if (response) {
		let overlap = 0;
		// A starts further left than B
		if (rangeA[0] < rangeB[0]) {
			response.aInB = false;
			// A ends before B does. We have to pull A out of B
			if (rangeA[1] < rangeB[1]) {
				overlap = rangeA[1] - rangeB[0];
				response.bInA = false;
				// B is fully inside A.  Pick the shortest way out.
			} else {
				const option1 = rangeA[1] - rangeB[0];
				const option2 = rangeB[1] - rangeA[0];
				overlap = option1 < option2 ? option1 : -option2;
			}
			// B starts further left than A
		} else {
			response.bInA = false;
			// B ends before A ends. We have to push A out of B
			if (rangeA[1] > rangeB[1]) {
				overlap = rangeA[0] - rangeB[1];
				response.aInB = false;
				// A is fully inside B.  Pick the shortest way out.
			} else {
				const option11 = rangeA[1] - rangeB[0];
				const option22 = rangeB[1] - rangeA[0];
				overlap = option11 < option22 ? option11 : -option22;
			}
		}

		// If this is the smallest amount of overlap we've seen so far, set it as the minimum overlap.
		const absOverlap = Math.abs(overlap);
		if (absOverlap < response.overlap) {
			response.overlap = absOverlap;
			response.overlapN.copy(axis);
			if (overlap < 0) {
				response.overlapN.negateSelf();
			}
		}
	}
	T_VECTORS.push(offsetV);
	T_ARRAYS.push(rangeA);
	T_ARRAYS.push(rangeB);
	return false;
}
Check whether two convex polygons are separated by the specified
axis (must be a unit vector).
@ignore
@param {Vector2d} aPos - The position of the first polygon.
@param {Vector2d} bPos - The position of the second polygon.
@param {Array.<Vector2d>} aPoints - The points in the first polygon.
@param {Array.<Vector2d>} bPoints - The points in the second polygon.
@param {Vector2d} axis - The axis (unit sized) to test against.  The points of both polygons
  will be projected onto this axis.
@param {Response=} response - A Response object (optional) which will be populated
  if the axis is not a separating axis.
@returns {boolean} true if it is a separating axis, false otherwise.  If false,
  and a response is passed in, information about how much overlap and
  the direction of the overlap will be populated.