Class com.oroinc.yaray.Sphere
All Packages Class Hierarchy This Package Previous Next Index
Class com.oroinc.yaray.Sphere
java.lang.Object
|
+----com.oroinc.yaray.WorldObject
|
+----com.oroinc.yaray.Sphere
- public class Sphere
- extends WorldObject
A sphere.
Copyright © 1996, 1997 Original Reusable Objects, Inc.
All rights reserved.
- Author:
- Daniel F. Savarese
-
Sphere(Point, float, Pigment, Finish)
-
-
getColor(World, Ray, Color)
- Given a world description and the ray that intersects the sphere, returns
the color of the sphere at the point of intersection.
-
intersect(IntersectionRay)
- Determines if ray intersects sphere.
Sphere
public Sphere(Point center,
float radius,
Pigment pigment,
Finish finish)
intersect
public boolean intersect(IntersectionRay ray)
- Determines if ray intersects sphere. If it does, checks that
point of intersection is closer to origin of ray than any previous
point of intersection. If it is closer, returns true, if not,
returns false.
- Parameters:
- ray - Ray to be tested for intersection.
- Returns:
- true If ray intersects disc and is closer to origin than any
previous point of intersection, false otherwise.
- Overrides:
- intersect in class WorldObject
getColor
public void getColor(World world,
Ray intersection,
Color colorResult)
- Given a world description and the ray that intersects the sphere, returns
the color of the sphere at the point of intersection.
- Parameters:
- world - The world containing the sphere.
- intersection - The current ray being traced.
- colorResult - The color at the point of intersection if any.
- Overrides:
- getColor in class WorldObject
All Packages Class Hierarchy This Package Previous Next Index