Bouncy Castle Rendering Toolkit 1.0

org.bouncycastle.graphics.rt
Class Renderable

java.lang.Object
  |
  +--org.bouncycastle.graphics.rt.Renderable
All Implemented Interfaces:
ColorCalculator, Traceable
Direct Known Subclasses:
Aggregate, Bounded, BvTree, World

public abstract class Renderable
extends java.lang.Object
implements Traceable, ColorCalculator


Field Summary
protected  Color3f color
           
protected  Matrix4f objToRay
           
protected  Matrix4f rayToObj
           
protected  boolean selfShadowing
           
protected  Shader shader
           
 
Constructor Summary
Renderable()
           
 
Method Summary
 Ray createObjectSpaceRay(Ray r)
          return a new ray which represents an object space version of the ray passed in.
 Color3f getColor()
          return the base color for the object.
 void getColor(Hit hit, Color3f c)
          return the base color for the object in the passed in Hit.
 Shader getShader()
           
abstract  boolean isIntersected(Ray r)
           
 boolean isSelfShadowing()
          return whether or not we are self shadowing.
abstract  boolean isShadowing(Ray r)
           
protected  void processObject(java.lang.Object obj)
           
protected  void processParameters(ParametersMap params)
           
protected  void readObject(RMLReader in)
          initialise a renderable object from a RMLReader.
 void setColor(Color3f color)
          set the base color for this object.
 void setColor(double r, double g, double b)
          set the base color for this object.
 void setSelfShadowing(boolean selfShadowing)
          set whether or not we are self shadowing
 void setShader(Shader shader)
           
 void toObjectSpace(Point3f p)
          transform the passed point to object space.
 void toObjectSpace(Vector3f v)
          transform the passed vector to object space.
 void transform(Matrix4f trans)
          apply the given 4x4 transform to the object.
 void transformNormal(Vector3f objN, Vector3f rayN)
          transform the passed vector form object space to ray space.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.bouncycastle.graphics.rt.Traceable
intersections
 

Field Detail

shader

protected Shader shader

color

protected Color3f color

objToRay

protected Matrix4f objToRay

rayToObj

protected Matrix4f rayToObj

selfShadowing

protected boolean selfShadowing
Constructor Detail

Renderable

public Renderable()
Method Detail

readObject

protected void readObject(RMLReader in)
                   throws java.io.IOException
initialise a renderable object from a RMLReader.

processParameters

protected void processParameters(ParametersMap params)

processObject

protected void processObject(java.lang.Object obj)

setShader

public void setShader(Shader shader)

getShader

public Shader getShader()

setColor

public void setColor(double r,
                     double g,
                     double b)
set the base color for this object.

setColor

public void setColor(Color3f color)
set the base color for this object.

getColor

public Color3f getColor()
return the base color for the object.

setSelfShadowing

public void setSelfShadowing(boolean selfShadowing)
set whether or not we are self shadowing

isSelfShadowing

public boolean isSelfShadowing()
return whether or not we are self shadowing.

getColor

public void getColor(Hit hit,
                     Color3f c)
return the base color for the object in the passed in Hit.
Specified by:
getColor in interface ColorCalculator

transform

public void transform(Matrix4f trans)
apply the given 4x4 transform to the object.

transformNormal

public void transformNormal(Vector3f objN,
                            Vector3f rayN)
transform the passed vector form object space to ray space.

toObjectSpace

public void toObjectSpace(Point3f p)
transform the passed point to object space.

toObjectSpace

public void toObjectSpace(Vector3f v)
transform the passed vector to object space.

createObjectSpaceRay

public Ray createObjectSpaceRay(Ray r)
return a new ray which represents an object space version of the ray passed in.

isIntersected

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

isShadowing

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

Bouncy Castle Rendering Toolkit 1.0