public boolean contains(IBoundingVolume boundingVolume) { if(!(boundingVolume instanceof BoundingBox)) return false; BoundingBox boundingBox = (BoundingBox)boundingVolume; Vector3 otherMin = boundingBox.getTransformedMin(); Vector3 otherMax = boundingBox.getTransformedMax(); Vector3 min = mTransformedMin; Vector3 max = mTransformedMax; return (max.x >= otherMax.x) && (min.x <= otherMin.x) && (max.y >= otherMax.y) && (min.y <= otherMin.y) && (max.z >= otherMax.z) && (min.z <= otherMin.z); }
public boolean isContainedBy(IBoundingVolume boundingVolume) { if(!(boundingVolume instanceof BoundingBox)) return false; BoundingBox boundingBox = (BoundingBox)boundingVolume; Vector3 otherMin = boundingBox.getTransformedMin(); Vector3 otherMax = boundingBox.getTransformedMax(); Vector3 min = mTransformedMin; Vector3 max = mTransformedMax; return (max.x <= otherMax.x) && (min.x >= otherMin.x) && (max.y <= otherMax.y) && (min.y >= otherMin.y) && (max.z <= otherMax.z) && (min.z >= otherMin.z); }
public boolean intersectsWith(IBoundingVolume boundingVolume) { if (!(boundingVolume instanceof BoundingBox)) { return false; } BoundingBox boundingBox = (BoundingBox) boundingVolume; Vector3 otherMin = boundingBox.getTransformedMin(); Vector3 otherMax = boundingBox.getTransformedMax(); Vector3 min = mTransformedMin; Vector3 max = mTransformedMax; return (min.x < otherMax.x) && (max.x > otherMin.x) && (min.y < otherMax.y) && (max.y > otherMin.y) && (min.z < otherMax.z) && (max.z > otherMin.z); }
if (volume instanceof BoundingBox) { BoundingBox bb = (BoundingBox) volume; test_against_min = bb.getTransformedMin(); test_against_max = bb.getTransformedMax(); } else if (volume instanceof BoundingSphere) {
if (volume instanceof BoundingBox) { bcube = (BoundingBox) volume; Vector3 min = bcube.getTransformedMin(); Vector3 max = bcube.getTransformedMax(); span_x = (max.x - min.x);
private boolean intersectsWith(BoundingBox bbox) { Vector3 raySta = mRayStart; Vector3 rayEnd = mRayEnd; Vector3 boxMin = bbox.getTransformedMin(); Vector3 boxMax = bbox.getTransformedMax(); if (rayEnd.x < boxMin.x && raySta.x < boxMin.x) return false; if (rayEnd.x > boxMax.x && raySta.x > boxMax.x) return false; if (rayEnd.y < boxMin.y && raySta.y < boxMin.y) return false; if (rayEnd.y > boxMax.y && raySta.y > boxMax.y) return false; if (rayEnd.z < boxMin.z && raySta.z < boxMin.z) return false; if (rayEnd.z > boxMax.z && raySta.z > boxMax.z) return false; if (raySta.x > boxMin.x && raySta.x < boxMax.x && raySta.y > boxMin.y && raySta.y < boxMax.y && raySta.z > boxMin.z && raySta.z < boxMax.z) {mHitPoint.setAll(raySta); return true;} return (getIntersection(raySta.x - boxMin.x, rayEnd.x - boxMin.x, raySta, rayEnd) && isInBox(boxMin, boxMax, Axis.X)) || (getIntersection(raySta.y - boxMin.y, rayEnd.y - boxMin.y, raySta, rayEnd) && isInBox(boxMin, boxMax, Axis.Y)) || (getIntersection(raySta.z - boxMin.z, rayEnd.z - boxMin.z, raySta, rayEnd) && isInBox(boxMin, boxMax, Axis.Z)) || (getIntersection(raySta.x - boxMax.x, rayEnd.x - boxMax.x, raySta, rayEnd) && isInBox(boxMin, boxMax, Axis.X)) || (getIntersection(raySta.y - boxMax.y, rayEnd.y - boxMax.y, raySta, rayEnd) && isInBox(boxMin, boxMax, Axis.Y)) || (getIntersection(raySta.z - boxMax.z, rayEnd.z - boxMax.z, raySta, rayEnd) && isInBox(boxMin, boxMax, Axis.Z)); }
public boolean isContainedBy(IBoundingVolume boundingVolume) { if(!(boundingVolume instanceof BoundingBox)) return false; BoundingBox boundingBox = (BoundingBox)boundingVolume; Vector3 otherMin = boundingBox.getTransformedMin(); Vector3 otherMax = boundingBox.getTransformedMax(); Vector3 min = mTransformedMin; Vector3 max = mTransformedMax; return (max.x <= otherMax.x) && (min.x >= otherMin.x) && (max.y <= otherMax.y) && (min.y >= otherMin.y) && (max.z <= otherMax.z) && (min.z >= otherMin.z); }
public boolean contains(IBoundingVolume boundingVolume) { if(!(boundingVolume instanceof BoundingBox)) return false; BoundingBox boundingBox = (BoundingBox)boundingVolume; Vector3 otherMin = boundingBox.getTransformedMin(); Vector3 otherMax = boundingBox.getTransformedMax(); Vector3 min = mTransformedMin; Vector3 max = mTransformedMax; return (max.x >= otherMax.x) && (min.x <= otherMin.x) && (max.y >= otherMax.y) && (min.y <= otherMin.y) && (max.z >= otherMax.z) && (min.z <= otherMin.z); }
public boolean intersectsWith(IBoundingVolume boundingVolume) { if (!(boundingVolume instanceof BoundingBox)) return false; BoundingBox boundingBox = (BoundingBox) boundingVolume; Vector3 otherMin = boundingBox.getTransformedMin(); Vector3 otherMax = boundingBox.getTransformedMax(); Vector3 min = mTransformedMin; Vector3 max = mTransformedMax; return (min.x < otherMax.x) && (max.x > otherMin.x) && (min.y < otherMax.y) && (max.y > otherMin.y) && (min.z < otherMax.z) && (max.z > otherMin.z); }
if (volume instanceof BoundingBox) { BoundingBox bb = (BoundingBox) volume; test_against_min = bb.getTransformedMin(); test_against_max = bb.getTransformedMax(); } else if (volume instanceof BoundingSphere) {
if (volume instanceof BoundingBox) { bcube = (BoundingBox) volume; Vector3 min = bcube.getTransformedMin(); Vector3 max = bcube.getTransformedMax(); span_x = (max.x - min.x);
private boolean intersectsWith(BoundingBox bbox) { Vector3 raySta = mRayStart; Vector3 rayEnd = mRayEnd; Vector3 boxMin = bbox.getTransformedMin(); Vector3 boxMax = bbox.getTransformedMax(); if (rayEnd.x < boxMin.x && raySta.x < boxMin.x) return false; if (rayEnd.x > boxMax.x && raySta.x > boxMax.x) return false; if (rayEnd.y < boxMin.y && raySta.y < boxMin.y) return false; if (rayEnd.y > boxMax.y && raySta.y > boxMax.y) return false; if (rayEnd.z < boxMin.z && raySta.z < boxMin.z) return false; if (rayEnd.z > boxMax.z && raySta.z > boxMax.z) return false; if (raySta.x > boxMin.x && raySta.x < boxMax.x && raySta.y > boxMin.y && raySta.y < boxMax.y && raySta.z > boxMin.z && raySta.z < boxMax.z) {mHitPoint.setAll(raySta); return true;} if ( (getIntersection(raySta.x-boxMin.x, rayEnd.x-boxMin.x, raySta, rayEnd) && isInBox(boxMin, boxMax, Axis.X)) || (getIntersection(raySta.y-boxMin.y, rayEnd.y-boxMin.y, raySta, rayEnd) && isInBox(boxMin, boxMax, Axis.Y)) || (getIntersection(raySta.z-boxMin.z, rayEnd.z-boxMin.z, raySta, rayEnd) && isInBox(boxMin, boxMax, Axis.Z)) || (getIntersection(raySta.x-boxMax.x, rayEnd.x-boxMax.x, raySta, rayEnd) && isInBox(boxMin, boxMax, Axis.X)) || (getIntersection(raySta.y-boxMax.y, rayEnd.y-boxMax.y, raySta, rayEnd) && isInBox(boxMin, boxMax, Axis.Y)) || (getIntersection(raySta.z-boxMax.z, rayEnd.z-boxMax.z, raySta, rayEnd) && isInBox(boxMin, boxMax, Axis.Z))) return true; return false; }