Class CollisionLine2D

java.lang.Object
  |
  +--java.awt.geom.Line2D
        |
        +--java.awt.geom.Line2D.Float
              |
              +--CollisionLine2D
All Implemented Interfaces:
java.lang.Cloneable, java.awt.Shape

public class CollisionLine2D
extends java.awt.geom.Line2D.Float
implements java.lang.Cloneable


Field Summary
 
Fields inherited from class java.awt.geom.Line2D.Float
x1, x2, y1, y2
 
Constructor Summary
CollisionLine2D(double dX1, double dY1, double dX2, double dY2)
          The Constructor, sets values
CollisionLine2D(float fX1, float fY1, float fX2, float fY2)
          The Constructor, sets values
 
Method Summary
 java.lang.Object clone()
          implements the cloneable interface
 float getHookWith(CollisionLine2D oLine)
          returns the hook between this line and the line oLine
 CollisionLine2D getIncomingLine(float fX, float fY)
          returns the normal line of this line to point fX, fY HAVE TO BE REWRITTEN if the normal line does not intersect this line, a line from the closest point of this line to the specified point will be returned
 float getLength()
          returns the length of this line
 float getLengthToPoint1(float fX, float fY)
          returns distance from the first point of this line to the specified position
 float getLengthToPoint2(float fX, float fY)
          returns distance from the second point of this line to the specified position
 CollisionLine2D getNormal()
          returns the normal line of this line HAVE TO BE REWRITTEN
 CollisionLine2D getNormalThrough(float fX, float fY)
          returns the normal line of this line to point fX, fY HAVE TO BE REWRITTEN The normal line may be outside this line
 java.lang.String toString()
          returns information about this line
 
Methods inherited from class java.awt.geom.Line2D.Float
getBounds2D, getP1, getP2, getX1, getX2, getY1, getY2, setLine, setLine
 
Methods inherited from class java.awt.geom.Line2D
contains, contains, contains, contains, getBounds, getPathIterator, getPathIterator, intersects, intersects, intersectsLine, intersectsLine, linesIntersect, ptLineDist, ptLineDist, ptLineDist, ptLineDistSq, ptLineDistSq, ptLineDistSq, ptSegDist, ptSegDist, ptSegDist, ptSegDistSq, ptSegDistSq, ptSegDistSq, relativeCCW, relativeCCW, relativeCCW, setLine, setLine
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CollisionLine2D

public CollisionLine2D(double dX1,
                       double dY1,
                       double dX2,
                       double dY2)
The Constructor, sets values

Since:
1.0

CollisionLine2D

public CollisionLine2D(float fX1,
                       float fY1,
                       float fX2,
                       float fY2)
The Constructor, sets values

Since:
1.0
Method Detail

getNormal

public CollisionLine2D getNormal()
returns the normal line of this line HAVE TO BE REWRITTEN

Returns:
CollisionLine2D the normalline of this line
Since:
1.0

getIncomingLine

public CollisionLine2D getIncomingLine(float fX,
                                       float fY)
returns the normal line of this line to point fX, fY HAVE TO BE REWRITTEN if the normal line does not intersect this line, a line from the closest point of this line to the specified point will be returned

Returns:
CollisionLine2D the normalline of this line
Since:
1.0

getLength

public float getLength()
returns the length of this line

Returns:
float the length of this line
Since:
1.0

getLengthToPoint1

public float getLengthToPoint1(float fX,
                               float fY)
returns distance from the first point of this line to the specified position

Returns:
float the distance between the first point of this line to the specified position
Since:
1.0

getLengthToPoint2

public float getLengthToPoint2(float fX,
                               float fY)
returns distance from the second point of this line to the specified position

Returns:
float the distance between the second point of this line to the specified position
Since:
1.0

getHookWith

public float getHookWith(CollisionLine2D oLine)
returns the hook between this line and the line oLine

Returns:
float the angle between the two lines
Since:
1.0

getNormalThrough

public CollisionLine2D getNormalThrough(float fX,
                                        float fY)
returns the normal line of this line to point fX, fY HAVE TO BE REWRITTEN The normal line may be outside this line

Returns:
CollisionLine2D the normalline of this line
Since:
1.0

clone

public java.lang.Object clone()
implements the cloneable interface

Overrides:
clone in class java.awt.geom.Line2D
Returns:
Object cloned version of this snapshot
Since:
1.0

toString

public java.lang.String toString()
returns information about this line

Overrides:
toString in class java.lang.Object
Returns:
String the representation of this line
Since:
1.0