@@ -4,6 +4,8 @@ import differ.math.*;
4
4
import differ .shapes .* ;
5
5
import differ .data .* ;
6
6
7
+ /** A ray with a start, end, direction
8
+ and infinite state for collision queries. */
7
9
class Ray {
8
10
9
11
/** The start point of the ray. */
@@ -15,12 +17,12 @@ class Ray {
15
17
Updates only when the dir value is accessed. */
16
18
public var dir (get , never ): Vector ;
17
19
/** Whether or not the ray is infinite. */
18
- public var infinite : InfiniteMode ;
20
+ public var infinite : InfiniteState ;
19
21
20
22
/** Create a new ray with the start and end point,
21
23
which determine the direction of the ray, and optionally specifying
22
- that this ray is an infinite one . */
23
- public function new (_start : Vector , _end : Vector , ? _infinite : InfiniteMode ) {
24
+ that this ray is infinite in some way . */
25
+ public function new (_start : Vector , _end : Vector , ? _infinite : InfiniteState ) {
24
26
25
27
start = _start ;
26
28
end = _end ;
@@ -42,8 +44,17 @@ class Ray {
42
44
43
45
}
44
46
45
- enum InfiniteMode {
47
+ /** A flag for the infinite state of a Ray. */
48
+ enum InfiniteState {
49
+
50
+ /** The line is a fixed length
51
+ between the start and end points. */
52
+ not_infinite ;
53
+ /** The line is infinite
54
+ from it's starting point. */
46
55
infinite_from_start ;
56
+ /** The line is infinite in both
57
+ directions from it's starting point. */
47
58
infinite ;
48
- not_infinite ;
49
- }
59
+
60
+ } // InfiniteState
0 commit comments