public Cube getCube(int x, int y, int z) { // returns a cube if x,y,z lie within it Cube returnCube = null; for (Cube cube : cubes) { if (cube.collisionLooking(-x, -y, -z)) { returnCube = cube; break; } } return returnCube; }
public boolean collisionLooking(float x, float y, float z) { // collision for selecting a cube being looked at boolean collision = false; for (Cube cube : cubes) { if (cube.collisionLooking(-x, -y, -z)) { collision = true; break; } } return collision; }