objects
Class Intersection

java.lang.Object
  extended by objects.Object
      extended by objects.Intersection
All Implemented Interfaces:
IObject
Direct Known Subclasses:
Box, Cone, Lens, Tube

public class Intersection
extends Object


Field Summary
 
Fields inherited from class objects.Object
trans
 
Constructor Summary
Intersection()
          constructor
 
Method Summary
 void addObject(IObject o)
          adds an object to the list
 void assignMap(Map bumpmap_)
           
 void assignMaterial(IMaterial material)
          assign a global material, so that all sub-objects have the same material should be used when all objects have been placed in the intersection
 IntersectionInfo calcIntersection(Ray ray)
          calculates the intersection with an ray
 void calculateTextureCoordinates(IntersectionInfo ri)
          calculates the coordinates at ri.nextPosition
 IObject getCopy()
           
 boolean isInside(Point3D p)
           
 Vector3D normal(Point3D p)
          calculate normal via gradient
 double q(Point3D p)
          calculate the value of the quadric at point p
 void transform(TransformationMatrix4x4 m)
          transforms the object with the matrix m
 
Methods inherited from class objects.Object
getArea, getMap, getMaterial, getTransformationMatrix, move, rotate, rotateAroundX, rotateAroundY, rotateAroundZ, scale, scale, setTransformationMatrix, UniformRandomPoint
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Intersection

public Intersection()
constructor

Method Detail

addObject

public void addObject(IObject o)
adds an object to the list

Parameters:
o - the object too add

calcIntersection

public IntersectionInfo calcIntersection(Ray ray)
Description copied from interface: IObject
calculates the intersection with an ray

Returns:
the intersection info

isInside

public boolean isInside(Point3D p)
Returns:
is the point inside the object

normal

public Vector3D normal(Point3D p)
Description copied from interface: IObject
calculate normal via gradient

Parameters:
p - the point
Returns:
normal at p

transform

public void transform(TransformationMatrix4x4 m)
Description copied from interface: IObject
transforms the object with the matrix m

Parameters:
m - the transformation matrix

assignMaterial

public void assignMaterial(IMaterial material)
assign a global material, so that all sub-objects have the same material should be used when all objects have been placed in the intersection

Specified by:
assignMaterial in interface IObject
Overrides:
assignMaterial in class Object
Parameters:
material -

q

public double q(Point3D p)
Description copied from interface: IObject
calculate the value of the quadric at point p

Parameters:
p - point
Returns:
the value at point p, q(p)<=0 -> inside

calculateTextureCoordinates

public void calculateTextureCoordinates(IntersectionInfo ri)
Description copied from interface: IObject
calculates the coordinates at ri.nextPosition

Parameters:
ri - intersection information

getCopy

public IObject getCopy()
Returns:
the area of the object

assignMap

public void assignMap(Map bumpmap_)
Specified by:
assignMap in interface IObject
Overrides:
assignMap in class Object
Parameters:
bumpmap_ - the bump or normal map