cz.cuni.jagrlib
Class CSGLeaf

java.lang.Object
  extended by cz.cuni.jagrlib.DefaultSceneNode
      extended by cz.cuni.jagrlib.CSGCommonNode
          extended by cz.cuni.jagrlib.CSGLeaf
All Implemented Interfaces:
TimeDependent, IntersectionAttributes, SceneNode

public class CSGLeaf
extends CSGCommonNode

Leaf node (holding elementary solid) of CSG scene representation.

Since:
0.11
Version:
0.26 $Rev: 918 $ $Date: 2010-04-08 03:18:02 +0200 (čt, 08 IV 2010) $ $Author: pepca $
See Also:
CSGLeaf.java, Solid, CSGNode

Field Summary
 Solid solid
          Solid which is assigned to this leaf-node.
 
Fields inherited from class cz.cuni.jagrlib.CSGCommonNode
attr, order, parent, root
 
Fields inherited from class cz.cuni.jagrlib.DefaultSceneNode
serial
 
Fields inherited from interface cz.cuni.jagrlib.SceneNode
ATTR_COLOR, ATTR_LIGHT_MODEL, ATTR_MATERIAL, ATTR_TEXTURE
 
Constructor Summary
CSGLeaf(Solid _solid)
          Initializing constructor.
 
Method Summary
 List<MicroFacet> intersection(double[] P0, double[] P1)
          Computes all intersections of the given ray with the solid.
 void setTime(double time)
          Sets the actual time value for the scene (used in animations).
 
Methods inherited from class cz.cuni.jagrlib.CSGCommonNode
assertAttributes, getAttribute, getAttributes, getOrder, getParent, getTime, getTimeInterval, isObjectRoot, selfAttribute, setAttribute, setObjectRoot, setOrder, setParent
 
Methods inherited from class cz.cuni.jagrlib.DefaultSceneNode
getChild, getChildMatrix, getChildMatrixInv, getSerial, children, insertChild, removeChild, setSerial
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

solid

public Solid solid
Solid which is assigned to this leaf-node. One Solid instance can be shared among multiple CSGLeafNodes.

Constructor Detail

CSGLeaf

public CSGLeaf(Solid _solid)
Initializing constructor.

Method Detail

intersection

public List<MicroFacet> intersection(double[] P0,
                                     double[] P1)
Computes all intersections of the given ray with the solid.

Specified by:
intersection in interface SceneNode
Overrides:
intersection in class DefaultSceneNode
Parameters:
P0 - Ray origin (double[3] or double[4]).
P1 - Direction vector of the ray (double[3] or double[4]).
Returns:
List of all intersections with the solid.

setTime

public void setTime(double time)
Sets the actual time value for the scene (used in animations).

Specified by:
setTime in interface TimeDependent
Overrides:
setTime in class CSGCommonNode
Parameters:
time - New scene time (in seconds).
See Also:
CSGCommonNode.getTime(), CSGCommonNode.getTimeInterval(double[])