|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--Object | +--Plane
Plane represents an infinite plane object
Field Summary | |
double |
Constant
Holds the constant of the plane equation |
Vector |
Normal
Holds the normal that defines this plane |
Fields inherited from class Object |
SurfaceMaterial |
Constructor Summary | |
Plane()
Create a default plane |
|
Plane(Material n,
Vector v,
double c)
Create a plane with the given material and plane equation Note values are referenced not copied in the new object |
Method Summary | |
double |
intersect(Ray ray)
Find the intersection of the plane and a given ray. |
Vector |
normal(Point p)
Find the normal of an object at the given point on its surface. |
void |
print(SceneWriter os)
Print a human readable version of the plane definition to the given destination |
void |
read(SceneReader is)
Read the plane from the given source |
void |
write(SceneWriter os)
Write the plane to the given destination |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public Vector Normal
public double Constant
Constructor Detail |
public Plane()
public Plane(Material n, Vector v, double c)
n
- the material for the planev
- the vector that plane is normal toc
- the constant of the plane equationMethod Detail |
public Vector normal(Point p)
normal
in class Object
p
- the surface point to find the normal at
public double intersect(Ray ray)
intersect
in class Object
ray
- the ray to intersect with
double
value that gives the distance
along the ray.public void read(SceneReader is) throws java.io.IOException, java.lang.NumberFormatException
read
in class Object
is
- the source to read from
java.io.IOException
- if the light can not be read
java.io.NumberFormatException
- if there a number format error is encountered
java.lang.NumberFormatException
public void write(SceneWriter os) throws java.io.IOException
write
in class Object
os
- the destination to write to
java.io.IOException
- if the write fails.public void print(SceneWriter os) throws java.io.IOException
print
in class Object
os
- the destination to write to
java.io.IOException
- if the write fails.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |