public bool IntersectsTopY(VoxelVector3Int point) { bool intersecting = false; if (point.y > corners.bot_left_front.y && point.y <= corners.top_left_front.y) { intersecting = true; } return(intersecting); }
public bool IntersectsBackZ(VoxelVector3Int point) { bool intersecting = false; if (point.z > corners.bot_left_front.z && point.z <= corners.bot_left_back.z) { intersecting = true; } return(intersecting); }
public bool IntersectsRightX(VoxelVector3Int point) { bool intersecting = false; if (point.x > corners.bot_left_front.x && point.x <= corners.bot_right_front.x) { intersecting = true; } return(intersecting); }
// --------------------------------------------------------------------------------------------- // // --------------------------------------------------------------------------------------------- public static VoxelCorners createVoxelCorners(VoxelVector3Int pos, int width, int height, int depth) { VoxelCorners vc = new VoxelCorners(); vc.bot_left_front = new VoxelVector3Int(pos.x, pos.y, pos.z); vc.bot_left_back = new VoxelVector3Int(pos.x, pos.y, pos.z + depth - 1); vc.bot_right_back = new VoxelVector3Int(pos.x + width - 1, pos.y, pos.z + depth - 1); vc.bot_right_front = new VoxelVector3Int(pos.x + width - 1, pos.y, pos.z); vc.top_left_front = new VoxelVector3Int(pos.x, pos.y + height - 1, pos.z); vc.top_left_back = new VoxelVector3Int(pos.x, pos.y + height - 1, pos.z + depth - 1); vc.top_right_back = new VoxelVector3Int(pos.x + width - 1, pos.y + height - 1, pos.z + depth - 1); vc.top_right_front = new VoxelVector3Int(pos.x + width - 1, pos.y + height - 1, pos.z); return(vc); }
// public bool Intersects(VoxelVector3Int point) { bool intersecting = false; if (point.x > corners.bot_left_front.x && point.x < corners.bot_right_front.x) { if (point.y > corners.bot_left_front.y && point.y < corners.top_right_front.y) { if (point.z > corners.bot_left_front.z && point.z < corners.bot_left_back.z) { intersecting = true; } } } return(intersecting); }