aboutsummaryrefslogtreecommitdiff
path: root/PhysX_3.4/Source/GeomUtils/src/sweep
diff options
context:
space:
mode:
Diffstat (limited to 'PhysX_3.4/Source/GeomUtils/src/sweep')
-rw-r--r--PhysX_3.4/Source/GeomUtils/src/sweep/GuSweepCapsuleTriangle.cpp6
-rw-r--r--PhysX_3.4/Source/GeomUtils/src/sweep/GuSweepSphereCapsule.cpp2
-rw-r--r--PhysX_3.4/Source/GeomUtils/src/sweep/GuSweepSphereTriangle.cpp3
3 files changed, 10 insertions, 1 deletions
diff --git a/PhysX_3.4/Source/GeomUtils/src/sweep/GuSweepCapsuleTriangle.cpp b/PhysX_3.4/Source/GeomUtils/src/sweep/GuSweepCapsuleTriangle.cpp
index dc4ce4c2..26e0d101 100644
--- a/PhysX_3.4/Source/GeomUtils/src/sweep/GuSweepCapsuleTriangle.cpp
+++ b/PhysX_3.4/Source/GeomUtils/src/sweep/GuSweepCapsuleTriangle.cpp
@@ -140,7 +140,10 @@ bool Gu::sweepCapsuleTriangles_Precise( PxU32 nbTris, const PxTriangle* PX_RESTR
continue;
if(testInitialOverlap && intersectCapsuleTriangle(triNormal, currentTri.verts[0], currentTri.verts[1], currentTri.verts[2], capsule, params))
+ {
+ triNormalOut = -unitDir;
return setInitialOverlapResults(hit, unitDir, i);
+ }
const PxReal magnitude = triNormal.magnitude();
if(magnitude==0.0f)
@@ -211,7 +214,10 @@ bool Gu::sweepCapsuleTriangles_Precise( PxU32 nbTris, const PxTriangle* PX_RESTR
}
if(testInitialOverlap && intersectCapsuleTriangle(denormalizedNormal, currentSrcTri.verts[0], currentSrcTri.verts[1], currentSrcTri.verts[2], capsule, params))
+ {
+ triNormalOut = -unitDir;
return setInitialOverlapResults(hit, unitDir, i);
+ }
// Extrude mesh on the fly
PxU32 nbExtrudedTris=0;
diff --git a/PhysX_3.4/Source/GeomUtils/src/sweep/GuSweepSphereCapsule.cpp b/PhysX_3.4/Source/GeomUtils/src/sweep/GuSweepSphereCapsule.cpp
index aaf56990..02b9c018 100644
--- a/PhysX_3.4/Source/GeomUtils/src/sweep/GuSweepSphereCapsule.cpp
+++ b/PhysX_3.4/Source/GeomUtils/src/sweep/GuSweepSphereCapsule.cpp
@@ -69,7 +69,7 @@ bool Gu::sweepSphereCapsule(const Sphere& sphere, const Capsule& lss, const PxVe
Capsule Inflated(lss.p0, lss.p1, radiusSum);
// Raycast against it
- PxReal t;
+ PxReal t = 0.0f;
if(intersectRayCapsule(sphere.center, dir, Inflated, t))
{
if(t>=0.0f && t<=length)
diff --git a/PhysX_3.4/Source/GeomUtils/src/sweep/GuSweepSphereTriangle.cpp b/PhysX_3.4/Source/GeomUtils/src/sweep/GuSweepSphereTriangle.cpp
index abbf68b4..4ec6be61 100644
--- a/PhysX_3.4/Source/GeomUtils/src/sweep/GuSweepSphereTriangle.cpp
+++ b/PhysX_3.4/Source/GeomUtils/src/sweep/GuSweepSphereTriangle.cpp
@@ -326,7 +326,10 @@ bool Gu::sweepSphereTriangles( PxU32 nbTris, const PxTriangle* PX_RESTRICT trian
continue;
if(currentDistance==0.0f)
+ {
+ triNormalOut = -unitDir;
return setInitialOverlapResults(h, unitDir, i);
+ }
curT = currentDistance;
index = i;