aboutsummaryrefslogtreecommitdiff
path: root/PhysX_3.4/Source/GeomUtils/src
diff options
context:
space:
mode:
authorSheikh Dawood Abdul Ajees <[email protected]>2017-04-25 16:02:08 -0500
committerSheikh Dawood Abdul Ajees <[email protected]>2017-04-25 16:02:08 -0500
commitd11708e398c2f6377d9eac2b1f7248c62faab569 (patch)
tree5778e794690c046ab4b0205d8f764960a5af168b /PhysX_3.4/Source/GeomUtils/src
parentPhysX 3.4, APEX 1.4 patch release @21821222 (diff)
downloadphysx-3.4-d11708e398c2f6377d9eac2b1f7248c62faab569.tar.xz
physx-3.4-d11708e398c2f6377d9eac2b1f7248c62faab569.zip
PhysX 3.4, APEX 1.4 patch release @22017166
Diffstat (limited to 'PhysX_3.4/Source/GeomUtils/src')
-rw-r--r--PhysX_3.4/Source/GeomUtils/src/ccd/GuCCDSweepConvexMesh.cpp4
-rw-r--r--PhysX_3.4/Source/GeomUtils/src/convex/GuHillClimbing.cpp2
-rw-r--r--PhysX_3.4/Source/GeomUtils/src/mesh/GuBV4.cpp14
-rw-r--r--PhysX_3.4/Source/GeomUtils/src/mesh/GuMidphaseRTree.cpp1
-rw-r--r--PhysX_3.4/Source/GeomUtils/src/mesh/GuRTree.h24
-rw-r--r--PhysX_3.4/Source/GeomUtils/src/mesh/GuRTreeQueries.cpp8
6 files changed, 28 insertions, 25 deletions
diff --git a/PhysX_3.4/Source/GeomUtils/src/ccd/GuCCDSweepConvexMesh.cpp b/PhysX_3.4/Source/GeomUtils/src/ccd/GuCCDSweepConvexMesh.cpp
index 17965753..6e910f84 100644
--- a/PhysX_3.4/Source/GeomUtils/src/ccd/GuCCDSweepConvexMesh.cpp
+++ b/PhysX_3.4/Source/GeomUtils/src/ccd/GuCCDSweepConvexMesh.cpp
@@ -610,7 +610,7 @@ PxReal SweepAnyShapeMesh(GU_SWEEP_METHOD_ARGS)
}
}
PX_ASSERT(PxIsFinite(res));
- resultNormal = convexPartOfMesh1.getPolygonNormal(0);
+ resultNormal = transform1.rotate(convexPartOfMesh1.getPolygonNormal(0));
}
if (res < minTOI)
@@ -623,7 +623,7 @@ PxReal SweepAnyShapeMesh(GU_SWEEP_METHOD_ARGS)
}
- worldNormal = transform1.rotate(tempWorldNormal);
+ worldNormal = tempWorldNormal;//transform1.rotate(tempWorldNormal);
worldPoint = tempWorldPoint;
outCCDFaceIndex = ccdFaceIndex;
return minTOI;
diff --git a/PhysX_3.4/Source/GeomUtils/src/convex/GuHillClimbing.cpp b/PhysX_3.4/Source/GeomUtils/src/convex/GuHillClimbing.cpp
index 2e3a4d02..9bd56fe7 100644
--- a/PhysX_3.4/Source/GeomUtils/src/convex/GuHillClimbing.cpp
+++ b/PhysX_3.4/Source/GeomUtils/src/convex/GuHillClimbing.cpp
@@ -42,7 +42,7 @@ void localSearch(PxU32& id, const PxVec3& dir, const PxVec3* verts, const Gu::Bi
// WARNING: there is a problem on x86 with a naive version of this code, where truncation
// of values from 80 bits to 32 bits as they're stored in memory means that iteratively moving to
// an adjacent vertex of greater support can go into an infinite loop. So we use a version which
- // never vists a version twice. Note - this might not be enough for GJK, since local
+ // never visits a vertex twice. Note - this might not be enough for GJK, since local
// termination of the support function might not be enough to ensure convergence of GJK itself.
// if we got here, we'd better have vertices and valencies
diff --git a/PhysX_3.4/Source/GeomUtils/src/mesh/GuBV4.cpp b/PhysX_3.4/Source/GeomUtils/src/mesh/GuBV4.cpp
index 7b54c5bd..a4e90824 100644
--- a/PhysX_3.4/Source/GeomUtils/src/mesh/GuBV4.cpp
+++ b/PhysX_3.4/Source/GeomUtils/src/mesh/GuBV4.cpp
@@ -188,14 +188,20 @@ BV4Tree::BV4Tree(const PxEMPTY)
void BV4Tree::exportExtraData(PxSerializationContext& stream)
{
- stream.alignData(16);
- stream.writeData(mNodes, mNbNodes*sizeof(BVDataPacked));
+ if(mNbNodes)
+ {
+ stream.alignData(16);
+ stream.writeData(mNodes, mNbNodes*sizeof(BVDataPacked));
+ }
}
void BV4Tree::importExtraData(PxDeserializationContext& context)
{
- context.alignExtraData(16);
- mNodes = context.readExtraData<BVDataPacked>(mNbNodes);
+ if(mNbNodes)
+ {
+ context.alignExtraData(16);
+ mNodes = context.readExtraData<BVDataPacked>(mNbNodes);
+ }
}
//~PX_SERIALIZATION
diff --git a/PhysX_3.4/Source/GeomUtils/src/mesh/GuMidphaseRTree.cpp b/PhysX_3.4/Source/GeomUtils/src/mesh/GuMidphaseRTree.cpp
index 0f87e72e..2f923842 100644
--- a/PhysX_3.4/Source/GeomUtils/src/mesh/GuMidphaseRTree.cpp
+++ b/PhysX_3.4/Source/GeomUtils/src/mesh/GuMidphaseRTree.cpp
@@ -41,6 +41,7 @@
#include "GuIntersectionTriangleBox.h"
#include "GuSIMDHelpers.h"
#include "GuTriangleVertexPointers.h"
+#include "GuRTree.h"
#include "GuTriangleMeshRTree.h"
#include "GuInternal.h"
diff --git a/PhysX_3.4/Source/GeomUtils/src/mesh/GuRTree.h b/PhysX_3.4/Source/GeomUtils/src/mesh/GuRTree.h
index d6fbd435..19004952 100644
--- a/PhysX_3.4/Source/GeomUtils/src/mesh/GuRTree.h
+++ b/PhysX_3.4/Source/GeomUtils/src/mesh/GuRTree.h
@@ -170,8 +170,8 @@ namespace Gu {
void traverseOBB(
const Gu::Box& obb,
const PxU32 maxResultsPerBlock, PxU32* resultsBlockBuf, Callback* processResultsBlockCallback) const;
+
template <int inflate>
- //PX_PHYSX_COMMON_API
void traverseRay(
const PxVec3& rayOrigin, const PxVec3& rayDir, // dir doesn't have to be normalized and is B-A for raySegment
const PxU32 maxResults, PxU32* resultsPtr,
@@ -229,6 +229,15 @@ namespace Gu {
friend struct RTreePage;
} PX_ALIGN_SUFFIX(16);
+#if PX_SUPPORT_EXTERN_TEMPLATE
+ //explicit template instantiation declaration
+ extern template
+ void RTree::traverseRay<0>(const PxVec3&, const PxVec3&, const PxU32, PxU32*, Gu::RTree::CallbackRaycast*, const PxVec3*, PxF32) const;
+
+ extern template
+ void RTree::traverseRay<1>(const PxVec3&, const PxVec3&, const PxU32, PxU32*, Gu::RTree::CallbackRaycast*, const PxVec3*, PxF32) const;
+#endif
+
#if PX_VC
#pragma warning(pop)
#endif
@@ -253,19 +262,6 @@ namespace Gu {
}
}
- // explicit instantiations for traverseRay
- // XXX: dima: g++ 4.4 won't compile this => skipping by PX_UNIX_FAMILY
-#if PX_X86 && !PX_UNIX_FAMILY
- template
- //PX_PHYSX_COMMON_API
- void RTree::traverseRay<0>(
- const PxVec3&, const PxVec3&, const PxU32, PxU32*, Gu::RTree::CallbackRaycast*, const PxVec3*, PxF32 maxT) const;
- template
- //PX_PHYSX_COMMON_API
- void RTree::traverseRay<1>(
- const PxVec3&, const PxVec3&, const PxU32, PxU32*, Gu::RTree::CallbackRaycast*, const PxVec3*, PxF32 maxT) const;
-#endif
-
/////////////////////////////////////////////////////////////////////////
PX_FORCE_INLINE void RTreeNodeQ::setEmpty()
{
diff --git a/PhysX_3.4/Source/GeomUtils/src/mesh/GuRTreeQueries.cpp b/PhysX_3.4/Source/GeomUtils/src/mesh/GuRTreeQueries.cpp
index 08165685..cd97b4e2 100644
--- a/PhysX_3.4/Source/GeomUtils/src/mesh/GuRTreeQueries.cpp
+++ b/PhysX_3.4/Source/GeomUtils/src/mesh/GuRTreeQueries.cpp
@@ -319,10 +319,10 @@ void RTree::traverseRay(
}
}
-template void RTree::traverseRay<0>(
- const PxVec3&, const PxVec3&, const PxU32, PxU32*, Gu::RTree::CallbackRaycast*, const PxVec3*, PxF32 maxT) const;
-template void RTree::traverseRay<1>(
- const PxVec3&, const PxVec3&, const PxU32, PxU32*, Gu::RTree::CallbackRaycast*, const PxVec3*, PxF32 maxT) const;
+//explicit template instantiation
+template void RTree::traverseRay<0>(const PxVec3&, const PxVec3&, const PxU32, PxU32*, Gu::RTree::CallbackRaycast*, const PxVec3*, PxF32) const;
+
+template void RTree::traverseRay<1>(const PxVec3&, const PxVec3&, const PxU32, PxU32*, Gu::RTree::CallbackRaycast*, const PxVec3*, PxF32) const;
/////////////////////////////////////////////////////////////////////////
void RTree::traverseOBB(