diff options
| author | Sheikh Dawood Abdul Ajees <[email protected]> | 2017-04-25 16:02:08 -0500 |
|---|---|---|
| committer | Sheikh Dawood Abdul Ajees <[email protected]> | 2017-04-25 16:02:08 -0500 |
| commit | d11708e398c2f6377d9eac2b1f7248c62faab569 (patch) | |
| tree | 5778e794690c046ab4b0205d8f764960a5af168b /PhysX_3.4/Source/GeomUtils/src/mesh | |
| parent | PhysX 3.4, APEX 1.4 patch release @21821222 (diff) | |
| download | physx-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/mesh')
4 files changed, 25 insertions, 22 deletions
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( |