|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbackend.SpheriosityUtils
public class SpheriosityUtils
SpheriosityUtils is a set of helper functions that get common values for things that might be useful to know for our application. Most of these utils will be for computing geometric things that are guided to help the user
Constructor Summary | |
---|---|
SpheriosityUtils()
|
Method Summary | |
---|---|
static boolean |
angleCheck(javax.vecmath.Vector3f rotationAxis,
javax.vecmath.Point3f tangentPoint,
javax.vecmath.Point3f userPoint)
angleCheck will tell you if the point passed in will rotate "as expected" or if it needs to be rotated in the opposite direction. |
static void |
appendErrorMessageToFile(java.lang.String message,
java.lang.String filename)
appendErrorMessageToFile is used for making error message files |
static void |
enablePicking(javax.media.j3d.Node node)
enablePicking allows for accurate picking of objects. |
static float |
getAngle(javax.vecmath.Point3f firstPoint,
javax.vecmath.Point3f middlePoint,
javax.vecmath.Point3f finalPoint)
getAngle returns the angle between three points. |
static javax.vecmath.Vector3f |
getAxisOfRotation(javax.vecmath.Tuple3f firstVec,
javax.vecmath.Tuple3f secondVec)
getAxisOfRotation will return the axis of rotation in the spherical sense if given two vectors which were created as going from the center of the sphere to an outside point. |
static java.lang.String |
getDate()
getDate will return the current date and time in a simple format of yyyy-mm-dd hh:mm. |
static java.lang.String |
getFormattedDouble(double formatMe)
getForattedDouble returns a formatted version of the double passed to it |
static float |
getGreatCircleLength(float sphereRadius)
greatCircleLength will return the length of a great circle on a sphere of given radius |
static float |
getLongLineLength(javax.vecmath.Point3f firstPoint,
javax.vecmath.Point3f secondPoint,
float sphereRadius)
getLongLineLength gets the long length of a line on a sphere. |
static float |
getShortLineLength(javax.vecmath.Point3f firstPoint,
javax.vecmath.Point3f secondPoint,
float sphereRadius)
shortLineLength will return the shortest distance between two points on a sphere. |
static java.lang.String |
getStackTraceData(java.lang.Exception e)
getStackTraceData will return the stack trace as a String |
static float |
getTriangleArea(javax.vecmath.Point3f firstPoint,
javax.vecmath.Point3f secondPoint,
javax.vecmath.Point3f thirdPoint,
float sphereRad)
getTriangleArea will return the area of a spherical triangle. |
static void |
rotatePoint(javax.vecmath.Vector3f axisOfRotation,
javax.vecmath.Point3f rotateMe,
float angle)
rotatePoint will rotate a given point a given angle on a given axis of rotation. |
static javax.vecmath.Tuple3f |
tupleSubtract(javax.vecmath.Tuple3f minuend,
javax.vecmath.Tuple3f subtrahend)
tupleSubtract will subtract the second tuple from the first and return the result. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SpheriosityUtils()
Method Detail |
---|
public static float getShortLineLength(javax.vecmath.Point3f firstPoint, javax.vecmath.Point3f secondPoint, float sphereRadius)
firstPoint
- Is the first point used in defining our linesecondPoint
- Is the second point used in defining our linesphereRadius
- Is the radius of the sphere we are working with
public static float getGreatCircleLength(float sphereRadius)
sphereRadius
- is the radius of the sphere
public static float getLongLineLength(javax.vecmath.Point3f firstPoint, javax.vecmath.Point3f secondPoint, float sphereRadius)
firstPoint
- The first point of the line in questionsecondPoint
- The second point to define the line withsphereRadius
- The radius of the sphere we are working with
public static float getAngle(javax.vecmath.Point3f firstPoint, javax.vecmath.Point3f middlePoint, javax.vecmath.Point3f finalPoint)
firstPoint
- is the first point of the anglemiddlePoint
- is the middle point of the anglefinalPoint
- is the last point that defines the angle
public static float getTriangleArea(javax.vecmath.Point3f firstPoint, javax.vecmath.Point3f secondPoint, javax.vecmath.Point3f thirdPoint, float sphereRad)
firstPoint
- The first point of the trianglesecondPoint
- The second point of the trianglethirdPoint
- The third point of the trianglesphereRad
- The radius of the sphere the triangles are on
public static void enablePicking(javax.media.j3d.Node node)
node
- is the node to enable picking forpublic static java.lang.String getFormattedDouble(double formatMe)
formatMe
- is the double to format
public static javax.vecmath.Tuple3f tupleSubtract(javax.vecmath.Tuple3f minuend, javax.vecmath.Tuple3f subtrahend)
minuend
- left hand side of the minus signsubtrahend
- right hand side of the minus sign
public static javax.vecmath.Vector3f getAxisOfRotation(javax.vecmath.Tuple3f firstVec, javax.vecmath.Tuple3f secondVec)
firstVec
- is the first vector of the linesecondPoint
- is the second vector of the line
public static void rotatePoint(javax.vecmath.Vector3f axisOfRotation, javax.vecmath.Point3f rotateMe, float angle)
axisOfRotation
- the axis to use to rotate the given pointrotateMe
- is the point to rotate. WARNING the values stored here
will be changed to reflect the rotation!angle
- the amount of rotatepublic static boolean angleCheck(javax.vecmath.Vector3f rotationAxis, javax.vecmath.Point3f tangentPoint, javax.vecmath.Point3f userPoint)
rotationAxis
- is the axis of rotation to make the tangent vector
withtangentPoint
- is the point to make a tangent vector withuserPoint
- is the point we want to rotate towards
public static java.lang.String getStackTraceData(java.lang.Exception e)
e
- is the exception to get a stack trace from
public static java.lang.String getDate()
public static void appendErrorMessageToFile(java.lang.String message, java.lang.String filename)
message
- is the message to write to the filefilename
- is the file to write the message to
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |