Remove AABB.getFirstHitPlane
@@ -278,59 +278,6 @@ public Vector3f closestPointOnAABBToPoint(Vector3f p) {
return r;
}
- /**
- * Sweeps an AABB on to the AABB in the given direction and returns the normal of the first plane of intersection.
- *
- * @param direction The direction in which to perform the sweep test.
- * @param pos The position of the given AABB.
- * @param dimensions The extents of the given AABB.
- * @param testX A boolean stating whether the x-axis should be tested.
- * @param testY A boolean stating whether the y-axis should be tested.
- * @param testZ A boolean stating whether the z-axis should be tested.
- * @return The normal of the hit plane of the sweep test.
- */
- public Vector3f getFirstHitPlane(Vector3f direction, Vector3f pos, Vector3f dimensions, boolean testX, boolean testY, boolean testZ) {
- Vector3f hitNormal = new Vector3f();
-
- float dist = Float.POSITIVE_INFINITY;
-
- if (testX) {
- float distX;
- if (direction.x > 0) {
- distX = (min.x - pos.x - dimensions.x) / direction.x;
- } else {
- distX = (max.x - pos.x + dimensions.x) / direction.x;
- }
- if (distX >= 0 && distX < dist) {
- hitNormal.set(Math.copySign(1, direction.x), 0, 0);
- }
- }
- if (testY) {
- float distY;
- if (direction.y > 0) {
- distY = (min.y - pos.y - dimensions.y) / direction.y;
- } else {
- distY = (max.y - pos.y + dimensions.y) / direction.y;
- }
- if (distY >= 0 && distY < dist) {
- hitNormal.set(0, Math.copySign(1, direction.y), 0);
- }
- }
- if (testZ) {
- float distZ;
- if (direction.z > 0) {
- distZ = (min.z - pos.z - dimensions.z) / direction.z;
- } else {
- distZ = (max.z - pos.z + dimensions.z) / direction.z;
- }
- if (distZ >= 0 && distZ < dist) {
- hitNormal.set(0, 0, Math.copySign(1, direction.z));
- }
- }
- return hitNormal;
-
- }
-
/**
* Returns the normal of the plane closest to the given origin.
*
