I'm trying to use Intersect & PickSegment as a collision detector. I'm
creating a PickSegment from the moving object's curent position to a point
in the direction of travel. I'm then passing it and a quad into
intersect.segmentAndQuad(...).
Everything is compiling and running without errors. I know I the pick
segment is intersecting the quad. But I'm not getting a true return value?
The one thing I don't understand about the Intersect.segmentAndQuad method
is the dist[0] array parameter. I've set it up as double[] dist = {1.0}; but
that's just a guess. Why is this an array, and what does it represent?
Acording to the docs, I have to know the point of intersection. If I knew
the point of intersection, I wouldn't need to do any of this, see below:
segmentAndQuad
[snip]
Parameters:
segment - The segment to use in the intersection test.
coordinates - An array holding the quadrilateral data.
index - An array index that designates the starting position in the
array of the quadrilateral to test.
dist[0] - The distance between the start of the segment and the
point of intersection, if it exists. The dist array should be allocated by
the user.
Returns:
true if the segment intersects the quad, false if the segment does
not intersect the object.
Don Casteel
Manufacturing Engineer
TEXTRON Automotive Company -- Athens Operations
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Voice: (423)744-1109
Fax: (423)744-1112
Pager: (423)744-1129 -- 109
Internet: [EMAIL PROTECTED]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".