|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
public interface Surface
Represents a single vertical surface in the world. Every surface in the world is essentially a right prism - that is, the product of extending a two-dimensional shape up and down the vertical dimension.
| 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 x,
double y)
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. |
| Method Detail |
|---|
Ray getNormal(double x,
double y)
x - the x-coordinate of the point in question.y - the y-coordinate of the point in question.
double getDistanceFrom(Ray ray)
Double.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.
ray - the ray to look along in determining the
distance.
Double.POSITIVE_INFINITY
if it does not.
TextureColumn getTextureColumn(double x,
double y)
x - the x-coordinate of the point on the surface.y - the y-coordinate of the point on the surface.
Bounds getBounds()
void draw(java.awt.Graphics g,
double dx,
double dy,
double sx,
double sy)
sx 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.
g - 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 | |||||||