Added a Graph datastructure and refactored the Line/Vertex classes

This commit is contained in:
Quinn
2023-05-02 09:49:38 -05:00
parent 9b0acbe34c
commit 3321e77061
18 changed files with 859 additions and 68 deletions

View File

@@ -1,8 +1,6 @@
import Vector.Vector;
import processing.core.*;
import java.util.ArrayList;
import java.util.Objects;
import static processing.core.PApplet.*;
public class View {
Vector pose;
@@ -35,7 +33,9 @@ public class View {
public void look(ArrayList<Wall> walls) {
for (Ray ray : rays) {
ray.castRay(walls);
ray.drawRay(proc);
if(ray.hasCollided()){
ray.drawRay(proc);
}
}
}
@@ -80,8 +80,7 @@ public class View {
ArrayList<Vector> points = new ArrayList<>();
for (Ray ray : rays) {
if (!Objects.equals(ray.getPoint(), new Vector(0, 0) {
})) {
if (ray.hasCollided()){
points.add(ray.getPoint());
}
}