toxi.geom
Class TriangleIntersector

java.lang.Object
  extended by toxi.geom.TriangleIntersector
All Implemented Interfaces:
Intersector3D

public class TriangleIntersector
extends java.lang.Object
implements Intersector3D


Field Summary
 Triangle3D triangle
           
 
Constructor Summary
TriangleIntersector()
           
TriangleIntersector(Triangle3D t)
           
 
Method Summary
 IsectData3D getIntersectionData()
           
 Triangle3D getTriangle()
           
 boolean intersectsRay(Ray3D ray)
          Checks if entity intersects with the given ray.
 TriangleIntersector setTriangle(Triangle3D tri)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

triangle

public Triangle3D triangle
Constructor Detail

TriangleIntersector

public TriangleIntersector()

TriangleIntersector

public TriangleIntersector(Triangle3D t)
Method Detail

getIntersectionData

public IsectData3D getIntersectionData()
Specified by:
getIntersectionData in interface Intersector3D
Returns:
intersection data parcel

getTriangle

public Triangle3D getTriangle()
Returns:
the triangle

intersectsRay

public boolean intersectsRay(Ray3D ray)
Description copied from interface: Intersector3D
Checks if entity intersects with the given ray. Further intersection details can then be queried via the IsectData3D instance returned by Intersector3D.getIntersectionData().

Specified by:
intersectsRay in interface Intersector3D
Parameters:
ray - ray to check
Returns:
true, if ray hits the entity

setTriangle

public TriangleIntersector setTriangle(Triangle3D tri)
Parameters:
tri - the triangle to set