aboutsummaryrefslogtreecommitdiff
path: root/PhysX_3.4/Source/GeomUtils
diff options
context:
space:
mode:
authorsschirm <[email protected]>2017-02-27 16:40:12 +0100
committersschirm <[email protected]>2017-03-01 18:04:26 +0100
commit7840347c32755e94a807f978f1cbb558717ac8cf (patch)
tree295cd3ca93a45f8fcc43cf3cbf3887c0e0c5526b /PhysX_3.4/Source/GeomUtils
parentPre-release comments marking end of beta. (diff)
downloadphysx-3.4-7840347c32755e94a807f978f1cbb558717ac8cf.tar.xz
physx-3.4-7840347c32755e94a807f978f1cbb558717ac8cf.zip
PhysX 3.4, APEX 1.4 final release @21757769v3.4.0-rc-2
Diffstat (limited to 'PhysX_3.4/Source/GeomUtils')
-rw-r--r--PhysX_3.4/Source/GeomUtils/headers/GuSIMDHelpers.h2
-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
5 files changed, 19 insertions, 12 deletions
diff --git a/PhysX_3.4/Source/GeomUtils/headers/GuSIMDHelpers.h b/PhysX_3.4/Source/GeomUtils/headers/GuSIMDHelpers.h
index db79a7bc..f8f7d3e9 100644
--- a/PhysX_3.4/Source/GeomUtils/headers/GuSIMDHelpers.h
+++ b/PhysX_3.4/Source/GeomUtils/headers/GuSIMDHelpers.h
@@ -72,7 +72,7 @@ namespace Gu
const QuatV qV = V4LoadU(&q.x);
Vec3V column0V, column1V, column2V;
QuatGetMat33V(qV, column0V, column1V, column2V);
-#if PX_ANDROID || (PX_LINUX && PX_ARM)
+#if defined(PX_SIMD_DISABLED) || PX_ANDROID || (PX_LINUX && (PX_ARM || PX_A64))
V3StoreU(column0V, column0);
V3StoreU(column1V, column1);
V3StoreU(column2V, column2);
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;