public static bool IsPointInsideAABB(Vector3 p, AxisAlignedBB b) { return (p.X >= b.MinX && p.X <= b.MaxX && p.Y >= b.MinY && p.Y <= b.MaxY && p.Z >= b.MinZ && p.Z <= b.MaxZ); }
public float IntersectionAmountZ(AxisAlignedBB aabb, bool checkIntersection) { if (checkIntersection) { if (!IntersectsAABBX(aabb) && !IntersectsAABBY(aabb)) { return(0); } } if (MinZ < aabb.MaxZ && aabb.MinZ < MinZ) { return(aabb.MaxZ - MinZ); } if (MaxZ > aabb.MinZ && aabb.MinZ > MinZ) { return(MaxZ - aabb.MinZ); } return(0); }
public float IntersectionAmountY(AxisAlignedBB aabb, bool checkIntersection) { if (checkIntersection) { if (!IntersectsAABBX(aabb) && !IntersectsAABBZ(aabb)) { return(0); } } if (MinY < aabb.MaxY && aabb.MinY < MinY) { return(aabb.MaxY - MinY); } if (MaxY > aabb.MinY && aabb.MinY > MinY) { return(MaxY - aabb.MinY); } return(0); }
public float IntersectionAmountX(AxisAlignedBB aabb, bool checkIntersection) { if (checkIntersection) { if (!IntersectsAABBY(aabb) && !IntersectsAABBZ(aabb)) { return(0); } } if (MinX < aabb.MaxX && aabb.MinX < MinX) { return(aabb.MaxX - MinX); } if (MaxX > aabb.MinX && aabb.MinX > MinX) { return(MaxX - aabb.MinX); } return(0); }
public bool IntersectsAABB(AxisAlignedBB b) { return(IntersectsAABBX(b) && IntersectsAABBY(b) && IntersectsAABBZ(b)); }
public bool IntersectsAABBZ(AxisAlignedBB aabb) { return(MinZ <= aabb.MaxZ && MaxZ >= aabb.MinZ); }
public bool IntersectsAABBY(AxisAlignedBB aabb) { return(MinY <= aabb.MaxY && MaxY >= aabb.MinY); }
public bool IntersectsAABBX(AxisAlignedBB aabb) { return(MinX <= aabb.MaxX && MaxX >= aabb.MinX); }