jautil.geometry
Class TRUtil

java.lang.Object
  extended by jautil.geometry.TRUtil

public class TRUtil
extends java.lang.Object

A collection of (static) utility methods for translation and rotation data.


Field Summary
static float METRES_TO_INCHES
           
static int ROT_SIZE
           
static int TRANS_SIZE
           
 
Constructor Summary
TRUtil()
           
 
Method Summary
static double[] rotationDirectionAndAngle(float[] rot)
          Provides the given rotation data as a direction vector (that is, the 3 direction cosines), together with the angle of rotation about that vector (in degrees).
static void setRotation(float[] rdest, float[] rsrc)
          Copies the given source rotation to the given destination one.
static void setRotation(float[] rdest, Quaternion qsrc)
          Copies the given source quaternion rotation values to the given destination array.
static void setScaledTranslation(float[] tdest, float[] tsrc, float scale)
          Copies the given source translation to the given destination one.
static void setScaledTranslationInInches(float[] tdest, float[] tsrc, float scale)
          Copies the given source translation to the given destination one, converting each component from metres to inches.
static void setTranslation(float[] tdest, float[] tsrc)
          Copies the given source translation to the given destination one.
static void setTranslationInInches(float[] tdest, float[] tsrc)
          Copies the given source translation to the given destination one, converting each component from metres to inches.
static java.lang.String stringForTR(int fourcc, float[] trans, float[] rot)
          Returns a string representation of the given translation and rotation data.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TRANS_SIZE

public static final int TRANS_SIZE
See Also:
Constant Field Values

ROT_SIZE

public static final int ROT_SIZE
See Also:
Constant Field Values

METRES_TO_INCHES

public static final float METRES_TO_INCHES
See Also:
Constant Field Values
Constructor Detail

TRUtil

public TRUtil()
Method Detail

setTranslation

public static void setTranslation(float[] tdest,
                                  float[] tsrc)
Copies the given source translation to the given destination one.


setScaledTranslation

public static void setScaledTranslation(float[] tdest,
                                        float[] tsrc,
                                        float scale)
Copies the given source translation to the given destination one.


setTranslationInInches

public static void setTranslationInInches(float[] tdest,
                                          float[] tsrc)
Copies the given source translation to the given destination one, converting each component from metres to inches.


setScaledTranslationInInches

public static void setScaledTranslationInInches(float[] tdest,
                                                float[] tsrc,
                                                float scale)
Copies the given source translation to the given destination one, converting each component from metres to inches.


setRotation

public static void setRotation(float[] rdest,
                               float[] rsrc)
Copies the given source rotation to the given destination one.


setRotation

public static void setRotation(float[] rdest,
                               Quaternion qsrc)
Copies the given source quaternion rotation values to the given destination array.


stringForTR

public static java.lang.String stringForTR(int fourcc,
                                           float[] trans,
                                           float[] rot)
Returns a string representation of the given translation and rotation data.


rotationDirectionAndAngle

public static double[] rotationDirectionAndAngle(float[] rot)
Provides the given rotation data as a direction vector (that is, the 3 direction cosines), together with the angle of rotation about that vector (in degrees). The direction cosines will all be zero when the angle of rotation is at or very close to zero.