gnu.gleem.linalg
Class Plane

java.lang.Object
  |
  +--gnu.gleem.linalg.Plane

public class Plane
extends java.lang.Object

Represents a plane in 3D space.


Constructor Summary
Plane()
          Default constructor initializes normal to (0, 1, 0) and point to (0, 0, 0)
Plane(Vec3f normal, Vec3f point)
          Sets all parameters of plane.
 
Method Summary
 Vec3f getNormal()
          Normal is normalized internally, so normal is not necessarily equal to plane.setNormal(normal); plane.getNormal();
 Vec3f getPoint()
           
 boolean intersectRay(Vec3f rayStart, Vec3f rayDirection, IntersectionPoint intPt)
          Intersect a ray with the plane.
 void projectPoint(Vec3f pt, Vec3f projPt)
          Project a point onto the plane
 void setNormal(Vec3f normal)
          Setter does some work to maintain internal caches.
 void setPoint(Vec3f point)
          Setter does some work to maintain internal caches
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Plane

public Plane()
Default constructor initializes normal to (0, 1, 0) and point to (0, 0, 0)


Plane

public Plane(Vec3f normal,
             Vec3f point)
Sets all parameters of plane. Plane has normal normal and goes through the point point. Normal does not need to be unit length but must not be the zero vector.

Method Detail

setNormal

public void setNormal(Vec3f normal)
Setter does some work to maintain internal caches. Normal does not need to be unit length but must not be the zero vector.


getNormal

public Vec3f getNormal()
Normal is normalized internally, so normal is not necessarily equal to plane.setNormal(normal); plane.getNormal();


setPoint

public void setPoint(Vec3f point)
Setter does some work to maintain internal caches


getPoint

public Vec3f getPoint()

projectPoint

public void projectPoint(Vec3f pt,
                         Vec3f projPt)
Project a point onto the plane


intersectRay

public boolean intersectRay(Vec3f rayStart,
                            Vec3f rayDirection,
                            IntersectionPoint intPt)
Intersect a ray with the plane. Returns true if intersection occurred, false otherwise. This is a two-sided ray cast.