aboutsummaryrefslogtreecommitdiff
path: root/PhysX_3.4/Source/GeomUtils/src
diff options
context:
space:
mode:
Diffstat (limited to 'PhysX_3.4/Source/GeomUtils/src')
-rw-r--r--PhysX_3.4/Source/GeomUtils/src/GuMeshFactory.cpp6
-rw-r--r--PhysX_3.4/Source/GeomUtils/src/GuRaycastTests.cpp2
-rw-r--r--PhysX_3.4/Source/GeomUtils/src/mesh/GuMidphaseInterface.h18
-rw-r--r--PhysX_3.4/Source/GeomUtils/src/mesh/GuSweepsMesh.cpp3
4 files changed, 18 insertions, 11 deletions
diff --git a/PhysX_3.4/Source/GeomUtils/src/GuMeshFactory.cpp b/PhysX_3.4/Source/GeomUtils/src/GuMeshFactory.cpp
index 0ce25e11..838aeb2d 100644
--- a/PhysX_3.4/Source/GeomUtils/src/GuMeshFactory.cpp
+++ b/PhysX_3.4/Source/GeomUtils/src/GuMeshFactory.cpp
@@ -138,10 +138,12 @@ PxTriangleMesh* GuMeshFactory::createTriangleMesh(TriangleMeshData& data)
{
PX_NEW_SERIALIZED(np, RTreeTriangleMesh)(*this, data);
}
+#if !defined(PX_SIMD_DISABLED)
else if(data.mType==PxMeshMidPhase::eBVH34)
{
PX_NEW_SERIALIZED(np, BV4TriangleMesh)(*this, data);
}
+#endif
else return NULL;
if(np)
@@ -192,8 +194,10 @@ static TriangleMeshData* loadMeshData(PxInputStream& stream)
TriangleMeshData* data;
if(midphaseID==PxMeshMidPhase::eBVH33)
data = PX_NEW(RTreeTriangleData);
+#if !defined(PX_SIMD_DISABLED)
else if(midphaseID==PxMeshMidPhase::eBVH34)
data = PX_NEW(BV4TriangleData);
+#endif
else return NULL;
// Import mesh
@@ -329,6 +333,7 @@ static TriangleMeshData* loadMeshData(PxInputStream& stream)
return NULL;
}
}
+#if !defined(PX_SIMD_DISABLED)
else if(midphaseID==PxMeshMidPhase::eBVH34)
{
BV4TriangleData* bv4data = static_cast<BV4TriangleData*>(data);
@@ -347,6 +352,7 @@ static TriangleMeshData* loadMeshData(PxInputStream& stream)
bv4data->mMeshInterface.setPointers(reinterpret_cast<IndTri32*>(tris), NULL, verts);
bv4data->mBV4Tree.mMeshInterface = &bv4data->mMeshInterface;
}
+#endif
else PX_ASSERT(0);
// Import local bounds
diff --git a/PhysX_3.4/Source/GeomUtils/src/GuRaycastTests.cpp b/PhysX_3.4/Source/GeomUtils/src/GuRaycastTests.cpp
index e232288d..3cb1ad92 100644
--- a/PhysX_3.4/Source/GeomUtils/src/GuRaycastTests.cpp
+++ b/PhysX_3.4/Source/GeomUtils/src/GuRaycastTests.cpp
@@ -172,7 +172,7 @@ PxU32 raycast_capsule(GU_RAY_FUNC_PARAMS)
if(!intersectRayCapsule(rayOrigin, rayDir, capsule, t))
return 0;
- if(t>maxDist)
+ if(t<0.0f || t>maxDist)
return 0;
// PT: we can't avoid computing the position here since it's needed to compute the normal anyway
diff --git a/PhysX_3.4/Source/GeomUtils/src/mesh/GuMidphaseInterface.h b/PhysX_3.4/Source/GeomUtils/src/mesh/GuMidphaseInterface.h
index cb7ae145..515bab3a 100644
--- a/PhysX_3.4/Source/GeomUtils/src/mesh/GuMidphaseInterface.h
+++ b/PhysX_3.4/Source/GeomUtils/src/mesh/GuMidphaseInterface.h
@@ -181,7 +181,7 @@ namespace Midphase
}
}
- #if PX_INTEL_FAMILY
+ #if PX_INTEL_FAMILY && !defined(PX_SIMD_DISABLED)
#else
static PxU32 unsupportedMidphase( const TriangleMesh*, const PxTriangleMeshGeometry&, const PxTransform&,
const PxVec3&, const PxVec3&, PxReal,
@@ -222,7 +222,7 @@ namespace Midphase
static const MidphaseRaycastFunction gMidphaseRaycastTable[PxMeshMidPhase::eLAST] =
{
raycast_triangleMesh_RTREE,
- #if PX_INTEL_FAMILY
+ #if PX_INTEL_FAMILY && !defined(PX_SIMD_DISABLED)
raycast_triangleMesh_BV4,
#else
unsupportedMidphase,
@@ -232,7 +232,7 @@ namespace Midphase
static const MidphaseSphereOverlapFunction gMidphaseSphereOverlapTable[PxMeshMidPhase::eLAST] =
{
intersectSphereVsMesh_RTREE,
- #if PX_INTEL_FAMILY
+ #if PX_INTEL_FAMILY && !defined(PX_SIMD_DISABLED)
intersectSphereVsMesh_BV4,
#else
unsupportedSphereOverlapMidphase,
@@ -242,7 +242,7 @@ namespace Midphase
static const MidphaseBoxOverlapFunction gMidphaseBoxOverlapTable[PxMeshMidPhase::eLAST] =
{
intersectBoxVsMesh_RTREE,
- #if PX_INTEL_FAMILY
+ #if PX_INTEL_FAMILY && !defined(PX_SIMD_DISABLED)
intersectBoxVsMesh_BV4,
#else
unsupportedBoxOverlapMidphase,
@@ -252,7 +252,7 @@ namespace Midphase
static const MidphaseCapsuleOverlapFunction gMidphaseCapsuleOverlapTable[PxMeshMidPhase::eLAST] =
{
intersectCapsuleVsMesh_RTREE,
- #if PX_INTEL_FAMILY
+ #if PX_INTEL_FAMILY && !defined(PX_SIMD_DISABLED)
intersectCapsuleVsMesh_BV4,
#else
unsupportedCapsuleOverlapMidphase,
@@ -262,7 +262,7 @@ namespace Midphase
static const MidphaseBoxCBOverlapFunction gMidphaseBoxCBOverlapTable[PxMeshMidPhase::eLAST] =
{
intersectOBB_RTREE,
- #if PX_INTEL_FAMILY
+ #if PX_INTEL_FAMILY && !defined(PX_SIMD_DISABLED)
intersectOBB_BV4,
#else
unsupportedBoxCBOverlapMidphase,
@@ -272,7 +272,7 @@ namespace Midphase
static const MidphaseBoxSweepFunction gMidphaseBoxSweepTable[PxMeshMidPhase::eLAST] =
{
sweepBox_MeshGeom_RTREE,
- #if PX_INTEL_FAMILY
+ #if PX_INTEL_FAMILY && !defined(PX_SIMD_DISABLED)
sweepBox_MeshGeom_BV4,
#else
unsupportedBoxSweepMidphase,
@@ -282,7 +282,7 @@ namespace Midphase
static const MidphaseCapsuleSweepFunction gMidphaseCapsuleSweepTable[PxMeshMidPhase::eLAST] =
{
sweepCapsule_MeshGeom_RTREE,
- #if PX_INTEL_FAMILY
+ #if PX_INTEL_FAMILY && !defined(PX_SIMD_DISABLED)
sweepCapsule_MeshGeom_BV4,
#else
unsupportedCapsuleSweepMidphase,
@@ -292,7 +292,7 @@ namespace Midphase
static const MidphaseConvexSweepFunction gMidphaseConvexSweepTable[PxMeshMidPhase::eLAST] =
{
sweepConvex_MeshGeom_RTREE,
- #if PX_INTEL_FAMILY
+ #if PX_INTEL_FAMILY && !defined(PX_SIMD_DISABLED)
sweepConvex_MeshGeom_BV4,
#else
unsupportedConvexSweepMidphase,
diff --git a/PhysX_3.4/Source/GeomUtils/src/mesh/GuSweepsMesh.cpp b/PhysX_3.4/Source/GeomUtils/src/mesh/GuSweepsMesh.cpp
index 9f9f0543..131567d8 100644
--- a/PhysX_3.4/Source/GeomUtils/src/mesh/GuSweepsMesh.cpp
+++ b/PhysX_3.4/Source/GeomUtils/src/mesh/GuSweepsMesh.cpp
@@ -157,7 +157,8 @@ PxAgain SweepCapsuleMeshHitCallback::processHit( // all reported coords are in m
}
const PxReal alignmentValue = computeAlignmentValue(triNormal, mUnitDir);
- if(keepTriangle(localHit.distance, alignmentValue, mBestDist, mBestAlignmentValue, mTrueSweepDistance, distEpsilon))
+// if(keepTriangle(localHit.distance, alignmentValue, mBestDist, mBestAlignmentValue, mTrueSweepDistance, distEpsilon))
+ if(keepTriangle(localHit.distance, alignmentValue, mBestDist, mBestAlignmentValue, mTrueSweepDistance, GU_EPSILON_SAME_DISTANCE))
{
mBestAlignmentValue = alignmentValue;