j3d.org Code

org.j3d.renderer.java3d.util
Class J3DIntersectionUtils

java.lang.Object
  extended byorg.j3d.geom.IntersectionUtils
      extended byorg.j3d.renderer.java3d.util.J3DIntersectionUtils

public class J3DIntersectionUtils
extends IntersectionUtils

An extension of the basic IntersectionUtils class to include Java3D-specific extensions for interacting directly with GeometryArray instances.

Version:
$Revision: 1.1 $
Author:
Justin Couch
See Also:
IntersectionUtils

Field Summary
 
Fields inherited from class org.j3d.geom.IntersectionUtils
pickDir, pickStart, wkPolygon, working2dCoords, workingCoords, workingIndicies, workingStrips, X_AXIS, Y_AXIS, Z_AXIS
 
Constructor Summary
J3DIntersectionUtils()
          Create a default instance of this class with no internal data structures allocated.
 
Method Summary
 boolean rayIndexedQuadArray(javax.vecmath.Point3d origin, javax.vecmath.Vector3d direction, float length, javax.media.j3d.IndexedQuadArray geom, javax.media.j3d.Transform3D vworldTransform, javax.vecmath.Point3d point, boolean intersectOnly)
          Test the intersection of a ray or segment against the given indexed quad array.If there is an intersection, the point will contain the exact intersection point on the geometry.
 boolean rayIndexedTriangleArray(javax.vecmath.Point3d origin, javax.vecmath.Vector3d direction, float length, javax.media.j3d.IndexedTriangleArray geom, javax.media.j3d.Transform3D vworldTransform, javax.vecmath.Point3d point, boolean intersectOnly)
          Test the intersection of a ray or segment against the given indexed triangle array.If there is an intersection, the point will contain the exact intersection point on the geometry.
 boolean rayQuadArray(javax.vecmath.Point3d origin, javax.vecmath.Vector3d direction, float length, javax.media.j3d.QuadArray geom, javax.media.j3d.Transform3D vworldTransform, javax.vecmath.Point3d point, boolean intersectOnly)
          Test the intersection of a ray or segment against the given quad array.If there is an intersection, the point will contain the exact intersection point on the geometry.
 boolean rayTriangleArray(javax.vecmath.Point3d origin, javax.vecmath.Vector3d direction, float length, javax.media.j3d.TriangleArray geom, javax.media.j3d.Transform3D vworldTransform, javax.vecmath.Point3d point, boolean intersectOnly)
          Test the intersection of a ray or segment against the given triangle array.If there is an intersection, the point will contain the exact intersection point on the geometry.
 boolean rayTriangleFanArray(javax.vecmath.Point3d origin, javax.vecmath.Vector3d direction, float length, javax.media.j3d.TriangleFanArray geom, javax.media.j3d.Transform3D vworldTransform, javax.vecmath.Point3d point, boolean intersectOnly)
          Test the intersection of a ray or segment against the given triangle fan array.If there is an intersection, the point will contain the exact intersection point on the geometry.
 boolean rayTriangleStripArray(javax.vecmath.Point3d origin, javax.vecmath.Vector3d direction, float length, javax.media.j3d.TriangleStripArray geom, javax.media.j3d.Transform3D vworldTransform, javax.vecmath.Point3d point, boolean intersectOnly)
          Test the intersection of a ray or segment against the given triangle strip array.If there is an intersection, the point will contain the exact intersection point on the geometry.
 boolean rayUnknownGeometry(javax.vecmath.Point3d origin, javax.vecmath.Vector3d direction, float length, javax.media.j3d.GeometryArray geom, javax.media.j3d.Transform3D vworldTransform, javax.vecmath.Point3d point, boolean intersectOnly)
          Convenience method to pass in an item of geometry and ask the intersection code to find out what the real geometry type is and process it appropriately.
 boolean rayUnknownGeometry(javax.vecmath.Point3d origin, javax.vecmath.Vector3d direction, float length, GeometryData data, javax.media.j3d.Transform3D vworldTransform, javax.vecmath.Point3d point, boolean intersectOnly)
          Convenience method to process a GeometryData and ask the intersection code to find out what the real geometry type is and process it appropriately.
 
