edu.unh.sdb.datasource
Class SliceUtil

java.lang.Object
  extended by edu.unh.sdb.datasource.SliceUtil

public class SliceUtil
extends java.lang.Object

Utility functions for use in Slice.

Author:
dlipsa

Field Summary
static javax.vecmath.Vector3d X_AXIS
           
static javax.vecmath.Vector3d Y_AXIS
           
static javax.vecmath.Vector3d Z_AXIS
           
 
Constructor Summary
SliceUtil()
           
 
Method Summary
static java.lang.String arrayToString(int[] a)
           
static java.lang.String arrayToString(int[][] a)
           
static void calculateRotation(javax.vecmath.Vector3d src, javax.vecmath.Vector3d dest, javax.vecmath.AxisAngle4d axisAngle)
          Calculate the rotation to get from 'src' to 'dest' and store that in 'axisAngle'
static void calculateRotation(javax.vecmath.Vector3d src, javax.vecmath.Vector3d dest, javax.vecmath.Matrix4d m)
           
static javax.vecmath.Matrix4d calculateRotation(javax.vecmath.Vector3d srcZero, javax.vecmath.Vector3d srcOne, javax.vecmath.Vector3d destZero, javax.vecmath.Vector3d destOne)
          Calculate the rotation to get from 'srcZero' and 'srcOne' to 'destZero' and 'destOne' .
static double get(javax.vecmath.Tuple3d t, int axis)
           
static void orderPointsForSimpleClosedPath(javax.vecmath.Point2d[] intersection2d, javax.vecmath.Point3d[] intersection3d)
          Order the points to draw a simple closed path, from Algorithms in C++, Sedgewick, chapter 24.
static int power2Ceil(int v)
           
static javax.vecmath.Point3d segmentPlaneIntersection(javax.vecmath.Vector3d p0, javax.vecmath.Vector3d dv, double leftLimit, double rightLimit, javax.vecmath.Vector3d n, double d)
          Intersection between a ray segment and a plane section 13.9 3D Math Primer for Graphics and Game Development by Dunn&Parberry
static void set(javax.vecmath.Tuple3d t, int axis, double value)
           
static void swap(java.lang.Object[] a, int i, int j)
           
static javax.vecmath.Point3d toPoint3d(javax.vecmath.Point3i p)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

X_AXIS

public static javax.vecmath.Vector3d X_AXIS

Y_AXIS

public static javax.vecmath.Vector3d Y_AXIS

Z_AXIS

public static javax.vecmath.Vector3d Z_AXIS
Constructor Detail

SliceUtil

public SliceUtil()
Method Detail

power2Ceil

public static int power2Ceil(int v)

get

public static double get(javax.vecmath.Tuple3d t,
                         int axis)

arrayToString

public static java.lang.String arrayToString(int[] a)

arrayToString

public static java.lang.String arrayToString(int[][] a)

set

public static void set(javax.vecmath.Tuple3d t,
                       int axis,
                       double value)

segmentPlaneIntersection

public static javax.vecmath.Point3d segmentPlaneIntersection(javax.vecmath.Vector3d p0,
                                                             javax.vecmath.Vector3d dv,
                                                             double leftLimit,
                                                             double rightLimit,
                                                             javax.vecmath.Vector3d n,
                                                             double d)
Intersection between a ray segment and a plane section 13.9 3D Math Primer for Graphics and Game Development by Dunn&Parberry


swap

public static void swap(java.lang.Object[] a,
                        int i,
                        int j)

orderPointsForSimpleClosedPath

public static void orderPointsForSimpleClosedPath(javax.vecmath.Point2d[] intersection2d,
                                                  javax.vecmath.Point3d[] intersection3d)
Order the points to draw a simple closed path, from Algorithms in C++, Sedgewick, chapter 24.


calculateRotation

public static javax.vecmath.Matrix4d calculateRotation(javax.vecmath.Vector3d srcZero,
                                                       javax.vecmath.Vector3d srcOne,
                                                       javax.vecmath.Vector3d destZero,
                                                       javax.vecmath.Vector3d destOne)
Calculate the rotation to get from 'srcZero' and 'srcOne' to 'destZero' and 'destOne' . srcZero and srcOne should be perpendicular before the execution of this function and destZero and destOne should be perpendicular as well.


toPoint3d

public static javax.vecmath.Point3d toPoint3d(javax.vecmath.Point3i p)

calculateRotation

public static void calculateRotation(javax.vecmath.Vector3d src,
                                     javax.vecmath.Vector3d dest,
                                     javax.vecmath.Matrix4d m)

calculateRotation

public static void calculateRotation(javax.vecmath.Vector3d src,
                                     javax.vecmath.Vector3d dest,
                                     javax.vecmath.AxisAngle4d axisAngle)
Calculate the rotation to get from 'src' to 'dest' and store that in 'axisAngle'