aboutsummaryrefslogtreecommitdiff
path: root/PhysX_3.4/Include
diff options
context:
space:
mode:
authorSheikh Dawood <[email protected]>2018-04-09 10:13:48 -0500
committerSheikh Dawood <[email protected]>2018-04-09 10:13:48 -0500
commit238605d8225a9135d6b60646e05d066e25424eee (patch)
tree2b013bd4946bb3c699d7a06ef1f21be85d367f63 /PhysX_3.4/Include
parentAdd ParamTool.exe (diff)
downloadphysx-3.4-238605d8225a9135d6b60646e05d066e25424eee.tar.xz
physx-3.4-238605d8225a9135d6b60646e05d066e25424eee.zip
PhysX 3.4, APEX 1.4 patch release @23879214
Diffstat (limited to 'PhysX_3.4/Include')
-rw-r--r--PhysX_3.4/Include/PxScene.h61
-rw-r--r--PhysX_3.4/Include/PxSceneDesc.h45
-rw-r--r--PhysX_3.4/Include/cooking/PxCooking.h6
-rw-r--r--PhysX_3.4/Include/pvd/PxPvdSceneClient.h12
4 files changed, 115 insertions, 9 deletions
diff --git a/PhysX_3.4/Include/PxScene.h b/PhysX_3.4/Include/PxScene.h
index 5e477cb1..d9aa843d 100644
--- a/PhysX_3.4/Include/PxScene.h
+++ b/PhysX_3.4/Include/PxScene.h
@@ -1419,6 +1419,67 @@ class PxScene
virtual void forceDynamicTreeRebuild(bool rebuildStaticStructure, bool rebuildDynamicStructure) = 0;
/**
+ \brief Sets scene query update mode
+
+ \param[in] updateMode Scene query update mode.
+
+ @see PxSceneQueryUpdateMode::Enum
+ */
+ virtual void setSceneQueryUpdateMode(PxSceneQueryUpdateMode::Enum updateMode) = 0;
+
+ /**
+ \brief Gets scene query update mode
+
+ \return Current scene query update mode.
+
+ @see PxSceneQueryUpdateMode::Enum
+ */
+ virtual PxSceneQueryUpdateMode::Enum getSceneQueryUpdateMode() const = 0;
+
+ /**
+ \brief Executes scene queries update tasks.
+ This function will refit dirty shapes within the pruner and will execute a task to build a new AABB tree, which is
+ build on a different thread. The new AABB tree is built based on the dynamic tree rebuild hint rate. Once
+ the new tree is ready it will be commited in next fetchQueries call, which must be called after.
+
+ \note If PxSceneQueryUpdateMode::eBUILD_DISABLED_COMMIT_DISABLED is used, it is required to update the scene queries
+ using this function.
+
+ \param[in] completionTask if non-NULL, this task will have its refcount incremented in sceneQueryUpdate(), then
+ decremented when the scene is ready to have fetchQueries called. So the task will not run until the
+ application also calls removeReference().
+ \param[in] controlSimulation if true, the scene controls its PxTaskManager simulation state. Leave
+ true unless the application is calling the PxTaskManager start/stopSimulation() methods itself.
+
+ @see PxSceneQueryUpdateMode::eBUILD_DISABLED_COMMIT_DISABLED
+ */
+ virtual void sceneQueriesUpdate(physx::PxBaseTask* completionTask = NULL, bool controlSimulation = true) = 0;
+
+ /**
+ \brief This checks to see if the scene queries update has completed.
+
+ This does not cause the data available for reading to be updated with the results of the scene queries update, it is simply a status check.
+ The bool will allow it to either return immediately or block waiting for the condition to be met so that it can return true
+
+ \param[in] block When set to true will block until the condition is met.
+ \return True if the results are available.
+
+ @see sceneQueriesUpdate() fetchResults()
+ */
+ virtual bool checkQueries(bool block = false) = 0;
+
+ /**
+ This method must be called after sceneQueriesUpdate. It will wait for the scene queries update to finish. If the user makes an illegal scene queries update call,
+ the SDK will issue an error message.
+
+ If a new AABB tree build finished, then during fetchQueries the current tree within the pruning structure is swapped with the new tree.
+
+ \param[in] block When set to true will block until the condition is met, which is tree built task must finish running.
+ */
+
+ virtual bool fetchQueries(bool block = false) = 0;
+
+ /**
\brief Performs a raycast against objects in the scene, returns results in a PxRaycastBuffer object
or via a custom user callback implementation inheriting from PxRaycastCallback.
diff --git a/PhysX_3.4/Include/PxSceneDesc.h b/PhysX_3.4/Include/PxSceneDesc.h
index bef93829..0ddac008 100644
--- a/PhysX_3.4/Include/PxSceneDesc.h
+++ b/PhysX_3.4/Include/PxSceneDesc.h
@@ -76,6 +76,35 @@ struct PxPruningStructureType
};
};
+/**
+\brief Scene query update mode
+
+When PxScene::fetchResults is called it does scene query related work, with this enum it is possible to
+set what work is done during the fetchResults.
+
+FetchResults will sync changed bounds during simulation and update the scene query bounds in pruners, this work is mandatory.
+
+eCOMMIT_ENABLED_BUILD_ENABLED does allow to execute the new AABB tree build step during fetchResults, additionally the pruner commit is
+called where any changes are applied. During commit PhysX refits the dynamic scene query tree and if a new tree was built and
+the build finished the tree is swapped with current AABB tree.
+
+eCOMMIT_DISABLED_BUILD_ENABLED does allow to execute the new AABB tree build step during fetchResults. Pruner commit is not called,
+this means that refit will then occur during the first scene query following fetchResults, or may be forced by the method PxScene::flushSceneQueryUpdates().
+
+eCOMMIT_DISABLED_BUILD_DISABLED no further scene query work is executed. The scene queries update needs to be called manually, see PxScene::sceneQueriesUpdate.
+It is recommended to call PxScene::sceneQueriesUpdate right after fetchResults as the pruning structures are not updated.
+
+*/
+struct PxSceneQueryUpdateMode
+{
+ enum Enum
+ {
+ eBUILD_ENABLED_COMMIT_ENABLED, //!< Both scene query build and commit are executed.
+ eBUILD_ENABLED_COMMIT_DISABLED, //!< Scene query build only is executed.
+ eBUILD_DISABLED_COMMIT_DISABLED //!< No work is done, no update of scene queries
+ };
+};
+
/**
\brief Enum for selecting the friction algorithm used for simulation.
@@ -317,12 +346,16 @@ struct PxSceneFlag
creation suppresses this behavior. Refit will then occur during the first scene query following fetchResults,
or may be forced by the method PxScene::flushSceneQueryUpdates()
+ \note Deprecated, will be replaced with an enum in next releases.
+ \note This flag will be ignored if PxSceneDesc::sceneQueryUpdateMode is set.
+ \note This flag is not used anymore, please use PxSceneQueryUpdateMode::Enum instead
+
@see PxScene::flushSceneQueryUpdates()
<b>Default:</b> false
*/
- eSUPPRESS_EAGER_SCENE_QUERY_REFIT = (1 << 18),
+ eSUPPRESS_EAGER_SCENE_QUERY_REFIT PX_DEPRECATED = (1 << 18),
/*\brief Enables the GPU dynamics pipeline
@@ -708,6 +741,15 @@ public:
PxU32 dynamicTreeRebuildRateHint;
/**
+ \brief Defines the scene query update mode.
+
+ \note Setting a value other than the default will result in ignoring the deprecated PxSceneFlag::eSUPPRESS_EAGER_SCENE_QUERY_REFIT
+
+ <b>Default:</b> PxSceneQueryUpdateMode::eBUILD_ENABLED_COMMIT_ENABLED
+ */
+ PxSceneQueryUpdateMode::Enum sceneQueryUpdateMode;
+
+ /**
\brief Will be copied to PxScene::userData.
<b>Default:</b> NULL
@@ -926,6 +968,7 @@ PX_INLINE PxSceneDesc::PxSceneDesc(const PxTolerancesScale& scale):
staticStructure (PxPruningStructureType::eDYNAMIC_AABB_TREE),
dynamicStructure (PxPruningStructureType::eDYNAMIC_AABB_TREE),
dynamicTreeRebuildRateHint (100),
+ sceneQueryUpdateMode (PxSceneQueryUpdateMode::eBUILD_ENABLED_COMMIT_ENABLED),
userData (NULL),
diff --git a/PhysX_3.4/Include/cooking/PxCooking.h b/PhysX_3.4/Include/cooking/PxCooking.h
index 05fa3f7d..6b89930b 100644
--- a/PhysX_3.4/Include/cooking/PxCooking.h
+++ b/PhysX_3.4/Include/cooking/PxCooking.h
@@ -488,11 +488,12 @@ public:
\param[in] desc The triangle mesh descriptor to read the mesh from.
\param[in] insertionCallback The insertion interface from PxPhysics.
+ \param[out] condition Result from triangle mesh cooking.
\return PxTriangleMesh pointer on success.
@see cookTriangleMesh() setParams() PxPhysics.createTriangleMesh() PxPhysicsInsertionCallback
*/
- virtual PxTriangleMesh* createTriangleMesh(const PxTriangleMeshDesc& desc, PxPhysicsInsertionCallback& insertionCallback) const = 0;
+ virtual PxTriangleMesh* createTriangleMesh(const PxTriangleMeshDesc& desc, PxPhysicsInsertionCallback& insertionCallback, PxTriangleMeshCookingResult::Enum* condition = NULL) const = 0;
/**
\brief Verifies if the triangle mesh is valid. Prints an error message for each inconsistency found.
@@ -544,11 +545,12 @@ public:
\param[in] desc The convex mesh descriptor to read the mesh from.
\param[in] insertionCallback The insertion interface from PxPhysics.
+ \param[out] condition Result from convex mesh cooking.
\return PxConvexMesh pointer on success
@see cookConvexMesh() setParams() PxPhysicsInsertionCallback
*/
- virtual PxConvexMesh* createConvexMesh(const PxConvexMeshDesc& desc, PxPhysicsInsertionCallback& insertionCallback) const = 0;
+ virtual PxConvexMesh* createConvexMesh(const PxConvexMeshDesc& desc, PxPhysicsInsertionCallback& insertionCallback, PxConvexMeshCookingResult::Enum* condition = NULL) const = 0;
/**
\brief Verifies if the convex mesh is valid. Prints an error message for each inconsistency found.
diff --git a/PhysX_3.4/Include/pvd/PxPvdSceneClient.h b/PhysX_3.4/Include/pvd/PxPvdSceneClient.h
index fa11c87b..c504536c 100644
--- a/PhysX_3.4/Include/pvd/PxPvdSceneClient.h
+++ b/PhysX_3.4/Include/pvd/PxPvdSceneClient.h
@@ -40,7 +40,7 @@ namespace physx
{
namespace pvdsdk
{
- class PvdClient;
+ class PvdClient;
struct PvdDebugPoint;
struct PvdDebugLine;
struct PvdDebugTriangle;
@@ -101,27 +101,27 @@ class PxPvdSceneClient
virtual PxPvdSceneFlags getScenePvdFlags() const = 0;
/**
- update camera on PVD application's DirectX render window
+ update camera on PVD application's render window
*/
virtual void updateCamera(const char* name, const PxVec3& origin, const PxVec3& up, const PxVec3& target) = 0;
/**
- draw points on PVD application's DirectX render window
+ draw points on PVD application's render window
*/
virtual void drawPoints(const physx::pvdsdk::PvdDebugPoint* points, PxU32 count) = 0;
/**
- draw lines on PVD application's DirectX render window
+ draw lines on PVD application's render window
*/
virtual void drawLines(const physx::pvdsdk::PvdDebugLine* lines, PxU32 count) = 0;
/**
- draw triangles on PVD application's DirectX render window
+ draw triangles on PVD application's render window
*/
virtual void drawTriangles(const physx::pvdsdk::PvdDebugTriangle* triangles, PxU32 count) = 0;
/**
- draw text on PVD application's DirectX render window
+ draw text on PVD application's render window
*/
virtual void drawText(const physx::pvdsdk::PvdDebugText& text) = 0;