Corrected bug in IntersectionBoxRay() and some undeclared variable errors.
This commit is contained in:
parent
bcd64129e2
commit
123fd375a6
|
@ -24,6 +24,9 @@
|
||||||
History
|
History
|
||||||
|
|
||||||
$Log: not supported by cvs2svn $
|
$Log: not supported by cvs2svn $
|
||||||
|
Revision 1.1 2005/09/22 13:02:44 m_di_benedetto
|
||||||
|
First Commit.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
@ -70,6 +73,8 @@ public:
|
||||||
rayex.sign[1] = (rayex.invDirection[1] < ((ScalarType)0)) ? (1) : (0);
|
rayex.sign[1] = (rayex.invDirection[1] < ((ScalarType)0)) ? (1) : (0);
|
||||||
rayex.sign[2] = (rayex.invDirection[2] < ((ScalarType)0)) ? (1) : (0);
|
rayex.sign[2] = (rayex.invDirection[2] < ((ScalarType)0)) ? (1) : (0);
|
||||||
|
|
||||||
|
ObjPtr closestObj = 0;
|
||||||
|
|
||||||
ClassType::DepthFirstRayIsect(pRoot, rayIntersection, rayex, rayT, pRes, closestObj);
|
ClassType::DepthFirstRayIsect(pRoot, rayIntersection, rayex, rayT, pRes, closestObj);
|
||||||
|
|
||||||
if (closestObj == 0) {
|
if (closestObj == 0) {
|
||||||
|
@ -77,7 +82,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
t = rayT;
|
t = rayT;
|
||||||
res = pRes;
|
q = pRes;
|
||||||
|
|
||||||
return (closestObj);
|
return (closestObj);
|
||||||
}
|
}
|
||||||
|
@ -111,8 +116,7 @@ protected:
|
||||||
if ((tmin > tcmax) || (tcmin > tmax)) { return (false); }
|
if ((tmin > tcmax) || (tcmin > tmax)) { return (false); }
|
||||||
if (tcmin > tmin) { tmin = tcmin; }
|
if (tcmin > tmin) { tmin = tcmin; }
|
||||||
if (tcmax < tmax) { tmax = tcmax; }
|
if (tcmax < tmax) { tmax = tcmax; }
|
||||||
if (tmin < ((ScalarType)0)) { return (false); }
|
t0 = (tmin >= ((ScalarType)0)) ? (tmin) :((ScalarType)0);
|
||||||
t0 = tmin;
|
|
||||||
return (true);
|
return (true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -130,6 +134,8 @@ protected:
|
||||||
|
|
||||||
if (node->IsLeaf()) {
|
if (node->IsLeaf()) {
|
||||||
ObjPtr cObj = 0;
|
ObjPtr cObj = 0;
|
||||||
|
ScalarType ar;
|
||||||
|
CoordType ap;
|
||||||
rt = std::numeric_limits<ScalarType>::max();
|
rt = std::numeric_limits<ScalarType>::max();
|
||||||
for (typename TreeType::ObjPtrVectorConstIterator si=node->oBegin; si!=node->oEnd; ++si) {
|
for (typename TreeType::ObjPtrVectorConstIterator si=node->oBegin; si!=node->oEnd; ++si) {
|
||||||
if (rayIntersection(*(*si), ray.origin, ray.direction, ar, ap)) {
|
if (rayIntersection(*(*si), ray.origin, ray.direction, ar, ap)) {
|
||||||
|
|
Loading…
Reference in New Issue