|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.ObjectCylinder
public class Cylinder
Represents a vertical cylinder.
| Constructor Summary | |
|---|---|
Cylinder(double x,
double y,
double r,
Texture txt)
|
|
| Method Summary | |
|---|---|
void |
draw(java.awt.Graphics g,
double dx,
double dy,
double sx,
double sy)
Draws an overhead view of this surface. |
Bounds |
getBounds()
Returns a bounding box describing the range of x- and y-coordinates occupied by the surface. |
double |
getDistanceFrom(Ray ray)
Returns the ``distance'' at which the surface is located along the given ray, or Double.POSITIVE_INFINITY if in fact the
ray doesn't intersect the surface at all. |
Ray |
getNormal(double px,
double py)
Returns the ray normal to the surface at the given coordinates. |
TextureColumn |
getTextureColumn(double x,
double y)
Returns the column of texture that appears on this surface at the given point. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Cylinder(double x,
double y,
double r,
Texture txt)
| Method Detail |
|---|
public java.lang.String toString()
toString in class java.lang.Objectpublic double getDistanceFrom(Ray ray)
SurfaceDouble.POSITIVE_INFINITY if in fact the
ray doesn't intersect the surface at all.
The ray will start from some point
(x,y) and have some direction
(dx,dy).
If the returned value d is finite, it should be
a positive value for which
(x + d * dx,
y + d * dy)
lies on this surface.
getDistanceFrom in interface Surfaceray - the ray to look along in determining the
distance.
Double.POSITIVE_INFINITY
if it does not.
public Ray getNormal(double px,
double py)
Surface
getNormal in interface Surfacepx - the x-coordinate of the point in question.py - the y-coordinate of the point in question.
public TextureColumn getTextureColumn(double x,
double y)
Surface
getTextureColumn in interface Surfacex - the x-coordinate of the point on the surface.y - the y-coordinate of the point on the surface.
public Bounds getBounds()
Surface
getBounds in interface Surface
public void draw(java.awt.Graphics g,
double dx,
double dy,
double sx,
double sy)
Surfacesx and sy scaling factors
and the dx and dy offsets. For
example, an x-coordinate of x will map to
the pixel at dx + sx * x.
draw in interface Surfaceg - the Graphics object with which to draw.dx - the x-coordinate offset for drawing space.dy - the y-coordinate offset for drawing space.sx - the x-coordinate scaling factor for mapping from
world space to drawing space.sy - the y-coordinate scaling factor from mapping from
world space to drawing space.
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||