Got rid of as many warnings as possible.
This commit is contained in:
@@ -18,12 +18,12 @@ public class Car{
|
||||
|
||||
// default constructor
|
||||
Car(PApplet processing){
|
||||
this.proc = processing;
|
||||
proc = processing;
|
||||
slam = new SLAM(proc);
|
||||
}
|
||||
|
||||
Car(PApplet processing, int xPos, int yPos, int carLength, int carWidth){
|
||||
this.proc = processing;
|
||||
proc = processing;
|
||||
slam = new SLAM(proc);
|
||||
this.pose = new PVector(xPos, yPos);
|
||||
this.carLength = carLength;
|
||||
|
||||
@@ -6,7 +6,7 @@ import java.util.ArrayList;
|
||||
public class Processing extends PApplet {
|
||||
|
||||
Car car;
|
||||
ArrayList<Wall> objects = new ArrayList<Wall>();
|
||||
ArrayList<Wall> objects = new ArrayList<>();
|
||||
|
||||
public static PApplet processing;
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import java.util.ArrayList;
|
||||
import static processing.core.PApplet.pow;
|
||||
|
||||
public class SLAM{
|
||||
ArrayList<PVector> points = new ArrayList<PVector>();
|
||||
ArrayList<PVector> points = new ArrayList<>();
|
||||
private static PApplet proc;
|
||||
|
||||
SLAM(PApplet processing){
|
||||
@@ -33,7 +33,7 @@ class Line{
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief attempt to find the line of best fit for the given points
|
||||
* attempt to find the line of best fit for the given points
|
||||
* @param points the points to get the line of best for
|
||||
*/
|
||||
Line(PApplet processing, ArrayList<PVector> points){
|
||||
|
||||
@@ -67,7 +67,7 @@ public class View{
|
||||
|
||||
//gets the point that each ray has collided with
|
||||
public ArrayList<PVector> getPoints(){
|
||||
ArrayList<PVector> points = new ArrayList<PVector>();
|
||||
ArrayList<PVector> points = new ArrayList<>();
|
||||
|
||||
for(Ray ray : rays){
|
||||
if(!Objects.equals(ray.getPoint(), new PVector(0, 0) {
|
||||
@@ -102,7 +102,7 @@ class Ray{
|
||||
//checks to see at what coordinate the ray will collide with an object and sets the ray length to meet that point.
|
||||
public void castRay(ArrayList<Wall> objects){
|
||||
this.rayLength = defaultRayLength;
|
||||
ArrayList<Integer> distances = new ArrayList<Integer>();
|
||||
ArrayList<Integer> distances = new ArrayList<>();
|
||||
//sees what objects it collides with
|
||||
for(Wall object : objects){
|
||||
float theta1 = angle;
|
||||
@@ -141,8 +141,7 @@ class Ray{
|
||||
public float getAngle(){return this.angle;}
|
||||
|
||||
public boolean hasCollided(){
|
||||
if(this.defaultRayLength != this.rayLength){return true;}
|
||||
else{return false;}
|
||||
return this.defaultRayLength != this.rayLength;
|
||||
}
|
||||
|
||||
//returns the absolute position of the point
|
||||
|
||||
Reference in New Issue
Block a user