cz.cuni.amis.pogamut.ut2004.agent.navigation.navmesh.pathfollowing
Class JumpModule

Package class diagram package JumpModule
java.lang.Object
  extended by cz.cuni.amis.pogamut.ut2004.agent.navigation.navmesh.pathfollowing.JumpModule

public class JumpModule
extends Object

Module for computation of jumps. Decides if the jump is doable, determines correct type and power of the jump.

Author:
Bogo

Field Summary
static double MAX_DOUBLE_JUMP_POWER
           
static double MAX_JUMP_HEIGHT
           
static double MAX_SINGLE_JUMP_POWER
           
 
Constructor Summary
JumpModule(NavMesh mesh, Logger log)
           
 
Method Summary
 Double computeJump(double targetZ, double timeToPassDistance, double jumpAngleCos)
          Compute jump power.
 Double computeJump(Location start, JumpBoundaries boundaries, double velocity, double jumpAngleCos)
          Compute power for given jump.
 JumpBoundaries computeJumpBoundaries(NavPointNeighbourLink jumpLink)
          Computes jump boundaries for given link, with using maximal available information about environment.
 BorderPoint getBorderPoint(Location start, Location end)
          Gets border point of the mesh for the path between specified points.
 Location getCollisionLocation(JumpBoundaries boundaries)
           
 double getCorrectedAngle(double angleCos, boolean isFirstStep)
           
 double getCorrectedVelocity(double velocity, boolean isAccelerating)
           
 Location getNearestMeshDirection(Location location, Location direction)
           
 boolean isJumpable(Location start, Location end, double velocity)
          Whether the given jump is doable.
 boolean needsJump(NavPointNeighbourLink link)
          Decides whether jump is needed for following given link.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_DOUBLE_JUMP_POWER

public static final double MAX_DOUBLE_JUMP_POWER
See Also:
Constant Field Values

MAX_SINGLE_JUMP_POWER

public static final double MAX_SINGLE_JUMP_POWER
See Also:
Constant Field Values

MAX_JUMP_HEIGHT

public static final double MAX_JUMP_HEIGHT
See Also:
Constant Field Values
Constructor Detail

JumpModule

public JumpModule(NavMesh mesh,
                  Logger log)
Method Detail

computeJumpBoundaries

public JumpBoundaries computeJumpBoundaries(NavPointNeighbourLink jumpLink)
Computes jump boundaries for given link, with using maximal available information about environment. Stores the boundaries in the "Jump" object for later use.

Parameters:
jumpLink - Link on which the jump should occur.
Returns:
True if jump boundaries were successfully computed, false otherwise.

getBorderPoint

public BorderPoint getBorderPoint(Location start,
                                  Location end)
Gets border point of the mesh for the path between specified points.

Parameters:
start - Start of the path.
end - End of the path.
Returns:
Border point in the direction of the path.

needsJump

public boolean needsJump(NavPointNeighbourLink link)
Decides whether jump is needed for following given link.

Parameters:
link - Link to analyze.
Returns:
True if jump is needed for successful following of given link.

computeJump

public Double computeJump(Location start,
                          JumpBoundaries boundaries,
                          double velocity,
                          double jumpAngleCos)
Compute power for given jump.

Parameters:
start - Start location of the jump.
boundaries - Jump boundaries for given link.
velocity - Current velocity of the bot.
jumpAngleCos - Cos of angle of direction of the movement to the direction of the link.
Returns:
Power of the jump.

computeJump

public Double computeJump(double targetZ,
                          double timeToPassDistance,
                          double jumpAngleCos)
Compute jump power.

Parameters:
targetZ - Difference between start and end Z coordinate.
timeToPassDistance - Time it will take to pass the distance from start to end.
jumpAngleCos - Cos of angle of direction of the movement to the direction of the link.
Returns:

isJumpable

public boolean isJumpable(Location start,
                          Location end,
                          double velocity)
Whether the given jump is doable.

Parameters:
start - Start of the jump.
end - End of the jump.
velocity - Current velocity.
Returns:
Whether the given jump is doable.

getCollisionLocation

public Location getCollisionLocation(JumpBoundaries boundaries)

getNearestMeshDirection

public Location getNearestMeshDirection(Location location,
                                        Location direction)

getCorrectedVelocity

public double getCorrectedVelocity(double velocity,
                                   boolean isAccelerating)

getCorrectedAngle

public double getCorrectedAngle(double angleCos,
                                boolean isFirstStep)


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