SteeringStuff
Class SteeringTools

Package class diagram package SteeringTools
java.lang.Object
  extended by SteeringStuff.SteeringTools

public class SteeringTools
extends Object

This class provides usefull tool for steerings, especially common mathematical calculations.

Author:
Marki

Nested Class Summary
static class SteeringTools.LineType
           
 
Constructor Summary
SteeringTools()
           
 
Method Summary
static cz.cuni.amis.pogamut.base3d.worldview.object.Location[] commonPoints(cz.cuni.amis.pogamut.base3d.worldview.object.Location P0, double r0, cz.cuni.amis.pogamut.base3d.worldview.object.Location P1, double r1)
           
static double degreesToRadians(double deg)
           
static double getAngle(cz.cuni.amis.pogamut.base3d.worldview.object.Location botLocation, cz.cuni.amis.pogamut.base3d.worldview.object.Rotation botRotation, cz.cuni.amis.pogamut.base3d.worldview.object.Location point)
           
static double getAngleOld(cz.cuni.amis.pogamut.base3d.worldview.object.Location botLocation, cz.cuni.amis.pogamut.base3d.worldview.object.Location focus, cz.cuni.amis.pogamut.base3d.worldview.object.Location point)
          Deprecated. 
static javax.vecmath.Vector2d getIntersection(javax.vecmath.Vector2d sA, javax.vecmath.Vector2d dA, javax.vecmath.Vector2d sB, javax.vecmath.Vector2d dB, SteeringTools.LineType typeA, SteeringTools.LineType typeB)
          Computes the intersection of the lines A and B (line has the start point and its direction).
static javax.vecmath.Vector2d getIntersectionOld(javax.vecmath.Vector2d sA, javax.vecmath.Vector2d dA, javax.vecmath.Vector2d sB, javax.vecmath.Vector2d dB)
          Gets the intersection of the half-lines A and B (line has the start point and its direction.
static javax.vecmath.Vector2d getNearestPoint(javax.vecmath.Vector2d start, javax.vecmath.Vector2d end, javax.vecmath.Vector2d pointP, boolean justAbscissa)
           
static javax.vecmath.Vector3d getTurningVector(javax.vecmath.Vector3d actualVelocity, boolean left)
          Returns the rotation vector, that after combining with the actualVelocity the vector on the left or right side will be created.
static javax.vecmath.Vector3d getTurningVector2(javax.vecmath.Vector3d actualVelocity, boolean left)
          Returns the rotation vector perpendicular to the actualVelocity.
static boolean haveSameDirection(javax.vecmath.Vector2d sA, javax.vecmath.Vector2d dA, javax.vecmath.Vector2d sB, javax.vecmath.Vector2d dB)
          Gets the intersection of the half-lines A and B (line has the start point and its direction.
static boolean pointIsLeftFromTheVector(javax.vecmath.Vector3d vector, javax.vecmath.Vector3d point)
           
static double radiansToDegrees(double rad)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SteeringTools

public SteeringTools()
Method Detail

getIntersection

public static javax.vecmath.Vector2d getIntersection(javax.vecmath.Vector2d sA,
                                                     javax.vecmath.Vector2d dA,
                                                     javax.vecmath.Vector2d sB,
                                                     javax.vecmath.Vector2d dB,
                                                     SteeringTools.LineType typeA,
                                                     SteeringTools.LineType typeB)
Computes the intersection of the lines A and B (line has the start point and its direction). If this intersection doesn't exist, we return null. The types set if they are straight lines, half lines or abscissas. If the intersection doesn't lie in the right section (i.e. in the abscissa), we return null. Otherwise we return the point of intersection.


getIntersectionOld

public static javax.vecmath.Vector2d getIntersectionOld(javax.vecmath.Vector2d sA,
                                                        javax.vecmath.Vector2d dA,
                                                        javax.vecmath.Vector2d sB,
                                                        javax.vecmath.Vector2d dB)
Gets the intersection of the half-lines A and B (line has the start point and its direction. If there isn't the intersection of the half-lines, or the direction is the same, we return null.


haveSameDirection

public static boolean haveSameDirection(javax.vecmath.Vector2d sA,
                                        javax.vecmath.Vector2d dA,
                                        javax.vecmath.Vector2d sB,
                                        javax.vecmath.Vector2d dB)
Gets the intersection of the half-lines A and B (line has the start point and its direction. If there isn't the intersection of the half-lines, or the direction is the same, we return null.


getNearestPoint

public static javax.vecmath.Vector2d getNearestPoint(javax.vecmath.Vector2d start,
                                                     javax.vecmath.Vector2d end,
                                                     javax.vecmath.Vector2d pointP,
                                                     boolean justAbscissa)

pointIsLeftFromTheVector

public static boolean pointIsLeftFromTheVector(javax.vecmath.Vector3d vector,
                                               javax.vecmath.Vector3d point)

getTurningVector

public static javax.vecmath.Vector3d getTurningVector(javax.vecmath.Vector3d actualVelocity,
                                                      boolean left)
Returns the rotation vector, that after combining with the actualVelocity the vector on the left or right side will be created.


getTurningVector2

public static javax.vecmath.Vector3d getTurningVector2(javax.vecmath.Vector3d actualVelocity,
                                                       boolean left)
Returns the rotation vector perpendicular to the actualVelocity.


radiansToDegrees

public static double radiansToDegrees(double rad)

degreesToRadians

public static double degreesToRadians(double deg)

commonPoints

public static cz.cuni.amis.pogamut.base3d.worldview.object.Location[] commonPoints(cz.cuni.amis.pogamut.base3d.worldview.object.Location P0,
                                                                                   double r0,
                                                                                   cz.cuni.amis.pogamut.base3d.worldview.object.Location P1,
                                                                                   double r1)
Parameters:
P0 - center of first circle
r0 - radius of first circle
P1 -
r1 -
Returns:
all points of intersection between circles

getAngleOld

@Deprecated
public static double getAngleOld(cz.cuni.amis.pogamut.base3d.worldview.object.Location botLocation,
                                            cz.cuni.amis.pogamut.base3d.worldview.object.Location focus,
                                            cz.cuni.amis.pogamut.base3d.worldview.object.Location point)
Deprecated. 


getAngle

public static double getAngle(cz.cuni.amis.pogamut.base3d.worldview.object.Location botLocation,
                              cz.cuni.amis.pogamut.base3d.worldview.object.Rotation botRotation,
                              cz.cuni.amis.pogamut.base3d.worldview.object.Location point)


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