astex
Class Geometry

java.lang.Object
  extended by astex.Geometry

public class Geometry
extends java.lang.Object

Various involved geometrical operations for the renderer. The ray cylinder intersection is adapted from WildMagics software renderer http://www.geometrictools.com/ Which is available under LGPL license


Constructor Summary
Geometry()
           
 
Method Summary
static double cross(double[] a, double[] b, double[] c)
          Form cross product of two vectors(a = b x c).
static double dot(double[] a, double[] b)
          Generate the dot product.
static void generateOrthonormalBasis(double[] rkU, double[] rkV, double[] rkW, boolean bUnitLengthW)
          Generate orthogonal normalised vector set.
static double normalise(double[] p)
          Normalise the vector.
static int rayCapsuleInt(double[] ray0, double[] ray1, double[] pint, double[] nint, boolean top)
          Peform ray-cylinder intersection and normal generation.
static void rayCapsuleIntInit(double[] c0, double[] c1, double cr, double zrange)
          Initialise cylinder calculations.
static int raySphereInt(double[] ray0, double[] ray1, double x, double y, double z, double r, double[] pint, double[] nint, boolean top)
          Peform ray-sphere intersection and normal generation.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Geometry

public Geometry()
Method Detail

rayCapsuleIntInit

public static void rayCapsuleIntInit(double[] c0,
                                     double[] c1,
                                     double cr,
                                     double zrange)
Initialise cylinder calculations.


raySphereInt

public static int raySphereInt(double[] ray0,
                               double[] ray1,
                               double x,
                               double y,
                               double z,
                               double r,
                               double[] pint,
                               double[] nint,
                               boolean top)
Peform ray-sphere intersection and normal generation.


rayCapsuleInt

public static int rayCapsuleInt(double[] ray0,
                                double[] ray1,
                                double[] pint,
                                double[] nint,
                                boolean top)
Peform ray-cylinder intersection and normal generation.


normalise

public static double normalise(double[] p)
Normalise the vector.


generateOrthonormalBasis

public static void generateOrthonormalBasis(double[] rkU,
                                            double[] rkV,
                                            double[] rkW,
                                            boolean bUnitLengthW)
Generate orthogonal normalised vector set.


cross

public static double cross(double[] a,
                           double[] b,
                           double[] c)
Form cross product of two vectors(a = b x c).


dot

public static double dot(double[] a,
                         double[] b)
Generate the dot product.