Methods inherited from class org.j3d.geom.IntersectionUtils
clear, rayCylinder, rayCylinder, rayIndexedQuadArray, rayIndexedTriangleArray, rayPlane, rayPlane, rayPolygon, rayQuadArray, raySphere, raySphere, rayTriangleArray, rayTriangleFanArray, rayTriangleStripArray, rayUnknownGeometry
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

J3DIntersectionUtils

public J3DIntersectionUtils()
Create a default instance of this class with no internal data structures allocated.

Method Detail

rayUnknownGeometry

public boolean rayUnknownGeometry(javax.vecmath.Point3d origin,
                                  javax.vecmath.Vector3d direction,
                                  float length,
                                  GeometryData data,
                                  javax.media.j3d.Transform3D vworldTransform,
                                  javax.vecmath.Point3d point,
                                  boolean intersectOnly)
Convenience method to process a GeometryData and ask the intersection code to find out what the real geometry type is and process it appropriately. If there is an intersection, the point will contain the exact intersection point on the geometry.

This code will be much more efficient than the other version because we do not need to reallocate internal arrays all the time or have the need to set capability bits, hurting performance optimisations. If the geometry array does not understand the provided geometry type, it will silently ignore the request and always return false.

Parameters:
origin - The origin of the ray
direction - The direction of the ray
length - An optional length for to make the ray a segment. If the value is zero, it is ignored
data - The geometry to test against
point - The intersection point for returning
intersectOnly - true if we only want to know if we have a intersection and don't really care which it is
Returns:
true if there was an intersection, false if not

rayUnknownGeometry

public boolean rayUnknownGeometry(javax.vecmath.Point3d origin,
                                  javax.vecmath.Vector3d direction,
                                  float length,
                                  javax.media.j3d.GeometryArray geom,
                                  javax.media.j3d.Transform3D vworldTransform,
                                  javax.vecmath.Point3d point,
                                  boolean intersectOnly)
Convenience method to pass in an item of geometry and ask the intersection code to find out what the real geometry type is and process it appropriately. If there is an intersection, the point will contain the exact intersection point on the geometry.

If the userData object for this geometry is an instance of GeometryData we will use that in preferences to the actual geometry.

Parameters:
origin - The origin of the ray
direction - The direction of the ray
length - An optional length for to make the ray a segment. If the value is zero, it is ignored
geom - The geometry to test against
point - The intersection point for returning
intersectOnly - true if we only want to know if we have a intersection and don't really care which it is
Returns:
true if there was an intersection, false if not

rayTriangleArray

public boolean rayTriangleArray(javax.vecmath.Point3d origin,
                                javax.vecmath.Vector3d direction,
                                float length,
                                javax.media.j3d.TriangleArray geom,
                                javax.media.j3d.Transform3D vworldTransform,
                                javax.vecmath.Point3d point,
                                boolean intersectOnly)
Test the intersection of a ray or segment against the given triangle array.If there is an intersection, the point will contain the exact intersection point on the geometry.

Parameters:
origin - The origin of the ray
direction - The direction of the ray
length - An optional length for to make the ray a segment. If the value is zero, it is ignored
geom - The geometry to test against
point - The intersection point for returning
intersectOnly - true if we only want to know if we have a intersection and don't really care which it is
Returns:
true if there was an intersection, false if not

rayQuadArray

public boolean rayQuadArray(javax.vecmath.Point3d origin,
                            javax.vecmath.Vector3d direction,
                            float length,
                            javax.media.j3d.QuadArray geom,
                            javax.media.j3d.Transform3D vworldTransform,
                            javax.vecmath.Point3d point,
                            boolean intersectOnly)
