cz.cuni.amis.pogamut.ut2004.utils
Class UnrealUtils

Package class diagram package UnrealUtils
java.lang.Object
  extended by cz.cuni.amis.pogamut.ut2004.utils.UnrealUtils

public class UnrealUtils
extends Object

Class with utility methods for converting to Unreal units plus some handy constants.

Measures are in Unreal Engine native units called Unreal units (UU).

Author:
ik

Field Summary
static double BOT_CENTER_OF_GRAVITY_HEIGHT
          Center of gravity - distance from the floor in UU.
static double DEG_TO_UT_ANGLE
          Deprecated. use ONE_DEGREE_IN_UNREAL_DEGREES
static double dOUBLE_NONE
           
static Double DOUBLE_NONE
           
static float fLOAT_NONE
           
static Float FLOAT_NONE
           
static double FULL_ANGLE_IN_UNREAL_DEGREES
           
static double FULL_DOUBLEJUMP_DELAY
          Delay to be made between two jumps in double jumping (Jump.setDelay(Double)) if full double jump is needed.
static int FULL_DOUBLEJUMP_FORCE
          Force to be applied to Jump.setForce(Double) if full double jump is needed.
static int FULL_JUMP_FORCE
          Force to be applied to Jump.setForce(Double) if full jump is needed.
static double CHARACTER_COLLISION_HEIGHT
          Height in UU of the bounding cylinder used for collision detection.
static double CHARACTER_COLLISION_RADIUS
          Radius in UU of the bounding cylinder used for collision detection.
static double CHARACTER_HEIGHT_CROUCHING
          Height in UU of the bot when crouching.
static double CHARACTER_HEIGHT_STANDING
          Height in UU of the bot when stading.
static Velocity CHARACTER_RUN_SPEED
          Deprecated. you should not use this as it is not reliable in multi-bot scenario
static Velocity CHARACTER_WALK_SPEED
          Deprecated. you should not use this as it is not reliable in multi-bot scenario
static int iNT_NONE
           
static Integer INT_NONE
           
static long lONG_NONE
           
static Long LONG_NONE
           
static double MAX_VELOCITY
          Standard max. velocity of bots (it's actually almost 440 but it is better to have this number lower as you will check whether you're running at max speed with it...).
static double NAV_POINT_HEIGHT
          NavPoint distance from the floor.
static double ONE_DEGREE_IN_UNREAL_DEGREES
           
static double ONE_RAD_IN_UNREAL_DEGREES
           
static double ONE_UNREAD_DEGREE_IN_RAD
           
static double ONE_UNREAL_DEGREE_IN_DEGREES
           
static javax.vecmath.Point3d POINT3D_NONE
           
static double RAD_TO_UT_ANGLE
          Deprecated. use ONE_RAD_IN_UNREAL_DEGREES
static String STRING_NONE
           
static double UT_ANGLE_TO_DEG
          Deprecated.  
static double UT_ANGLE_TO_RAD
          Deprecated. use ONE_UNREAD_DEGREE_IN_RAD
static double UT2004_TIME_SPEED
          UT2004 time is running 110% of normal time.
static javax.vecmath.Vector3d VECTOR3D_NONE
           
 
Constructor Summary
UnrealUtils()
           
 
Method Summary
static int degreeToUnrealDegrees(double degrees)
          Converts angle in degrees (0-360) to Unreal units used for angles (0 - 65536).
static boolean isBotId(UnrealId id)
          Tells whether UnrealId belongs to POGAMUT-CONTROLLED-BOT.
static double unrealDegreeToDegree(int unrealDegrees)
          Converts Unreal degrees (0-65536) to normal degrees (0 - 360).
static double unrealDegreeToRad(double unrealDegrees)
          Converts Unreal degrees (0-65536) to radians (0 - 2*PI)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

iNT_NONE

public static final int iNT_NONE
See Also:
Constant Field Values

lONG_NONE

public static final long lONG_NONE
See Also:
Constant Field Values

fLOAT_NONE

public static final float fLOAT_NONE
See Also:
Constant Field Values

dOUBLE_NONE

public static final double dOUBLE_NONE
See Also:
Constant Field Values

INT_NONE

public static final Integer INT_NONE

LONG_NONE

public static final Long LONG_NONE

FLOAT_NONE

public static final Float FLOAT_NONE

DOUBLE_NONE

public static final Double DOUBLE_NONE

STRING_NONE

public static final String STRING_NONE
See Also:
Constant Field Values

POINT3D_NONE

public static final javax.vecmath.Point3d POINT3D_NONE

VECTOR3D_NONE

public static final javax.vecmath.Vector3d VECTOR3D_NONE

CHARACTER_COLLISION_RADIUS

public static final double CHARACTER_COLLISION_RADIUS
Radius in UU of the bounding cylinder used for collision detection.

See Also:
Constant Field Values

CHARACTER_COLLISION_HEIGHT

public static final double CHARACTER_COLLISION_HEIGHT
Height in UU of the bounding cylinder used for collision detection.

See Also:
Constant Field Values

CHARACTER_HEIGHT_STANDING

public static final double CHARACTER_HEIGHT_STANDING
Height in UU of the bot when stading.

