diff options
| author | sschirm <[email protected]> | 2016-12-23 14:20:36 +0100 |
|---|---|---|
| committer | sschirm <[email protected]> | 2016-12-23 14:56:17 +0100 |
| commit | ef6937e69e8ee3f409cf9d460d5ad300a65d5924 (patch) | |
| tree | 710426e8daa605551ce3f34b581897011101c30f /PhysX_3.4/Source/SceneQuery/include | |
| parent | Initial commit: (diff) | |
| download | physx-3.4-ef6937e69e8ee3f409cf9d460d5ad300a65d5924.tar.xz physx-3.4-ef6937e69e8ee3f409cf9d460d5ad300a65d5924.zip | |
PhysX 3.4 / APEX 1.4 release candidate @21506124
Diffstat (limited to 'PhysX_3.4/Source/SceneQuery/include')
| -rw-r--r-- | PhysX_3.4/Source/SceneQuery/include/SqPruner.h | 39 | ||||
| -rw-r--r-- | PhysX_3.4/Source/SceneQuery/include/SqSceneQueryManager.h | 15 |
2 files changed, 27 insertions, 27 deletions
diff --git a/PhysX_3.4/Source/SceneQuery/include/SqPruner.h b/PhysX_3.4/Source/SceneQuery/include/SqPruner.h index 8a8bcbfa..78819cec 100644 --- a/PhysX_3.4/Source/SceneQuery/include/SqPruner.h +++ b/PhysX_3.4/Source/SceneQuery/include/SqPruner.h @@ -86,10 +86,10 @@ public: /** * \brief Adds objects to the pruner. * \param results [out] an array for resulting handles - * \param bounds [in] an array of bounds - * \param userData [in] an array of object data - * \param count [in] the number of objects in the arrays - * \param hasPruningStructure [in] if added objects have pruning structure. The structure will be merged later, adding the objects will not invalidate the pruner. + * \param bounds [in] an array of bounds. These bounds are used as-is so they should be pre-inflated if inflation is needed. + * \param userData [in] an array of object data + * \param count [in] the number of objects in the arrays + * \param hasPruningStructure [in] if added objects have pruning structure. The structure will be merged later, adding the objects will not invalidate the pruner. * * \return true if success, false if internal allocation failed. The first failing add results in a INVALID_PRUNERHANDLE. * @@ -99,38 +99,39 @@ public: * Objects and bounds in the arrays have the same number of elements and ordering. */ /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - virtual bool addObjects(PrunerHandle* results, const PxBounds3* bounds, const PrunerPayload* userData, PxU32 count = 1, bool hasPruningStructure = false) = 0; + virtual bool addObjects(PrunerHandle* results, const PxBounds3* bounds, const PrunerPayload* userData, PxU32 count, bool hasPruningStructure) = 0; /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /** * Removes objects from the pruner. * \param handles [in] the objects to remove - * \param count [in] the number of objects to remove + * \param count [in] the number of objects to remove */ /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - virtual void removeObjects(const PrunerHandle* handles, PxU32 count = 1) = 0; + virtual void removeObjects(const PrunerHandle* handles, PxU32 count) = 0; /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /** - * Updates objects with new bounds. + * Updates objects after manually updating their bounds via "getPayload" calls. * \param handles [in] the objects to update - * \param newBounds [in] updated bounds. Can be NULL if bounds have been written already through getPayload calls. - * \param count [in] the number of objects to update + * \param count [in] the number of objects to update */ /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - virtual void updateObjects(const PrunerHandle* handles, const PxBounds3* newBounds, PxU32 count = 1) = 0; + virtual void updateObjectsAfterManualBoundsUpdates(const PrunerHandle* handles, PxU32 count) = 0; /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /** - * Updates objects with new indexed bounds. - * \param handles [in] the objects to update - * \param indices [in] the indices of the bounds in the bounds array - * \param newBounds [in] updated bounds array - * \param count [in] the number of objects to update - */ + * Updates objects with new indexed bounds. + * \param handles [in] the objects to update + * \param indices [in] the indices of the bounds in the bounds array + * \param newBounds [in] updated bounds array + * \param count [in] the number of objects to update + * + * \warning THESE BOUNDS WILL BE INFLATED ON-THE-FLY. So this is inconsistent with the "addObjects" behavior. + * \warning The inflation value is hardcoded in Sq::inflateBounds(). + */ /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - virtual void updateObjects(const PrunerHandle* handles, const PxU32* indices, const PxBounds3* newBounds, PxU32 count = 1) = 0; - + virtual void updateObjectsAndInflateBounds(const PrunerHandle* handles, const PxU32* indices, const PxBounds3* newBounds, PxU32 count) = 0; /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /** diff --git a/PhysX_3.4/Source/SceneQuery/include/SqSceneQueryManager.h b/PhysX_3.4/Source/SceneQuery/include/SqSceneQueryManager.h index 4315a7fc..09e5dcdb 100644 --- a/PhysX_3.4/Source/SceneQuery/include/SqSceneQueryManager.h +++ b/PhysX_3.4/Source/SceneQuery/include/SqSceneQueryManager.h @@ -59,7 +59,6 @@ namespace Scb namespace Sc { class ActorCore; - struct SqBoundsSync; } namespace Sq @@ -78,7 +77,7 @@ namespace Sq PX_FORCE_INLINE const Sc::ActorCore& convertScbActor2Sc(const Scb::Actor& actor) const { return *Ps::pointerOffset<const Sc::ActorCore*>(&actor, scbToSc[actor.getScbType()]); } ptrdiff_t pxActorToScbActor[PxConcreteType::ePHYSX_CORE_COUNT]; - ptrdiff_t scbToSc[ScbType::TYPE_COUNT]; + ptrdiff_t scbToSc[ScbType::eTYPE_COUNT]; }; extern OffsetTable gOffsetTable; @@ -118,9 +117,9 @@ namespace Sq struct DynamicBoundsSync : public Sc::SqBoundsSync { - virtual void sync(const PxU32* sqRefs, const PxU32* indices, const PxBounds3* bounds, PxU32 count); - Pruner* mPruner; - PxU32 *mTimestamp; + virtual void sync(const PrunerHandle* handles, const PxU32* indices, const PxBounds3* bounds, PxU32 count); + Pruner* mPruner; + PxU32* mTimestamp; }; class SceneQueryManager : public Ps::UserAllocated @@ -179,9 +178,9 @@ namespace Sq // PT: TODO: replace PrunerData with just PxU32 to save memory on Win64. Breaks binary compatibility though. // PT: was previously called 'ActorShape' but does not contain an actor or shape pointer, contrary to the Np-level struct with the same name. // PT: it only contains a pruner index (0 or 1) and a pruner handle. Hence the new name. - PX_FORCE_INLINE PrunerData createPrunerData(PxU32 index, PrunerHandle h) { return size_t((h << 1) | index); } - PX_FORCE_INLINE PxU32 getPrunerIndex(PrunerData data) { return PxU32(data & 1); } - PX_FORCE_INLINE PrunerHandle getPrunerHandle(PrunerData data) { return PxU32(data >> 1); } + PX_FORCE_INLINE PrunerData createPrunerData(PxU32 index, PrunerHandle h) { return PrunerData((h << 1) | index); } + PX_FORCE_INLINE PxU32 getPrunerIndex(PrunerData data) { return PxU32(data & 1); } + PX_FORCE_INLINE PrunerHandle getPrunerHandle(PrunerData data) { return PrunerHandle(data >> 1); } /////////////////////////////////////////////////////////////////////////////// |