net.sf.j3d.threeD.raytracer.primitives
Class Plane

java.lang.Object
  extended by net.sf.j3d.threeD.raytracer.engine.AbstractSurface
      extended by net.sf.j3d.threeD.raytracer.primitives.Plane
All Implemented Interfaces:
ParticleGroup, Surface
Direct Known Subclasses:
Plane, RectangularLight

public class Plane
extends AbstractSurface
implements ParticleGroup

A Plane object represents an plane in 3d space.


Field Summary
static int XY
          Integer code for XY plane.
static int XZ
          Integer code for XZ plane.
static int YZ
          Integer code for YZ plane.
 
Constructor Summary
Plane()
          Constructs a Plane object that represents an XY plane that is black.
Plane(int type)
          Constructs a Plane object that represents a Plane with the orientation specified by an integer code.
Plane(int type, RGB color)
          Constructs a Plane object that represents an XY plane with the specified color.
 
Method Summary
 Vector getNormalAt(Vector point)
          Returns a Vector object that represents the vector normal to this plane at the point represented by the specified Vector object.
 double[][] getParticleVertices()
           
 int getType()
          Returns the integer code for the orientation of this Plane object.
 boolean intersect(Ray ray)
          Returns true if the ray represented by the specified Ray object intersects the plane represented by this Plane object in real space.
 Intersection intersectAt(Ray ray)
          Returns an Intersection object representing the points along the ray represented by the specified Ray object that intersection between the ray and the plane represented by this Plane object occurs.
 void setType(int type)
          Sets the orientation of this Plane object to the orientation specified by the integer type code.
 
Methods inherited from class net.sf.j3d.threeD.raytracer.engine.AbstractSurface
addShader, addTexture, addTransform, calculateTransform, getColor, getColorAt, getColorAt, getIndexOfRefraction, getIndexOfRefraction, getLocation, getParent, getReflectedPercentage, getReflectedPercentage, getRefractedPercentage, getRefractedPercentage, getRotationCoefficients, getScaleCoefficients, getShadeBack, getShadeFront, getShaderSet, getSize, getTexture, getTextures, getTextureSet, getTransform, getTransform, getTransforms, removeTexture, removeTransform, setColor, setIndexOfRefraction, setLocation, setParent, setReflectedPercentage, setRefractedPercentage, setRotationCoefficients, setScaleCoefficients, setShadeBack, setShadeFront, setShaders, setShaders, setSize, setTexture, setTextures, setTransform, setTransforms, shade, triangulate
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

XY

public static final int XY
Integer code for XY plane.

See Also:
Constant Field Values

XZ

public static final int XZ
Integer code for XZ plane.

See Also:
Constant Field Values

YZ

public static final int YZ
Integer code for YZ plane.

See Also:
Constant Field Values
Constructor Detail

Plane

public Plane()
Constructs a Plane object that represents an XY plane that is black.


Plane

public Plane(int type)
Constructs a Plane object that represents a Plane with the orientation specified by an integer code.


Plane

public Plane(int type,
             RGB color)
Constructs a Plane object that represents an XY plane with the specified color.

Method Detail

setType

public void setType(int type)
Sets the orientation of this Plane object to the orientation specified by the integer type code.

Throws:
IllegalArgumentException - If the specified type code is not valid.

getType

public int getType()
Returns the integer code for the orientation of this Plane object.


getNormalAt

public Vector getNormalAt(Vector point)
Returns a Vector object that represents the vector normal to this plane at the point represented by the specified Vector object.

Specified by:
getNormalAt in interface Surface

intersect

public boolean intersect(Ray ray)
Returns true if the ray represented by the specified Ray object intersects the plane represented by this Plane object in real space.

Specified by:
intersect in interface Surface

intersectAt

public Intersection intersectAt(Ray ray)
Returns an Intersection object representing the points along the ray represented by the specified Ray object that intersection between the ray and the plane represented by this Plane object occurs.

Specified by:
intersectAt in interface Surface

getParticleVertices

public double[][] getParticleVertices()
Specified by:
getParticleVertices in interface ParticleGroup
See Also:
ParticleGroup.getParticleVertices()