Bouncy Castle Rendering Toolkit 1.0

org.bouncycastle.graphics.rt.objects
Class Polygon

java.lang.Object
  |
  +--org.bouncycastle.graphics.rt.Renderable
        |
        +--org.bouncycastle.graphics.rt.Bounded
              |
              +--org.bouncycastle.graphics.rt.objects.Polygon
All Implemented Interfaces:
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">
 


Fields inherited from class org.bouncycastle.graphics.rt.Bounded
bBox
 
Fields inherited from class org.bouncycastle.graphics.rt.Renderable
color, objToRay, rayToObj, selfShadowing, shader
 
Fields inherited from interface org.bouncycastle.graphics.rt.TextureMapper
S, T
 
Constructor Summary
Polygon(int nSides, 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.bouncycastle.graphics.rt.Bounded
bBox, setBBox, setBBox, transform
 
Methods inherited from class org.bouncycastle.graphics.rt.Renderable
createObjectSpaceRay, getColor, getColor, getShader, isSelfShadowing, processParameters, readObject, setColor, setColor, setSelfShadowing, setShader, toObjectSpace, toObjectSpace, transformNormal
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Polygon

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

getInstance

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

processObject

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

isShadowing

public boolean isShadowing(Ray r)
Overrides:
isShadowing in class Bounded

intersections

public HitList intersections(Ray r)

isIntersected

public boolean isIntersected(Ray r)
Overrides:
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

Bouncy Castle Rendering Toolkit 1.0