tracer
Class Triangle

java.lang.Object
  extended by tracer.Traceable
      extended by tracer.Triangle

public class Triangle
extends Traceable


Field Summary
(package private)  Vec3 a
           
(package private)  Vec3 b
           
(package private)  Vec3 c
           
(package private)  float u1
           
(package private)  float u2
           
(package private)  float u3
           
(package private)  float v1
           
(package private)  float v2
           
(package private)  float v3
           
 
Fields inherited from class tracer.Traceable
material
 
Constructor Summary
Triangle()
           
Triangle(Vec3 p1, Vec3 p2, Vec3 p3)
           
 
Method Summary
 boolean hit(Ray r)
          Returns a boolean indicating whether the line segment (r.origin + t*r.direction) with 0 <= t <= 1 intersects the object.
 IntersectionInfo intersect(Ray r)
          Returns an IntersectionInfo object indicating whether the ray r intersects this object or not.
 void parse(Parser p)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

a

Vec3 a

b

Vec3 b

c

Vec3 c

u1

float u1

v1

float v1

u2

float u2

v2

float v2

u3

float u3

v3

float v3
Constructor Detail

Triangle

public Triangle(Vec3 p1,
                Vec3 p2,
                Vec3 p3)

Triangle

public Triangle()
Method Detail

parse

public void parse(Parser p)
           throws java.io.IOException
Throws:
java.io.IOException

intersect

public IntersectionInfo intersect(Ray r)
Description copied from class: Traceable
Returns an IntersectionInfo object indicating whether the ray r intersects this object or not.

Specified by:
intersect in class Traceable
See Also:
IntersectionInfo

hit

public boolean hit(Ray r)
Description copied from class: Traceable
Returns a boolean indicating whether the line segment (r.origin + t*r.direction) with 0 <= t <= 1 intersects the object.

Specified by:
hit in class Traceable