Subversion Repositories gelsvn

Rev

Rev 422 | Rev 510 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 422 Rev 426
Line 15... Line 15...
15
    {
15
    {
16
        // Constructor
16
        // Constructor
17
        Ray() 
17
        Ray() 
18
          : origin(0.0f), direction(0.0f), hit_pos(0.0f), hit_normal(0.0f), 
18
          : origin(0.0f), direction(0.0f), hit_pos(0.0f), hit_normal(0.0f), 
19
            has_hit(false), dist(CGLA::BIG), ior(1.0f), u(0.0f), v(0.0f), 
19
            has_hit(false), dist(CGLA::BIG), ior(1.0f), u(0.0f), v(0.0f), 
20
            hit_object(0), trace_depth(0)
20
            hit_object(0), trace_depth(0), inside(false), did_hit_diffuse(false)
21
        { }
21
        { }
22
 
22
 
23
        Ray(const CGLA::Vec3f& _origin, const CGLA::Vec3f& _direction) 
23
        Ray(const CGLA::Vec3f& _origin, const CGLA::Vec3f& _direction) 
24
          : origin(_origin), direction(_direction), hit_pos(0.0f), hit_normal(0.0f), 
24
          : origin(_origin), direction(_direction), hit_pos(0.0f), hit_normal(0.0f), 
25
            has_hit(false), dist(CGLA::BIG), ior(1.0f), u(0.0f), v(0.0f), 
25
            has_hit(false), dist(CGLA::BIG), ior(1.0f), u(0.0f), v(0.0f), 
26
            hit_object(0), trace_depth(0)
26
            hit_object(0), trace_depth(0), inside(false), did_hit_diffuse(false)
27
        { }
27
        { }
28
 
28
 
29
        CGLA::Vec3f origin;
29
        CGLA::Vec3f origin;
30
        CGLA::Vec3f direction;
30
        CGLA::Vec3f direction;
31
        CGLA::Vec3f hit_pos;
31
        CGLA::Vec3f hit_pos;
32
        CGLA::Vec3f hit_normal;
32
        CGLA::Vec3f hit_normal;
33
 
33
 
34
        bool has_hit; // Did the ray hit an object
34
        bool has_hit; // Did the ray hit an object
35
        bool inside;  // Is the ray inside an object
35
        bool inside;  // Is the ray inside an object
-
 
36
        bool did_hit_diffuse;
36
 
37
 
37
        double dist;  // Distance from origin to current intersection
38
        double dist;  // Distance from origin to current intersection
38
        float ior;    // Current index of refraction for media
39
        float ior;    // Current index of refraction for media
39
        float u, v;   // uv-coordinates on current surface
40
        float u, v;   // uv-coordinates on current surface
40
 
41