Commit b5f80500 authored by Timothy  Borunov's avatar Timothy Borunov
Browse files

with obstacles turned back on

parent 718e8a98
Loading
Loading
Loading
Loading
+9 −9
Original line number Diff line number Diff line
@@ -46,7 +46,7 @@ public class GraphicsAndWindowsTest extends Application {
    public void start(Stage stage) throws IOException {
        VisibleWindow sceneWindow = new VisibleWindow(500, 600, 200);
        Box ourWindow = sceneWindow.makeWindow();
        //Obstacle obs = new Obstacle(sceneWindow.getWindowSize(),sceneWindow.getXOffset(), sceneWindow.getYOffset(),10,100);
        Obstacle obs = new Obstacle(sceneWindow.getWindowSize(),sceneWindow.getXOffset(), sceneWindow.getYOffset(),10,100);

        String[] ob2 = {"--image", "src/teapot.txt", "--speed", "20", "--dir", "4,", "10,", "6"};
        String[] ob3 = {"--image", "src/teapot.txt", "--speed", "5", "--dir", "1,", "1,", "1"};
@@ -73,7 +73,7 @@ public class GraphicsAndWindowsTest extends Application {
        group3D.getChildren().add(newObject3.getMesh());
        group3D.getChildren().add(ourWindow);
        group3D.getChildren().add(new AmbientLight(Color.WHITE));
        //obs.addToGroup(group3D);
        obs.addToGroup(group3D);

        // NOTE: Due to the perspectiveCamera it looks like it is rotating even though it isn't
        // If you comment out this line and the scene.setCamera(camera) line
@@ -243,19 +243,19 @@ public class GraphicsAndWindowsTest extends Application {
                            //mesh.getPoints().setAll(points);

                        }
                    /*
                    if(obs.checkCollision(meshBounds)){

                    if(obs.checkCollision(meshBounds[i])){
                        switch (lastChanged){
                            case 1: directionX *= -1;
                            case 1: direction[i][0] *= -1;

                            case 2: directionY *= -1;
                            case 2: direction[i][1] *= -1;

                            case 3: directionZ *= -1;
                            case 3: direction[i][2] *= -1;

                            default: System.out.println();
                        }
                        directionY *= -1;
                    }*/
                        direction[i][1] *= -1;
                    }
                        objects[i].updateTranslate(objects[i].getTranslate().getX() + direction[i][0], objects[i].getTranslate().getY() + direction[i][1], objects[i].getTranslate().getZ() + direction[i][2]);
                        System.out.println(Arrays.toString(objects[i].getCentroid()));
                        objects[i].updateRays();