|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectanl.aida.viz3d.Utils3D
public class Utils3D
Static utililty methods for 3D.
Nested Class Summary | |
---|---|
static class |
Utils3D.Location
|
Field Summary | |
---|---|
private static float |
K_EPSILON
|
private static float |
NE_COS
|
private static float |
NE_SIN
|
Constructor Summary | |
---|---|
Utils3D()
|
Method Summary | |
---|---|
static void |
colorToFloats(float[] array,
java.awt.Color color)
|
static BoundingSphere |
createBoundingSphere(java.nio.FloatBuffer buf)
Creates a bounding box that will encompass the vertices in the specified buffer. |
static BoundingSphere |
createBoundingSphere(java.awt.geom.Rectangle2D rect)
Creates a BoundingSphere that will enclose the rectangle. |
static java.awt.Color |
floatToColor(float[] color)
|
static javax.vecmath.Point3f |
getRelativeLocation(VSpatial item,
Utils3D.Location location)
Gets the location relative to the specified VSpatial in terms of the VSpatial's local frame. |
static Box |
getWorldSizeAtZ(javax.media.opengl.GL gl,
float nearClipZ,
float farClipZ,
float z)
|
static boolean |
isZero(float val)
Checks if equals zero within some epsilon. |
static javax.vecmath.Tuple3f |
mult(javax.vecmath.Quat4f rotation,
javax.vecmath.Tuple3f in,
javax.vecmath.Tuple3f out)
Assumes quat is normalized. |
static boolean |
triangleIntersect(javax.vecmath.Point3f p0,
javax.vecmath.Point3f p1,
javax.vecmath.Point3f p2,
javax.vecmath.Point3f rayOrigin,
javax.vecmath.Vector3f rayDirection)
Computes whether or not the triangle defined by P0, P1, and P2 is intersected by the the ray. |
static void |
triangleNormal(javax.vecmath.Point3f pt1,
javax.vecmath.Point3f pt2,
javax.vecmath.Point3f pt3,
javax.vecmath.Vector3f result)
Computes the normal of the specified triangle. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final float K_EPSILON
private static final float NE_SIN
private static final float NE_COS
Constructor Detail |
---|
public Utils3D()
Method Detail |
---|
public static void colorToFloats(float[] array, java.awt.Color color)
public static boolean isZero(float val)
val
-
public static java.awt.Color floatToColor(float[] color)
public static javax.vecmath.Tuple3f mult(javax.vecmath.Quat4f rotation, javax.vecmath.Tuple3f in, javax.vecmath.Tuple3f out)
rotation
- in
- out
-
public static javax.vecmath.Point3f getRelativeLocation(VSpatial item, Utils3D.Location location)
item
- the VSpatial to get location relative tolocation
- the type of location we want
public static BoundingSphere createBoundingSphere(java.nio.FloatBuffer buf)
buf
- the Buffer containing the vertices' coordinatessize
- the number of coordinates per vertex
public static boolean triangleIntersect(javax.vecmath.Point3f p0, javax.vecmath.Point3f p1, javax.vecmath.Point3f p2, javax.vecmath.Point3f rayOrigin, javax.vecmath.Vector3f rayDirection)
p0
- p1
- p2
- rayOrigin
- rayDirection
-
public static void triangleNormal(javax.vecmath.Point3f pt1, javax.vecmath.Point3f pt2, javax.vecmath.Point3f pt3, javax.vecmath.Vector3f result)
pt1
- pt2
- pt3
- public static BoundingSphere createBoundingSphere(java.awt.geom.Rectangle2D rect)
rect
- the rectangle to bound
public static Box getWorldSizeAtZ(javax.media.opengl.GL gl, float nearClipZ, float farClipZ, float z)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |