Normand Briere
2019-09-17 54adfcbf93eb477bedeec45409f36cf7e102b790
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
48
//package comp557.a5;
 
import javax.vecmath.Point3d;
import javax.vecmath.Vector3d;
 
/**
 * Use this class to store the result of an intersection.
 */
public class IntersectResult
{
 
    /** The normal at the intersection */
    public Vector3d n = new Vector3d();
    
    /** Intersection position */
    //public Point3d p = new Point3d();
    
    /** The object of the intersection */
    public Object3D object = null;
    
    /** Parameter on the ray giving the position of the intersection */
    public double t = Double.POSITIVE_INFINITY;
    
    //public boolean isIntersected = false;
    //public int id = -1;
    
    // UV Coordinates of the object
    public double u = Double.NaN;
    public double v = Double.NaN;
 
    /**
     * Default constructor.
     */
    IntersectResult()
    {
        // do nothing
    }
 
    /**
     * Copy constructor.
     */
    IntersectResult(IntersectResult other)
    {
        n.set(other.n);
        //p.set(other.p);
        t = other.t;
    }
}