|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectmaze.geometry.MazeGeometry
maze.geometry.HexGeometry
Contains facts about the current maze geometry. In this case it is a bounded hexagonal geometry. Methods are available which will transform a coordinate and a direction into a new coordinate. Directions can be absolute directions or a direction and an angle.
| Field Summary |
| Fields inherited from class maze.geometry.MazeGeometry |
Debug, hMax, hScale, MAX_DIRECTIONS, origin, P1, P2, vMax, vScale |
| Constructor Summary | |
HexGeometry(int h,
int v)
Creates a new HexGeometry of a given size. |
|
| Method Summary | |
Coordinate |
advance(Coordinate c,
int d)
Computes a new coordinate, given a coordinate and an absolute direction |
protected double |
cellRadius()
Computes the center-to-vertex distance for a cell with this geometry Hexagonal tiling goes from vertex to edge, r is a function of hScale such that the NW vertex to E edge distance = hScale, also the top to bottom edge distance is vScale. |
void |
setRect(java.awt.Rectangle r)
Computes the scaling for an alternating coordinate hex geometry, also compute the tiling for this hex geometry. |
int |
startDir()
Finds a good starting pair of directions, must be distinct |
java.awt.Point |
wallP1(int x,
int y,
int dir)
Provides a sensible coordinate system for a surface tiled with hexagons by offsetting cell vertexes as needed - P1 is one end of a cell wall |
java.awt.Point |
wallP2(int x,
int y,
int dir)
Provides a sensible coordinate system for a surface tiled with hexagons by offsetting cell vertexes as needed - P2 is the other end of a cell wall |
| Methods inherited from class maze.geometry.MazeGeometry |
advance, cellHoffset, cellPoly, cellVoffset, iterator, label, label, left, opp, right, setTiling, start, turn, wallPoly |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public HexGeometry(int h,
int v)
h - int horizontal size.v - int vertical size.| Method Detail |
public void setRect(java.awt.Rectangle r)
setRect in class MazeGeometryr - Rectangle with the overall size of the maze.MazeGeometry.setTiling()
public Coordinate advance(Coordinate c,
int d)
advance in class MazeGeometryc - Coordinate from which to begin.d - int direction in which to advance.
public int startDir()
startDir in class MazeGeometryprotected double cellRadius()
public java.awt.Point wallP1(int x,
int y,
int dir)
wallP1 in class MazeGeometryx - int horizontal coordinatey - int vertical coordinatedir - int direction
public java.awt.Point wallP2(int x,
int y,
int dir)
wallP2 in class MazeGeometryx - int horizontal coordinatey - int vertical coordinatedir - int direction
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||