|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--GENERIC
Abstract class for generally used functions its static methods can be accessed project wide
Field Summary | |
(package private) static boolean |
DEBUG
class internal debug switch |
Constructor Summary | |
GENERIC()
|
Method Summary | |
(package private) static java.awt.geom.Point2D.Double |
add2DPoints(java.awt.geom.Point2D.Double t1,
java.awt.geom.Point2D.Double t2)
vector addition |
(package private) static void |
debug(java.lang.String id,
java.lang.String msg)
|
static double |
getAngleBetweenVectors(java.awt.geom.Point2D.Double a,
java.awt.geom.Point2D.Double b)
get the angle between to vectors (vector a and vector b) |
static double |
getAngleToTurnFromDirections(char mySide,
double playerBodyDir,
double destinationDir)
calculates the turn angle from the player's body dir to the dir of the destination object the result can be passed to the player.actor.turn() method or can be used to calculate angles to object's in relation to the player's body direction |
static double |
getDirectionToPointFromPlayer(java.awt.geom.Point2D.Double playerPosition,
double playerBodyDirection,
java.awt.geom.Point2D.Double destPosition)
get the direction to an object (2DPoint) in relation to the body dir of the player |
static double |
getInterceptDirFromDynObjects(DynObject myDynObject,
DynObject targetDynObject,
double mySpeed)
Method getInterceptDirFromDynObjects. |
static java.awt.geom.Point2D.Double |
getInterceptPointFromDynObjects(DynObject myDynObject,
DynObject targetDynObject,
double mySpeed)
Method getInterceptPointFromDynObjects. |
static double |
getNormedDoubleValue(double valueToNorm,
double maxNormValue)
norm a value to interval [0;1] |
(package private) static java.awt.geom.Point2D.Double |
getNormedVector(java.awt.geom.Point2D.Double t)
get normed vector |
static double |
getVectorLength(java.awt.geom.Point2D.Double a)
get the length of a given vector |
(package private) static java.awt.geom.Point2D.Double |
scalarVectorMul(java.awt.geom.Point2D.Double t,
double scal)
scaler vector multiplication |
(package private) static java.awt.geom.Point2D.Double |
sub2DPoints(java.awt.geom.Point2D.Double t1,
java.awt.geom.Point2D.Double t2)
vector subtraction |
Methods inherited from class java.lang.Object |
|
Field Detail |
static boolean DEBUG
Constructor Detail |
public GENERIC()
Method Detail |
public static double getNormedDoubleValue(double valueToNorm, double maxNormValue)
valueToNorm
- the value that has to be normedmaxNormValue
- greatest value (= 1 after normation)public static double getVectorLength(java.awt.geom.Point2D.Double a)
a
- a vector as 2DPoint which length has to be calculatedpublic static double getAngleBetweenVectors(java.awt.geom.Point2D.Double a, java.awt.geom.Point2D.Double b)
a
- vector ab
- vector bpublic static double getDirectionToPointFromPlayer(java.awt.geom.Point2D.Double playerPosition, double playerBodyDirection, java.awt.geom.Point2D.Double destPosition)
playerPosition
- current position of the player as 2DPointplayerBodyDirection
- the current direction of a playerdestPosition
- coordinates of destination object as 2DPointpublic static double getAngleToTurnFromDirections(char mySide, double playerBodyDir, double destinationDir)
mySide
- char value for own side identifiert ("l" / "r")playerBodyDir
- the current direction of a playerdestinationDir
- may be calculated with GENERIC.getDirectionToPointFromPlayer()public static java.awt.geom.Point2D.Double getInterceptPointFromDynObjects(DynObject myDynObject, DynObject targetDynObject, double mySpeed)
myDynObject
- my postargetDynObject
- target pos (ball)mySpeed
- my current speedpublic static double getInterceptDirFromDynObjects(DynObject myDynObject, DynObject targetDynObject, double mySpeed)
myDynObject
- my postargetDynObject
- target posmySpeed
- my current speedstatic java.awt.geom.Point2D.Double add2DPoints(java.awt.geom.Point2D.Double t1, java.awt.geom.Point2D.Double t2)
t1
- vector 1t2
- vector 2static java.awt.geom.Point2D.Double sub2DPoints(java.awt.geom.Point2D.Double t1, java.awt.geom.Point2D.Double t2)
t1
- vector 1t2
- vector 1static java.awt.geom.Point2D.Double getNormedVector(java.awt.geom.Point2D.Double t)
t
- tstatic java.awt.geom.Point2D.Double scalarVectorMul(java.awt.geom.Point2D.Double t, double scal)
t
- tscal
- scalstatic void debug(java.lang.String id, java.lang.String msg)
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |