Ray casting now only supports distance specification.
#story[1100]
This commit is contained in:
@@ -12,8 +12,8 @@ import static org.junit.Assert.*;
|
||||
|
||||
public class MockBoatTest {
|
||||
private MockBoat boat;
|
||||
private CompoundMark ahead;
|
||||
private CompoundMark behind;
|
||||
private CompoundMark near;
|
||||
private CompoundMark far;
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
@@ -21,17 +21,17 @@ public class MockBoatTest {
|
||||
boat.setCurrentPosition(new GPSCoordinate(0,0));
|
||||
boat.setBearing(Bearing.fromDegrees(180));
|
||||
|
||||
ahead = new CompoundMark(0, "Ahead", new Mark(0, "Ahead", new GPSCoordinate(-.0001, 0)));
|
||||
behind = new CompoundMark(1, "Behind", new Mark(0, "Behind", new GPSCoordinate(.0001, 0)));
|
||||
near = new CompoundMark(0, "Near", new Mark(0, "Near", new GPSCoordinate(-.0001, 0)));
|
||||
far = new CompoundMark(1, "Far", new Mark(0, "Far", new GPSCoordinate(.001, 0)));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void markAheadOfBoat0() {
|
||||
assertTrue(ahead.rayCast(boat, new Collision(Bearing.fromDegrees(0), 100)));
|
||||
public void nearMarkWithin100m() {
|
||||
assertTrue(near.rayCast(boat, 100));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void markBehindBoat180() {
|
||||
assertTrue(behind.rayCast(boat, new Collision(Bearing.fromDegrees(180), 100)));
|
||||
public void farMarkBeyond100m() {
|
||||
assertFalse(far.rayCast(boat, 100));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user