aboutsummaryrefslogtreecommitdiff
path: root/PhysX_3.4/Source/PhysX/src
diff options
context:
space:
mode:
Diffstat (limited to 'PhysX_3.4/Source/PhysX/src')
-rw-r--r--PhysX_3.4/Source/PhysX/src/NpBatchQuery.cpp9
-rw-r--r--PhysX_3.4/Source/PhysX/src/NpPhysics.cpp8
2 files changed, 17 insertions, 0 deletions
diff --git a/PhysX_3.4/Source/PhysX/src/NpBatchQuery.cpp b/PhysX_3.4/Source/PhysX/src/NpBatchQuery.cpp
index 97fdaa0a..0ca62673 100644
--- a/PhysX_3.4/Source/PhysX/src/NpBatchQuery.cpp
+++ b/PhysX_3.4/Source/PhysX/src/NpBatchQuery.cpp
@@ -36,6 +36,7 @@
#include "PsFoundation.h"
#include "PsUtilities.h"
#include "NpScene.h"
+#include "PxGeometryQuery.h"
using namespace physx;
using namespace Sq;
@@ -523,6 +524,14 @@ void NpBatchQuery::sweep(
PX_CHECK_AND_RETURN(distance != 0.0f || !(hitFlags & PxHitFlag::eASSUME_NO_INITIAL_OVERLAP),
"Batch sweep input check: zero-length sweep only valid without the PxHitFlag::eASSUME_NO_INITIAL_OVERLAP flag");
+#if PX_CHECKED
+ if(!PxGeometryQuery::isValid(geometry))
+ {
+ Ps::getFoundation().error(PxErrorCode::eINVALID_PARAMETER, __FILE__, __LINE__, "Provided geometry is not valid");
+ return;
+ }
+#endif // PX_CHECKED
+
if (mNbSweeps >= mDesc.queryMemory.getMaxSweepsPerExecute())
{
PX_CHECK_AND_RETURN(mNbSweeps < mDesc.queryMemory.getMaxSweepsPerExecute(),
diff --git a/PhysX_3.4/Source/PhysX/src/NpPhysics.cpp b/PhysX_3.4/Source/PhysX/src/NpPhysics.cpp
index 01fe883d..57f7feeb 100644
--- a/PhysX_3.4/Source/PhysX/src/NpPhysics.cpp
+++ b/PhysX_3.4/Source/PhysX/src/NpPhysics.cpp
@@ -73,6 +73,10 @@
#include "NpCloth.h"
#endif
+#if PX_NX
+#include "nx/NpMiddlewareInfo.h"
+#endif
+
using namespace physx;
using namespace Cm;
@@ -228,6 +232,10 @@ NpPhysics* NpPhysics::createInstance(PxU32 version, PxFoundation& foundation, co
physx::pvdsdk::PsPvd* pvd)
{
PX_UNUSED(foundation);
+
+#if PX_NX
+ NpSetMiddlewareInfo(); // register middleware info such that PhysX usage can be tracked
+#endif
if (version!=PX_PHYSICS_VERSION)
{