forked from JHaack4/CaveGen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWayPoint.java
38 lines (31 loc) · 909 Bytes
/
WayPoint.java
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
import java.util.*;
class WayPoint {
int idx;
ArrayList<Integer> links;
float x, y, z, radius; // relative position to mapunit.
MapUnit mapUnit = null;
// used to construct the waypoint graph
ArrayList<WayPoint> adj;
ArrayList<WayPoint> inverts;
boolean isStart = false;
WayPoint backWp = null;
float distToStart = Integer.MAX_VALUE;
float posX, posY, posZ; // global position in the sublevel
boolean visited = false; // for BFS
boolean hasCarryableBehind = false; // for judge
Vec3 vec = null;
WayPoint copy() {
WayPoint wp = new WayPoint();
wp.idx = idx;
wp.links = new ArrayList<Integer>();
for (Integer i: links) wp.links.add(i);
wp.x = x;
wp.y = y;
wp.z = z;
wp.radius = radius;
return wp;
}
void wayPointPos() {
mapUnit.wayPointPos(this);
}
}