Test the intersection of a ray or segment against the given quad array.If there is an intersection, the point will contain the exact intersection point on the geometry.

Parameters:
origin - The origin of the ray
direction - The direction of the ray
length - An optional length for to make the ray a segment. If the value is zero, it is ignored
geom - The geometry to test against
point - The intersection point for returning
intersectOnly - true if we only want to know if we have a intersection and don't really care which it is
Returns:
true if there was an intersection, false if not

rayTriangleStripArray

public boolean rayTriangleStripArray(javax.vecmath.Point3d origin,
                                     javax.vecmath.Vector3d direction,
                                     float length,
                                     javax.media.j3d.TriangleStripArray geom,
                                     javax.media.j3d.Transform3D vworldTransform,
                                     javax.vecmath.Point3d point,
                                     boolean intersectOnly)
Test the intersection of a ray or segment against the given triangle strip array.If there is an intersection, the point will contain the exact intersection point on the geometry.

Parameters:
origin - The origin of the ray
direction - The direction of the ray
length - An optional length for to make the ray a segment. If the value is zero, it is ignored
geom - The geometry to test against
point - The intersection point for returning
intersectOnly - true if we only want to know if we have a intersection and don't really care which it is
Returns:
true if there was an intersection, false if not

rayTriangleFanArray

public boolean rayTriangleFanArray(javax.vecmath.Point3d origin,
                                   javax.vecmath.Vector3d direction,
                                   float length,
                                   javax.media.j3d.TriangleFanArray geom,
                                   javax.media.j3d.Transform3D vworldTransform,
                                   javax.vecmath.Point3d point,
                                   boolean intersectOnly)
Test the intersection of a ray or segment against the given triangle fan array.If there is an intersection, the point will contain the exact intersection point on the geometry.

Parameters:
origin - The origin of the ray
direction - The direction of the ray
length - An optional length for to make the ray a segment. If the value is zero, it is ignored
geom - The geometry to test against
point - The intersection point for returning
intersectOnly - true if we only want to know if we have a intersection and don't really care which it is
Returns:
true if there was an intersection, false if not

rayIndexedTriangleArray

public boolean rayIndexedTriangleArray(javax.vecmath.Point3d origin,
                                       javax.vecmath.Vector3d direction,
                                       float length,
                                       javax.media.j3d.IndexedTriangleArray geom,
                                       javax.media.j3d.Transform3D vworldTransform,
                                       javax.vecmath.Point3d point,
                                       boolean intersectOnly)
Test the intersection of a ray or segment against the given indexed triangle array.If there is an intersection, the point will contain the exact intersection point on the geometry.

Parameters:
origin - The origin of the ray
direction - The direction of the ray
length - An optional length for to make the ray a segment. If the value is zero, it is ignored
geom - The geometry to test against
point - The intersection point for returning
intersectOnly - true if we only want to know if we have a intersection and don't really care which it is
Returns:
true if there was an intersection, false if not

rayIndexedQuadArray

public boolean rayIndexedQuadArray(javax.vecmath.Point3d origin,
                                   javax.vecmath.Vector3d direction,
                                   float length,
                                   javax.media.j3d.IndexedQuadArray geom,
                                   javax.media.j3d.Transform3D vworldTransform,
                                   javax.vecmath.Point3d point,
                                   boolean intersectOnly)
Test the intersection of a ray or segment against the given indexed quad array.If there is an intersection, the point will contain the exact intersection point on the geometry.

Parameters:
origin - The origin of the ray
direction - The direction of the ray
length - An optional length for to make the ray a segment. If the value is zero, it is ignored
geom - The geometry to test against
point - The intersection point for returning
intersectOnly - true if we only want to know if we have a intersection and don't really care which it is
Returns:
true if there was an intersection, false if not

j3d.org Code

Latest Info from http://code.j3d.org/
Copyright © 2001 - j3d.org