diff options
| author | git perforce import user <a@b> | 2016-10-25 12:29:14 -0600 |
|---|---|---|
| committer | Sheikh Dawood Abdul Ajees <Sheikh Dawood Abdul Ajees> | 2016-10-25 18:56:37 -0500 |
| commit | 3dfe2108cfab31ba3ee5527e217d0d8e99a51162 (patch) | |
| tree | fa6485c169e50d7415a651bf838f5bcd0fd3bfbd /APEX_1.4/include/iofx/RenderVolume.h | |
| download | physx-3.4-3dfe2108cfab31ba3ee5527e217d0d8e99a51162.tar.xz physx-3.4-3dfe2108cfab31ba3ee5527e217d0d8e99a51162.zip | |
Initial commit:
PhysX 3.4.0 Update @ 21294896
APEX 1.4.0 Update @ 21275617
[CL 21300167]
Diffstat (limited to 'APEX_1.4/include/iofx/RenderVolume.h')
| -rw-r--r-- | APEX_1.4/include/iofx/RenderVolume.h | 110 |
1 files changed, 110 insertions, 0 deletions
diff --git a/APEX_1.4/include/iofx/RenderVolume.h b/APEX_1.4/include/iofx/RenderVolume.h new file mode 100644 index 00000000..c44eeb4f --- /dev/null +++ b/APEX_1.4/include/iofx/RenderVolume.h @@ -0,0 +1,110 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + + +#ifndef RENDER_VOLUME_H +#define RENDER_VOLUME_H + +#include "Apex.h" + +namespace nvidia +{ +namespace apex +{ + +PX_PUSH_PACK_DEFAULT + +class IofxAsset; +class IofxActor; + +/** + \brief An object which "owns" a volume of world space. + + Any particles which enter the + owned volume will be migrated to an IOFX actor owned by this object (if the + particle's IOFX asset is affected by this volume). + + When volumes overlap, their relative priorities break the tie. If multiple volumes + have the same priority, the tie breaker goes to the volume that owns the particle. + */ +class RenderVolume : public ApexInterface +{ +public: + /// Returns AABB covering all objects in this render volume, it's updated each frame during Scene::fetchResults(). + virtual physx::PxBounds3 getBounds() const = 0; + + /// Returns true if the volume affects all IOFX assets + virtual bool getAffectsAllIofx() const = 0; + + /// Adds IOFX asset to volume's list of affected IOFX assets, returns false on failure + virtual bool addIofxAsset(IofxAsset& iofx) = 0; + + /// Moves the render volume while maintaining its dimensions + virtual void setPosition(const PxVec3& pos) = 0; + + /// Directly assigns a new AABB ownership volume + virtual void setOwnershipBounds(const PxBounds3& b) = 0; + + /// Retrieves the configured AABB bounds of the volume. Call getBounds() for the "live" bounds. + virtual PxBounds3 getOwnershipBounds() const = 0; + + /** \brief Retrieve list of IOFX actors owned by this volume (one per IOFX Asset per IOS actor) + * + * Returns count of 0 if empty. Returned pointer is undefined when count is 0. + * + * The bounds of each of these IOFX is guaranteed to be within the bounds of the volume itself. + * Calling the updateRenderResources and dispatchRenderResources() methods of the volume will + * implicitly call the same methods of each of these IOFX actors, so there is no need to iterate + * over them for rendering purposes, unless you require special logic per IOFX. + * + * It is not necessary to release these actors, they will be released automatically when their + * volume, their IOFX Asset, or their host IOS actor are released. + * + * This call is not thread-safe. The returned buffer is only valid until the next APEX API + * call that steps the simulation or modifies the number of IOFX actors in a scene. + */ + virtual IofxActor* const* lockIofxActorList(uint32_t& count) = 0; + + /** + \brief Unlock IOFX actors which where locked by calling lockIofxActorList + \see RenderVolume::lockIofxActorList + */ + virtual void unlockIofxActorList() = 0; + + /** \brief Retrieve list of volume's affected IOFX assets. + * + * Returns count of 0 if empty or volume affects all IOFX assets. Returned pointer is + * undefined when count is 0. + * + * The returned buffer not thread-safe, and is only valid until the next APEX API + * call that steps the simulation or modifies the number of IOFX assets in a scene. + */ + virtual IofxAsset* const* getIofxAssetList(uint32_t& count) const = 0; + + virtual PxVec3 getPosition() const = 0; ///< Returns center of ownership bounds + virtual uint32_t getPriority() const = 0; ///< Returns priority of volume + + /** \brief Returns true if this volume affects the specified IOFX asset + * + * Callers must acquire render lock of the volume before calling + * this function, for thread safety. + */ + virtual bool affectsIofxAsset(const IofxAsset& iofx) const = 0; + +protected: + virtual ~RenderVolume() {} +}; + +PX_POP_PACK + +} +} // namespace nvidia + +#endif // RENDER_VOLUME_H |