|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectShape
Sphere
public class Sphere
A class representing a sphere. A sphere is specified by an origin and a radius.
Constructor Summary | |
---|---|
Sphere()
Constructs the unit sphere at the origin. |
|
Sphere(javax.vecmath.Vector3d origin,
double radius,
SurfaceProperties sp)
Constructs a sphere with the specified parameters. |
Method Summary | |
---|---|
java.lang.Object |
clone()
Returns a copy of the object. |
javax.vecmath.Point3d |
getOrigin()
Returns the sphere's origin. |
double |
getRadius()
Returns the sphere's radius. |
void |
load(DataParser dataParser)
Loads data using the DataParser object. |
double |
nearestIntersectionTime(Ray3d ray)
Gets the nearest intersection time between the specified ray and the shape. |
void |
setOrigin(javax.vecmath.Point3d origin)
Sets the sphere's origin. |
void |
setRadius(double radius)
Sets the sphere's radius. |
javax.vecmath.Vector3d |
surfaceNormal(javax.vecmath.Point3d point)
Gets the surface normal at the specified point on the shape. |
Methods inherited from class Shape |
---|
getSurfaceProperties, setSurfaceProperties |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Sphere()
public Sphere(javax.vecmath.Vector3d origin, double radius, SurfaceProperties sp)
origin
- The origin of the sphere.radius
- The radius of the sphere.sp
- The surface properties of the sphere.Method Detail |
---|
public java.lang.Object clone()
CloneableEx
clone
in interface CloneableEx
clone
in class Shape
public double nearestIntersectionTime(Ray3d ray)
Shape
nearestIntersectionTime
in class Shape
ray
- The ray to intersect with the shape.
public javax.vecmath.Vector3d surfaceNormal(javax.vecmath.Point3d point)
Shape
surfaceNormal
in class Shape
point
- The point on the surface of the shape.
public void load(DataParser dataParser)
Persistent
DataParser
object.
A class overrides this function to load data that has been parsed.
load
in interface Persistent
load
in class Shape
dataParser
- The DataParser
to load data from.public void setOrigin(javax.vecmath.Point3d origin)
origin
- The origin to set.public javax.vecmath.Point3d getOrigin()
public void setRadius(double radius)
radius
- The radius to set.public double getRadius()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |