-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathEnv.java
More file actions
47 lines (45 loc) · 1.6 KB
/
Env.java
File metadata and controls
47 lines (45 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import javax.vecmath.Vector3d;
import javax.vecmath.Vector3f;
import simbad.sim.*;
public class Env extends EnvironmentDescription {
Env(){
floorColor = white;
backgroundColor = darkgray;
light1SetPosition(-8, 2, 5); //Changes the position of the light
light1IsOn = true;
light2IsOn = false; //We only want one light source, the goal
light2Color = black; //To be sure it is closed and doesn't affect the environment
//Adds obstacles
Wall w1 = new Wall(new Vector3d(-6, 0, 0), 6, 1, this);
w1.rotate90(1);
add(w1);
boxColor = blue;
add(new Box(new Vector3d(0,0,0), new Vector3f(1,1,1),this));
add(new Box(new Vector3d(-3.5,0,5), new Vector3f(2,1,1),this));
//Creates Line
Line l1 = new Line((new Vector3d(3, 0, 0)), 3, this);
l1.rotate90(1);
add(l1);
Line l2 = new Line(new Vector3d(6, 0, 0), 3, this);
add(l2);
Line l3 = new Line(new Vector3d(0, 0, 3), 6, this);
l3.rotate90(1);
add(l3);
Line l4 = new Line(new Vector3d(0, 0, 0), 3, this);
add(l4);
Line l5 = new Line(new Vector3d(-4, 0, 0), 5, this);
add(l5);
Line l6 = new Line(new Vector3d(-7, 0, 5), 3, this);
l6.rotate90(1);
add(l6);
Line l7 = new Line(new Vector3d(-7, 0, 0), 4, this);
l7.rotate90(1);
add(l7);
Line l8 = new Line(new Vector3d(-2, 0, 0), 2, this);
l8.rotate90(1);
add(l8);
//Adds robot
MyRobot r = new MyRobot(new Vector3d(3, 0, 0), "robot 1");
add(r);
}
}