apps.lightrays.raytracer.scene.geometry
Class Sphere

java.lang.Object
  extended by apps.lightrays.raytracer.scene.SceneObject
      extended by apps.lightrays.raytracer.scene.geometry.Sphere
Direct Known Subclasses:
Light

public class Sphere
extends SceneObject

The Class Sphere.


Constructor Summary
Sphere()
          Instantiates a new sphere.
Sphere(Point center, double radius, OpticalProperties optics)
          Instantiates a new sphere.
 
Method Summary
 Shader createShader(Ray r)
          Creates the shader.
 Point getCenter()
          Gets the center.
 Vector getNormal(Point intersect)
          Gets the normal.
 RayHitInfo intersect(Ray r)
          Intersect.
 void set(Point center, double radius, OpticalProperties optics)
          Sets the.
 void setCenter(Point center)
          Sets the center.
 void setRadius(double radius)
          Sets the radius.
 java.lang.String toString()
           
 
Methods inherited from class apps.lightrays.raytracer.scene.SceneObject
getOpticProperties, setOpticProperties, setScene
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Sphere

public Sphere()
Instantiates a new sphere.


Sphere

public Sphere(Point center,
              double radius,
              OpticalProperties optics)
Instantiates a new sphere.

Parameters:
center - the center
radius - the radius
optics - the optics
Method Detail

createShader

public Shader createShader(Ray r)
Description copied from class: SceneObject
Creates the shader.

Specified by:
createShader in class SceneObject
Parameters:
r - the r
Returns:
the shader

getCenter

public Point getCenter()
Gets the center.

Returns:
the center

getNormal

public Vector getNormal(Point intersect)
Description copied from class: SceneObject
Gets the normal.

Specified by:
getNormal in class SceneObject
Parameters:
intersect - the intersect
Returns:
the normal

intersect

public RayHitInfo intersect(Ray r)
Description copied from class: SceneObject
Intersect.

Specified by:
intersect in class SceneObject
Parameters:
r - the r
Returns:
the ray hit info

set

public void set(Point center,
                double radius,
                OpticalProperties optics)
Sets the.

Parameters:
center - the center
radius - the radius
optics - the optics

setCenter

public void setCenter(Point center)
Sets the center.

Parameters:
center - the new center

setRadius

public void setRadius(double radius)
Sets the radius.

Parameters:
radius - the new radius

toString

public java.lang.String toString()
Specified by:
toString in class SceneObject