|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.starhope.appius.physica.Geometry
public class Geometry
Collection of useful geometric routines
| Constructor Summary | |
|---|---|
Geometry()
|
|
| Method Summary | |
|---|---|
static void |
deltaV(AbstractUser toMove,
double ddX,
double ddY,
double rate)
|
static Point2D |
getExitPoint(AbstractUser u,
Room room,
double destX,
double destY)
WRITEME: Document this method brpocock@star-hope.org |
static Point2D |
getExitPoint(Line2D line,
GeneralPath space)
Find the first (of what could, potentially, be several) point at which a given line segment crosses any boundary of the supplied space(s). |
static Point2D.Double |
getIntersectionPoint(Line2D line1,
Line2D line2)
intersection point of two line segments |
static Coord2D |
getRandomPointWithin(Polygon space)
|
static long |
getTimeToTarget(AbstractUser thing,
long when)
WRITEME: Document this method brpocock@star-hope.org |
static List<Point2D> |
getVertices(Polygon inner)
|
static Set<Polygon> |
simplify(Set<Polygon> positive,
Set<Polygon> negative)
|
static GeneralPath |
squash(Collection<GeneralPath> positive,
Collection<GeneralPath> negative)
|
static GeneralPath |
squash(Set<GeneralPath> positive,
Set<GeneralPath> negative)
|
static String |
stringify(double d1,
double d2)
Stringifies a pair of doubles representing a coordinate point |
static String |
stringify(GeneralPath path)
Stringifies a general path in the format of (x,y~x,y~~x,y~x,y) Where x,y are coordinate pairs and ~~ denotes discontinuous spaces |
static String |
stringify(Point2D p)
Stringifies a 2D coordinate point |
static GeneralPath |
stringToGeneralPath(String polyString)
convert a string into a GeneralPath |
static Collection<GeneralPath> |
stringToGeneralPathSet(String polyString)
Takes a string and turns it into a collection of GeneralPaths |
static Polygon |
stringToNewPolygon(String string)
|
static Polygon |
stringToPolygon(String polyString)
Deprecated. |
private static Area |
toArea(Set<Polygon> positive)
|
private static GeneralPath |
toGeneralPath(Area area)
|
static Set<Polygon> |
toPolygon(Area area)
|
static long |
updateUserPositioning(AbstractUser thing)
WRITEME: Document this method brpocock@star-hope.org |
static long |
updateUserPositioning(AbstractUser thing,
long when)
WRITEME: Document this method brpocock@star-hope.org |
static long |
updateUserPositioning(AbstractUser thing,
long when,
boolean sideEffects)
Determine the object's current position, and the time until it reaches its target (from now). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Geometry()
| Method Detail |
|---|
public static void deltaV(AbstractUser toMove,
double ddX,
double ddY,
double rate)
toMove - WRITEMEddX - WRITEMEddY - WRITEMErate - WRITEME
public static Point2D getExitPoint(AbstractUser u,
Room room,
double destX,
double destY)
throws GameLogicException
u - the user, currently in a walkable spaceroom - the room in which the user is standingdestX - WRITEMEdestY - WRITEME
GameLogicException - if the user isn't in the room
public static Point2D getExitPoint(Line2D line,
GeneralPath space)
throws NotFoundException
line - the line to be testedspace - the space against which to test it
NotFoundException - if the line does not cross the
boundaries of the space
public static Point2D.Double getIntersectionPoint(Line2D line1,
Line2D line2)
line1 - one lineline2 - another line
public static Coord2D getRandomPointWithin(Polygon space)
space - some space
public static long getTimeToTarget(AbstractUser thing,
long when)
thing - WRITEMEwhen - WRITEME
public static List<Point2D> getVertices(Polygon inner)
inner - WRITEME
public static Set<Polygon> simplify(Set<Polygon> positive,
Set<Polygon> negative)
positive - inclusive polysnegative - exclusive polys
public static GeneralPath squash(Collection<GeneralPath> positive,
Collection<GeneralPath> negative)
positive - positive spaces to collapsenegative - negative spaces to collapse
public static GeneralPath squash(Set<GeneralPath> positive,
Set<GeneralPath> negative)
positive - positive spaces to collapsenegative - negative spaces to collapse
public static String stringify(double d1,
double d2)
d1 - x ordinated2 - y abessa
public static String stringify(GeneralPath path)
path - The path to stringify
public static String stringify(Point2D p)
p - a 2D point
public static GeneralPath stringToGeneralPath(String polyString)
polyString - the polygon string
NumberFormatException - if the string has invalid numberspublic static Collection<GeneralPath> stringToGeneralPathSet(String polyString)
polyString - The string to convert
public static Polygon stringToNewPolygon(String string)
string - a polygon specifier string
@Deprecated public static Polygon stringToPolygon(String polyString)
polyString - WRITEME
NumberFormatException - WRITEMEprivate static Area toArea(Set<Polygon> positive)
positive - a set of polygons to be included
private static GeneralPath toGeneralPath(Area area)
area - area
public static Set<Polygon> toPolygon(Area area)
area - a polygon area
public static long updateUserPositioning(AbstractUser thing)
thing - WRITEME
public static long updateUserPositioning(AbstractUser thing,
long when)
thing - WRITEMEwhen - WRITEME
public static long updateUserPositioning(AbstractUser thing,
long when,
boolean sideEffects)
thing - what is movingwhen - what time is it nowsideEffects - if false, don't execute any side-effect
corrections: just return the time to travel
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||