net.java.dev.joode.util
Class ParametricSegment2D

java.lang.Object
  extended by net.java.dev.joode.util.ParametricSegment2D

public class ParametricSegment2D
extends java.lang.Object

represents a line in the form (x,y) = P + tD where P is the start of the segment, U is the direction (normalized) where 0

Author:
Tom Larkworthy

Field Summary
 Vector2 D
           
static Vector2 delta
           
static Vector2 deltaMinusT1D1
          (delta - T1*D1)
static Vector2 deltaPlusT0D0
          (delta + T0*D0)
static Vector2 deltaPlusT0D0MinusT1D1
          (delta + T0*D0 - T1*D1)
 Vector2 Dperp
           
static Vector2 intersection
           
 Vector2 P
           
 float T
           
 
Constructor Summary
ParametricSegment2D()
           
 
Method Summary
 boolean intersect(ParametricSegment2D other, Vector2 passback)
           
 void set(Vector2 start, Vector2 end)
          sets the equation up to create a segment between the two specified points
 void set(Vector2 start, Vector2 end, boolean isRay)
          sets the equation up to create a segment/ray between the two specified points
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

delta

public static final Vector2 delta

intersection

public static final Vector2 intersection

deltaPlusT0D0

public static final Vector2 deltaPlusT0D0
(delta + T0*D0)


deltaMinusT1D1

public static final Vector2 deltaMinusT1D1
(delta - T1*D1)


deltaPlusT0D0MinusT1D1

public static final Vector2 deltaPlusT0D0MinusT1D1
(delta + T0*D0 - T1*D1)


T

public float T

P

public final Vector2 P

D

public final Vector2 D

Dperp

public final Vector2 Dperp
Constructor Detail

ParametricSegment2D

public ParametricSegment2D()
Method Detail

set

public void set(Vector2 start,
                Vector2 end,
                boolean isRay)
sets the equation up to create a segment/ray between the two specified points

Parameters:
start -
end -
isRay, - if isRay is true, then T is infinity and the object represents a Ray

set

public void set(Vector2 start,
                Vector2 end)
sets the equation up to create a segment between the two specified points

Parameters:
start -
end -

intersect

public boolean intersect(ParametricSegment2D other,
                         Vector2 passback)