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

java.lang.Object
  extended by cz.cuni.amis.pogamut.ut2004.utils.UnrealUtils

public class UnrealUtils
extends java.lang.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).


Field Summary
static double BOT_CENTER_OF_GRAVITY_HEIGHT
          Center of gravity - distance from the floor in UU.
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
          Speed of the bot while running.
static Velocity CHARACTER_WALK_SPEED
          Speed of the bot while walking.
static float DEG_TO_UT_ANGLE
           
static double FULL_DOUBLEJUMP_DELAY
          Delay to be made between two jumps in double jumping (Jump.setDelay(Double)) if 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 MAX_VELOCITY
          Standard max.
static double NAV_POINT_HEIGHT
          NavPoint distance from the floor.
static int UT_ANGLE_TO_DEG
           
static double UT_ANGLE_TO_RAD
           
 
Constructor Summary
UnrealUtils()
           
 
Method Summary
static int degreeToUnrealDegrees(int degrees)
          Converts angle in degrees (0-360) to Unreal units used for angles (0-65635).
static double unrealDegreeToDegree(int unrealDegrees)
          Converts Unreal degrees (0-65635) to normal degrees (0-360).
static double unrealDegreeToRad(double unrealDegrees)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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
Speed of the bot while running. TODO: fill after the reception of INIT message.


CHARACTER_WALK_SPEED

public static Velocity CHARACTER_WALK_SPEED
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

UT_ANGLE_TO_RAD

public static final double UT_ANGLE_TO_RAD
See Also:
Constant Field Values

DEG_TO_UT_ANGLE

public static final float DEG_TO_UT_ANGLE
See Also:
Constant Field Values

UT_ANGLE_TO_DEG

public static final int UT_ANGLE_TO_DEG
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.

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 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.

See Also:
Constant Field Values

MAX_VELOCITY

public static final double MAX_VELOCITY
Standard max. velocity of bots (it's actually more 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(int degrees)
Converts angle in degrees (0-360) to Unreal units used for angles (0-65635).

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

unrealDegreeToDegree

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

Parameters:
unrealDegrees -
Returns:

unrealDegreeToRad

public static double unrealDegreeToRad(double unrealDegrees)