XJRT Rendering Toolkit 1.0b06

org.autochthonous.graphics.rt.objects
Class Polygon

java.lang.Object
  extended byorg.autochthonous.graphics.rt.Renderable
      extended byorg.autochthonous.graphics.rt.Bounded
          extended byorg.autochthonous.graphics.rt.objects.Polygon
All Implemented Interfaces:
java.lang.Cloneable, ColorCalculator, NormalCalculator, Partitionable, TextureMapper, Traceable

public class Polygon
extends Bounded
implements NormalCalculator, TextureMapper

A polygon.

Example:

    <Polygon color="1,0,0">
        <Vertices>
            0.000, 1.000, 0.000,
            1.000, 1.000, 0.000,
            1.000, 0.000, 0.000,
            0.000, 0.000, 0.000
        </Vertices>
    </Polygon>
 

Document Type Definition:

     <!ENTITY %Color3f "CDATA">

     <!ELEMENT Polygon (Vertices)>
     <!ATTLIST Polygon
         color  %Color3f; "1, 1, 1">
 


Field Summary
 
Fields inherited from class org.autochthonous.graphics.rt.Bounded
bBox
 
Fields inherited from class org.autochthonous.graphics.rt.Renderable
color, objToRay, rayToObj, selfShadowing, shader
 
Fields inherited from interface org.autochthonous.graphics.rt.TextureMapper
S, T
 
Constructor Summary
Polygon(int nSides, Point3f[] verts)
           
Polygon(Point3f[] verts)
           
 
Method Summary
static Polygon getInstance(RMLReader in)
           
 void getN(Hit hit, Vector3f n)
          set the normal for this hit point (object space) in hd the value is returned in n
 boolean getST(Tuple3f l, float[] uv)
           
 HitList intersections(Ray r)
           
 boolean isIntersected(Ray r)
           
 boolean isShadowing(Ray r)
           
protected  void processObject(java.lang.Object obj)
           
 
Methods inherited from class org.autochthonous.graphics.rt.Bounded
bBox, setBBox, setBBox, transform
 
Methods inherited from class org.autochthonous.graphics.rt.Renderable
clone, createObjectSpaceRay, getColor, getColor, getShader, hasShader, isSelfShadowing, processParameters, readObject, setColor, setColor, setSelfShadowing, setShader, toObjectSpace, toObjectSpace, transformNormal
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.autochthonous.graphics.rt.Traceable
clone
 

Constructor Detail

Polygon

public Polygon(Point3f[] verts)

Polygon

public Polygon(int nSides,
               Point3f[] verts)
Method Detail

getInstance

public static Polygon getInstance(RMLReader in)
                           throws java.io.IOException
Throws:
java.io.IOException

processObject

protected void processObject(java.lang.Object obj)
Overrides:
processObject in class Renderable

isShadowing

public boolean isShadowing(Ray r)
Specified by:
isShadowing in interface Traceable
Specified by:
isShadowing in class Bounded

intersections

public HitList intersections(Ray r)
Specified by:
intersections in interface Traceable

isIntersected

public boolean isIntersected(Ray r)
Specified by:
isIntersected in interface Traceable
Specified by:
isIntersected in class Bounded

getN

public void getN(Hit hit,
                 Vector3f n)
Description copied from interface: NormalCalculator
set the normal for this hit point (object space) in hd the value is returned in n

Specified by:
getN in interface NormalCalculator

getST

public boolean getST(Tuple3f l,
                     float[] uv)
Specified by:
getST in interface TextureMapper

XJRT Rendering Toolkit 1.0b06