See Also:
Constant Field Values

CHARACTER_HEIGHT_CROUCHING

public static final double CHARACTER_HEIGHT_CROUCHING
Height in UU of the bot when crouching.

See Also:
Constant Field Values

CHARACTER_RUN_SPEED

public static Velocity CHARACTER_RUN_SPEED
Deprecated. you should not use this as it is not reliable in multi-bot scenario
Speed of the bot while running. TODO: fill after the reception of INIT message.


CHARACTER_WALK_SPEED

public static Velocity CHARACTER_WALK_SPEED
Deprecated. you should not use this as it is not reliable in multi-bot scenario
Speed of the bot while walking. TODO: fill after the reception of INIT message.


BOT_CENTER_OF_GRAVITY_HEIGHT

public static final double BOT_CENTER_OF_GRAVITY_HEIGHT
Center of gravity - distance from the floor in UU. TODO: estimate

See Also:
Constant Field Values

NAV_POINT_HEIGHT

public static final double NAV_POINT_HEIGHT
NavPoint distance from the floor. TODO: estimate

See Also:
Constant Field Values

FULL_ANGLE_IN_UNREAL_DEGREES

public static final double FULL_ANGLE_IN_UNREAL_DEGREES
See Also:
Constant Field Values

ONE_DEGREE_IN_UNREAL_DEGREES

public static final double ONE_DEGREE_IN_UNREAL_DEGREES
See Also:
Constant Field Values

ONE_RAD_IN_UNREAL_DEGREES

public static final double ONE_RAD_IN_UNREAL_DEGREES
See Also:
Constant Field Values

ONE_UNREAL_DEGREE_IN_DEGREES

public static final double ONE_UNREAL_DEGREE_IN_DEGREES
See Also:
Constant Field Values

ONE_UNREAD_DEGREE_IN_RAD

public static final double ONE_UNREAD_DEGREE_IN_RAD
See Also:
Constant Field Values

UT_ANGLE_TO_RAD

public static final double UT_ANGLE_TO_RAD
Deprecated. use ONE_UNREAD_DEGREE_IN_RAD
See Also:
Constant Field Values

DEG_TO_UT_ANGLE

public static final double DEG_TO_UT_ANGLE
Deprecated. use ONE_DEGREE_IN_UNREAL_DEGREES
See Also:
Constant Field Values

UT_ANGLE_TO_DEG

public static final double UT_ANGLE_TO_DEG
Deprecated. 
See Also:
Constant Field Values

RAD_TO_UT_ANGLE

public static final double RAD_TO_UT_ANGLE
Deprecated. use ONE_RAD_IN_UNREAL_DEGREES
See Also:
Constant Field Values

UT2004_TIME_SPEED

public static final double UT2004_TIME_SPEED
UT2004 time is running 110% of normal time. I.e., when 1 sec pass according to System.currentTimeMillis() than 1.1 secs pass according to UT2004.

See Also:
Constant Field Values

FULL_JUMP_FORCE

public static final int FULL_JUMP_FORCE
Force to be applied to Jump.setForce(Double) if full jump is needed.

Note that you actually do not need to set this value directly as GB2004 always assumes you want to do full jump.

See Also:
Constant Field Values

FULL_DOUBLEJUMP_FORCE

public static final int FULL_DOUBLEJUMP_FORCE
Force to be applied to Jump.setForce(Double) if full double jump is needed.

Note that you actually do not need to set this value directly as GB2004 always assumes you want to do full double jump. We raised this value by 50 (was 705) in GameBots of Pogamut 3.3.1 because of problems of accessing spots on the verge of reachability with double jump.

See Also:
Constant Field Values

FULL_DOUBLEJUMP_DELAY

public static final double FULL_DOUBLEJUMP_DELAY
Delay to be made between two jumps in double jumping (Jump.setDelay(Double)) if full double jump is needed.

Note that you actually do not need to set this value directly as GB2004 always assumes you want to do full double jump.

In seconds.

See Also:
Constant Field Values

MAX_VELOCITY

public static final double MAX_VELOCITY
Standard max. velocity of bots (it's actually almost 440 but it is better to have this number lower as you will check whether you're running at max speed with it...).

See Also:
Constant Field Values
Constructor Detail

UnrealUtils

public UnrealUtils()
Method Detail

degreeToUnrealDegrees

public static int degreeToUnrealDegrees(double degrees)
Converts angle in degrees (0-360) to Unreal units used for angles (0 - 65536).

Parameters:
degrees - Angle in degrees
Returns:
corresponding angle in Unreal units

unrealDegreeToDegree

public static double unrealDegreeToDegree(int unrealDegrees)
Converts Unreal degrees (0-65536) to normal degrees (0 - 360).

Parameters:
unrealDegrees -
Returns:

unrealDegreeToRad

public static double unrealDegreeToRad(double unrealDegrees)
Converts Unreal degrees (0-65536) to radians (0 - 2*PI)

Parameters:
unrealDegrees -
Returns:

isBotId

public static boolean isBotId(UnrealId id)
Tells whether UnrealId belongs to POGAMUT-CONTROLLED-BOT.

Parameters:
botId -
Returns:


Copyright © 2015 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.