cz.cuni.amis.pogamut.defcon.base3d.worldview.object
Class DefConLocation

Package class diagram package DefConLocation
java.lang.Object
  extended by cz.cuni.amis.pogamut.base3d.worldview.object.Location
      extended by cz.cuni.amis.pogamut.defcon.base3d.worldview.object.DefConLocation
All Implemented Interfaces:
ILocated, Serializable, Cloneable

public class DefConLocation
extends Location

Checks and corrects coordinates for the ingame locations and provides useful methods.

Author:
Radek 'Black_Hand' Pibil
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class cz.cuni.amis.pogamut.base3d.worldview.object.Location
Location.PropertyEditor
 
Field Summary
 
Fields inherited from class cz.cuni.amis.pogamut.base3d.worldview.object.Location
DISTANCE_ZERO, locationPattern, NONE, x, y, z, ZERO
 
Constructor Summary
DefConLocation()
           
DefConLocation(double[] d)
           
DefConLocation(double x, double y)
           
DefConLocation(float[] f)
           
DefConLocation(Location location)
           
 
Method Summary
 DefConLocation add(Location l)
          Retrieves sum of this location and given location.
protected static double correctX(double x, double y)
           
 double getDistance(Location location)
           
 double getDistance2D(Location location)
           
 double getDistanceSquare(Location l)
          Calculates the square of the distance between this and given location.
 DefConLocation getNormalized()
           
 DefConLocation invert()
          Calculates inverse Location
protected static double mathModulus(double a, double b)
           
 DefConLocation scale(double d)
           
 Location sub(DefConLocation l)
          Retrieves sum of this location and given location.
static Location sub(DefConLocation l1, DefConLocation l2)
           
 
Methods inherited from class cz.cuni.amis.pogamut.base3d.worldview.object.Location
add, add, add, addX, addY, addZ, asPoint3d, asPoint3D, asVector3d, clone, cross, dot, dot2D, equal, equal, equals, equals, getAverage, getDistance, getDistance2D, getDistanceL1, getDistanceL1, getDistanceLinf, getDistanceLinf, getDistancePlane, getDistancePlane, getDistanceSquare, getDistanceZ, getLength, getLocation, getPoint3d, getQuatLikeRotationSeq, getRotation, getX, getY, getZ, hashCode, interpolate, interpolate, mul, rotateXY, rotateXZ, rotateYZ, scaleX, scaleY, scaleZ, setX, setY, setZ, sub, sub, sub, sub, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefConLocation

public DefConLocation()

DefConLocation

public DefConLocation(double x,
                      double y)

DefConLocation

public DefConLocation(float[] f)

DefConLocation

public DefConLocation(double[] d)

DefConLocation

public DefConLocation(Location location)
Method Detail

getDistance2D

public double getDistance2D(Location location)
Overrides:
getDistance2D in class Location

getDistance

public double getDistance(Location location)
Overrides:
getDistance in class Location

sub

public static Location sub(DefConLocation l1,
                           DefConLocation l2)

correctX

protected static double correctX(double x,
                                 double y)

mathModulus

protected static final double mathModulus(double a,
                                          double b)

scale

public DefConLocation scale(double d)
Overrides:
scale in class Location

add

public DefConLocation add(Location l)
Retrieves sum of this location and given location.

Overrides:
add in class Location
Parameters:
l - Location to be added to this location.
Returns:
Sum of the two locations.

sub

public Location sub(DefConLocation l)
Retrieves sum of this location and given location.

Parameters:
l - Location to be added to this location.
Returns:
Sum of the two locations.

getNormalized

public DefConLocation getNormalized()
Overrides:
getNormalized in class Location

invert

public DefConLocation invert()
Calculates inverse Location

Overrides:
invert in class Location
Returns:
new inverted Location

getDistanceSquare

public double getDistanceSquare(Location l)
Calculates the square of the distance between this and given location.

Overrides:
getDistanceSquare in class Location
Parameters:
l - Location to be calculated the distance to.
Returns:
Square of the euclidean distance between the two locations.


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