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