backend
Class Line3f

java.lang.Object
  extended by backend.Line3f

public class Line3f
extends java.lang.Object

The Line3f class represents a line in R^3 (vector form)


Constructor Summary
Line3f(javax.vecmath.Point3f pt, javax.vecmath.Vector3f dir)
          The default Line3f constructor can be used to create a Line3f class.
 
Method Summary
 javax.vecmath.Point3f getIntersection(Line3f myLine)
          getIntersection will return the intersection point between this line and the line passed to the function.
 float getIntersectionSphereScaleVal(SphereModel mySphere)
          getIntersectionSphereScaleVal will return a scale value which can be used in the getPointFromLine function to get the intersection points of this line with a given SphereModel
 void getPointFromLine(float scale, javax.vecmath.Point3f storeHere)
          getPointFromLine will return a point off this line based on a scaling where 0 would get you the point used to place the line and - or + values will move you left or right based on the direction vector.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Line3f

public Line3f(javax.vecmath.Point3f pt,
              javax.vecmath.Vector3f dir)
The default Line3f constructor can be used to create a Line3f class.

Parameters:
pt - should be a point on the line
dir - should be the direction of the line
Method Detail

getIntersection

public javax.vecmath.Point3f getIntersection(Line3f myLine)
getIntersection will return the intersection point between this line and the line passed to the function. This function should return null if the lines to do not intersection. WARNING: The full functionality of this function has not been tested so it may not work 100% as intended we do know that it will work if you know the lines in question intersect. (Since that is our current use for the function

Parameters:
myLine - is the Line3f to check against for intersection

getPointFromLine

public void getPointFromLine(float scale,
                             javax.vecmath.Point3f storeHere)
getPointFromLine will return a point off this line based on a scaling where 0 would get you the point used to place the line and - or + values will move you left or right based on the direction vector. This is because the line is stored as the vector form of a line in R^3

Parameters:
scale - is the scale value for the direction vector
storeMe - is where the new point will be placed

getIntersectionSphereScaleVal

public float getIntersectionSphereScaleVal(SphereModel mySphere)
getIntersectionSphereScaleVal will return a scale value which can be used in the getPointFromLine function to get the intersection points of this line with a given SphereModel

Parameters:
mySphere - is the sphere model to check for intersections with
Returns:
a float which represents a scale value to use in the getPointFromLine function. To get both points use the positive and negative version of the scale value that is returned from this function. NaN will be returned if there was no intersection

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object