Loading src/main/java/org/example/newmat/GraphicsAndWindowsTest.java +5 −3 Original line number Diff line number Diff line Loading @@ -63,7 +63,7 @@ public class GraphicsAndWindowsTest extends Application { ObstacleField obs = new ObstacleField(sceneWindow.getWindowSize(),sceneWindow.getXOffset(), sceneWindow.getYOffset(),350,50, 100, 60, "Box", sceneWindow.getYOffset(),300,-250, 1000, 30, "Box", Color.ORANGERED, false); String[] ob2 = {"--image", "src/teapot.txt", "--speed", "32", "--dir", "4,", "7,", "10"}; Loading @@ -81,6 +81,7 @@ public class GraphicsAndWindowsTest extends Application { Group group3D = new Group(); // Group of our 3D elements obs.addToGroup(group3D); for (MovingObject o : objects ) { o.setTranslate(sceneWindow.getXOffset(), sceneWindow.getYOffset(),0); group3D.getChildren().add(o.getMesh()); Loading @@ -91,7 +92,7 @@ public class GraphicsAndWindowsTest extends Application { group3D.setTranslateZ(250); group3D.getChildren().add(ourWindow); group3D.getChildren().add(new AmbientLight(Color.WHITE)); 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 Loading Loading @@ -243,7 +244,6 @@ public class GraphicsAndWindowsTest extends Application { } direction[i][0] *= -1; lastChanged = 1; } // Window Collision computation for Y Loading Loading @@ -274,6 +274,7 @@ public class GraphicsAndWindowsTest extends Application { List<Object> collisionSide = obs.checkCollision(meshBounds[i]); if(!(collisionSide.get(0).equals("NONE"))){ Bounds obBounds = ((Obstacle) collisionSide.get(1)).getShape().getBoundsInParent(); switch ((String)collisionSide.get(0)){ case "LEFT": direction[i][0] = abs(direction[i][0]); Loading @@ -284,6 +285,7 @@ public class GraphicsAndWindowsTest extends Application { break; case "TOP": y = direction[i][1] - (obBounds.getMaxY() + (meshBounds[i].getMinY() + y)); direction[i][1] = abs(direction[i][1]); break; Loading target/classes/org/example/newmat/GraphicsAndWindowsTest$1.class +224 B (5.09 KiB) File changed.No diff preview for this file type. View original file View changed file target/classes/org/example/newmat/GraphicsAndWindowsTest$2.class (830 B) File changed.No diff preview for this file type. View original file View changed file target/classes/org/example/newmat/GraphicsAndWindowsTest.class +2 B (6.55 KiB) File changed.No diff preview for this file type. View original file View changed file Loading
src/main/java/org/example/newmat/GraphicsAndWindowsTest.java +5 −3 Original line number Diff line number Diff line Loading @@ -63,7 +63,7 @@ public class GraphicsAndWindowsTest extends Application { ObstacleField obs = new ObstacleField(sceneWindow.getWindowSize(),sceneWindow.getXOffset(), sceneWindow.getYOffset(),350,50, 100, 60, "Box", sceneWindow.getYOffset(),300,-250, 1000, 30, "Box", Color.ORANGERED, false); String[] ob2 = {"--image", "src/teapot.txt", "--speed", "32", "--dir", "4,", "7,", "10"}; Loading @@ -81,6 +81,7 @@ public class GraphicsAndWindowsTest extends Application { Group group3D = new Group(); // Group of our 3D elements obs.addToGroup(group3D); for (MovingObject o : objects ) { o.setTranslate(sceneWindow.getXOffset(), sceneWindow.getYOffset(),0); group3D.getChildren().add(o.getMesh()); Loading @@ -91,7 +92,7 @@ public class GraphicsAndWindowsTest extends Application { group3D.setTranslateZ(250); group3D.getChildren().add(ourWindow); group3D.getChildren().add(new AmbientLight(Color.WHITE)); 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 Loading Loading @@ -243,7 +244,6 @@ public class GraphicsAndWindowsTest extends Application { } direction[i][0] *= -1; lastChanged = 1; } // Window Collision computation for Y Loading Loading @@ -274,6 +274,7 @@ public class GraphicsAndWindowsTest extends Application { List<Object> collisionSide = obs.checkCollision(meshBounds[i]); if(!(collisionSide.get(0).equals("NONE"))){ Bounds obBounds = ((Obstacle) collisionSide.get(1)).getShape().getBoundsInParent(); switch ((String)collisionSide.get(0)){ case "LEFT": direction[i][0] = abs(direction[i][0]); Loading @@ -284,6 +285,7 @@ public class GraphicsAndWindowsTest extends Application { break; case "TOP": y = direction[i][1] - (obBounds.getMaxY() + (meshBounds[i].getMinY() + y)); direction[i][1] = abs(direction[i][1]); break; Loading
target/classes/org/example/newmat/GraphicsAndWindowsTest$1.class +224 B (5.09 KiB) File changed.No diff preview for this file type. View original file View changed file
target/classes/org/example/newmat/GraphicsAndWindowsTest$2.class (830 B) File changed.No diff preview for this file type. View original file View changed file
target/classes/org/example/newmat/GraphicsAndWindowsTest.class +2 B (6.55 KiB) File changed.No diff preview for this file type. View original file View changed file