summaryrefslogtreecommitdiffhomepage
path: root/Opcode/OPC_RayTriOverlap.h
diff options
context:
space:
mode:
Diffstat (limited to 'Opcode/OPC_RayTriOverlap.h')
-rw-r--r--Opcode/OPC_RayTriOverlap.h20
1 files changed, 10 insertions, 10 deletions
diff --git a/Opcode/OPC_RayTriOverlap.h b/Opcode/OPC_RayTriOverlap.h
index 550effc..6991434 100644
--- a/Opcode/OPC_RayTriOverlap.h
+++ b/Opcode/OPC_RayTriOverlap.h
@@ -13,17 +13,17 @@
* \return true on overlap. mStabbedFace is filled with relevant info.
*/
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-inline_ BOOL RayCollider::RayTriOverlap(const Point& vert0, const Point& vert1, const Point& vert2)
+inline_ BOOL RayCollider::RayTriOverlap(const IcePoint& vert0, const IcePoint& vert1, const IcePoint& vert2)
{
// Stats
mNbRayPrimTests++;
// Find vectors for two edges sharing vert0
- Point edge1 = vert1 - vert0;
- Point edge2 = vert2 - vert0;
+ IcePoint edge1 = vert1 - vert0;
+ IcePoint edge2 = vert2 - vert0;
// Begin calculating determinant - also used to calculate U parameter
- Point pvec = mDir^edge2;
+ IcePoint pvec = mDir^edge2;
// If determinant is near zero, ray lies in plane of triangle
float det = edge1|pvec;
@@ -34,7 +34,7 @@ inline_ BOOL RayCollider::RayTriOverlap(const Point& vert0, const Point& vert1,
// From here, det is > 0. So we can use integer cmp.
// Calculate distance from vert0 to ray origin
- Point tvec = mOrigin - vert0;
+ IcePoint tvec = mOrigin - vert0;
// Calculate U parameter and test bounds
mStabbedFace.mU = tvec|pvec;
@@ -42,7 +42,7 @@ inline_ BOOL RayCollider::RayTriOverlap(const Point& vert0, const Point& vert1,
if(IS_NEGATIVE_FLOAT(mStabbedFace.mU) || IR(mStabbedFace.mU)>IR(det)) return FALSE;
// Prepare to test V parameter
- Point qvec = tvec^edge1;
+ IcePoint qvec = tvec^edge1;
// Calculate V parameter and test bounds
mStabbedFace.mV = mDir|qvec;
@@ -51,7 +51,7 @@ inline_ BOOL RayCollider::RayTriOverlap(const Point& vert0, const Point& vert1,
// Calculate t, scale parameters, ray intersects triangle
mStabbedFace.mDistance = edge2|qvec;
// Det > 0 so we can early exit here
- // Intersection point is valid if distance is positive (else it can just be a face behind the orig point)
+ // Intersection IcePoint is valid if distance is positive (else it can just be a face behind the orig IcePoint)
if(IS_NEGATIVE_FLOAT(mStabbedFace.mDistance)) return FALSE;
// Else go on
float OneOverDet = 1.0f / det;
@@ -66,7 +66,7 @@ inline_ BOOL RayCollider::RayTriOverlap(const Point& vert0, const Point& vert1,
float OneOverDet = 1.0f / det;
// Calculate distance from vert0 to ray origin
- Point tvec = mOrigin - vert0;
+ IcePoint tvec = mOrigin - vert0;
// Calculate U parameter and test bounds
mStabbedFace.mU = (tvec|pvec) * OneOverDet;
@@ -74,7 +74,7 @@ inline_ BOOL RayCollider::RayTriOverlap(const Point& vert0, const Point& vert1,
if(IS_NEGATIVE_FLOAT(mStabbedFace.mU) || IR(mStabbedFace.mU)>IEEE_1_0) return FALSE;
// prepare to test V parameter
- Point qvec = tvec^edge1;
+ IcePoint qvec = tvec^edge1;
// Calculate V parameter and test bounds
mStabbedFace.mV = (mDir|qvec) * OneOverDet;
@@ -82,7 +82,7 @@ inline_ BOOL RayCollider::RayTriOverlap(const Point& vert0, const Point& vert1,
// Calculate t, ray intersects triangle
mStabbedFace.mDistance = (edge2|qvec) * OneOverDet;
- // Intersection point is valid if distance is positive (else it can just be a face behind the orig point)
+ // Intersection IcePoint is valid if distance is positive (else it can just be a face behind the orig IcePoint)
if(IS_NEGATIVE_FLOAT(mStabbedFace.mDistance)) return FALSE;
}
return TRUE;