|
Aviatrix3D 2.1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.j3d.aviatrix3d.rendering.BoundingVolume
public abstract class BoundingVolume
Base representation of a class that can representing bound information.
Bounds describe a 3D volume, and various abstract intersection methods are defined. All methods must be implemented as various methods may be called during different parts of the rendering cycle. All bounds and rays are assumed to be represented in the same local coordinate space.
All intersection tests assume that the incoming picking details have been transformed to the local coordinate space that this volume exists in. The one exception to this rule is the view frustum intersection tests. The reason for this is performance - transforming 6 planes of the view matrix requires 6 matrix-vector multiplications, whereas by providing the reverse we only need to perform 2 matrix-vector mulitplications. Since view frustum culling is such a performance critical path of the rendering system we have decided to optimise for speed here rather than consistent API coding.
Field Summary | |
---|---|
static int |
BOX_BOUNDS
The bounding volume type is sphere |
static int |
FRUSTUM_ALLIN
The frustum check revealed all points inside the frustum |
static int |
FRUSTUM_ALLOUT
The frustum check revealed all points outside the frustum |
static int |
FRUSTUM_PARTIAL
The frustum check revealed some points inside the frustum |
static int |
GEOMETRY_BOUNDS
The bounding volume type is user provided geometry |
static int |
NULL_BOUNDS
The bounding volume type is not valid (ie it has no bounds) |
static int |
SPHERE_BOUNDS
The bounding volume type is sphere |
Constructor Summary | |
---|---|
protected |
BoundingVolume()
The default constructor. |
Method Summary | |
---|---|
abstract boolean |
checkIntersectionBox(float[] minExtents,
float[] maxExtents)
Check for the given AA box intersecting this bounds. |
abstract boolean |
checkIntersectionCone(float[] vertex,
float[] direction,
float angle)
Check for the given cone intersecting this bounds. |
abstract boolean |
checkIntersectionCylinder(float[] center,
float[] direction,
float radius,
float height)
Check for the given cylinder segment intersecting this bounds. |
abstract int |
checkIntersectionFrustum(javax.vecmath.Vector4f[] planes,
javax.vecmath.Matrix4d mat)
Check whether this volume intersects with the view frustum. |
abstract int |
checkIntersectionFrustum(javax.vecmath.Vector4f[] planes,
javax.vecmath.Matrix4f mat)
Check whether this volume intersects with the view frustum. |
abstract boolean |
checkIntersectionPoint(float[] pos)
Check for the given point lieing inside this bounds. |
abstract boolean |
checkIntersectionRay(float[] pos,
float[] dir)
Check for the given ray intersecting this bounds. |
abstract boolean |
checkIntersectionSegment(float[] start,
float[] end)
Check for the given line segment intersecting this bounds. |
abstract boolean |
checkIntersectionSphere(float[] center,
float radius)
Check for the given sphere intersecting this bounds. |
abstract boolean |
checkIntersectionTriangle(float[] v0,
float[] v1,
float[] v2)
Check for the given triangle intersecting this bounds. |
abstract void |
getCenter(float[] center)
Get the center of the bounding volume. |
abstract void |
getExtents(float[] min,
float[] max)
Get the maximum extents of the bounding volume. |
abstract int |
getType()
The type of bounds this object represents. |
abstract void |
transform(javax.vecmath.Matrix4d mat)
Transform the current postion by the given transformation matrix. |
abstract void |
transform(javax.vecmath.Matrix4f mat)
Transform the current postion by the given transformation matrix. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int NULL_BOUNDS
public static final int SPHERE_BOUNDS
public static final int BOX_BOUNDS
public static final int GEOMETRY_BOUNDS
public static final int FRUSTUM_ALLOUT
public static final int FRUSTUM_ALLIN
public static final int FRUSTUM_PARTIAL
Constructor Detail |
---|
protected BoundingVolume()
Method Detail |
---|
public abstract int getType()
public abstract void getExtents(float[] min, float[] max)
min
- The minimum position of the boundsmax
- The maximum position of the boundspublic abstract void getCenter(float[] center)
center
- The center of the bounds will be copied herepublic abstract boolean checkIntersectionPoint(float[] pos)
pos
- The location of the point to test against
public abstract boolean checkIntersectionRay(float[] pos, float[] dir)
pos
- The start location of the raydir
- The direction vector of the ray
public abstract boolean checkIntersectionSegment(float[] start, float[] end)
start
- The start location of the segmentend
- The start location of the segment
public abstract boolean checkIntersectionSphere(float[] center, float radius)
center
- The location of the sphere's centerradius
- The radius of the sphere
public abstract boolean checkIntersectionTriangle(float[] v0, float[] v1, float[] v2)
v0
- The first vertex of the trianglev1
- The second vertex of the trianglev2
- The third vertex of the triangle
public abstract boolean checkIntersectionCylinder(float[] center, float[] direction, float radius, float height)
center
- The location of the cylinder's centerdirection
- A unit vector indicating the axial directionradius
- The radius of the cylinderheight
- The half-height of the cylinder from the center point
public abstract boolean checkIntersectionCone(float[] vertex, float[] direction, float angle)
vertex
- The location of the cone's vertexdirection
- A unit vector indicating the axial directionangle
- The spread angle of the cone
public abstract boolean checkIntersectionBox(float[] minExtents, float[] maxExtents)
minExtents
- The minimum extent value on each axismaxExtents
- The maximum extent value on each axis
public abstract int checkIntersectionFrustum(javax.vecmath.Vector4f[] planes, javax.vecmath.Matrix4d mat)
planes
- The 6 planes of the frustummat
- The vworld to local transformation matrix
public abstract int checkIntersectionFrustum(javax.vecmath.Vector4f[] planes, javax.vecmath.Matrix4f mat)
planes
- The 6 planes of the frustummat
- The vworld to local transformation matrix
public abstract void transform(javax.vecmath.Matrix4d mat)
mat
- The matrix to transform this bounds bypublic abstract void transform(javax.vecmath.Matrix4f mat)
mat
- The matrix to transform this bounds by
|
Aviatrix3D 2.1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |