sdk/extensions/physx/include/NvBlastExtPxManager.h

Go to the documentation of this file.
00001 // This code contains NVIDIA Confidential Information and is disclosed to you
00002 // under a form of NVIDIA software license agreement provided separately to you.
00003 //
00004 // Notice
00005 // NVIDIA Corporation and its licensors retain all intellectual property and
00006 // proprietary rights in and to this software and related documentation and
00007 // any modifications thereto. Any use, reproduction, disclosure, or
00008 // distribution of this software and related documentation without an express
00009 // license agreement from NVIDIA Corporation is strictly prohibited.
00010 //
00011 // ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES
00012 // NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
00013 // THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT,
00014 // MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.
00015 //
00016 // Information and code furnished is believed to be accurate and reliable.
00017 // However, NVIDIA Corporation assumes no responsibility for the consequences of use of such
00018 // information or for any infringement of patents or other rights of third parties that may
00019 // result from its use. No license is granted by implication or otherwise under any patent
00020 // or patent rights of NVIDIA Corporation. Details are subject to change without notice.
00021 // This code supersedes and replaces all information previously supplied.
00022 // NVIDIA Corporation products are not authorized for use as critical
00023 // components in life support devices or systems without express written approval of
00024 // NVIDIA Corporation.
00025 //
00026 // Copyright (c) 2016-2018 NVIDIA Corporation. All rights reserved.
00027 
00028 
00029 #ifndef NVBLASTEXTPXMANAGER_H
00030 #define NVBLASTEXTPXMANAGER_H
00031 
00032 #include "NvBlastTypes.h"
00033 #include "PxConvexMeshGeometry.h"
00034 #include "PxTransform.h"
00035 #include "NvPreprocessor.h"
00036 
00037 
00038 // Forward declarations
00039 namespace physx
00040 {
00041 class PxPhysics;
00042 class PxRigidDynamic;
00043 class PxJoint;
00044 
00045 namespace general_PxIOStream2
00046 {
00047 class PxFileBuf;
00048 }
00049 }
00050 
00051 
00052 namespace Nv
00053 {
00054 namespace Blast
00055 {
00056 
00057 // Forward declarations
00058 class ExtPxActor;
00059 class ExtPxAsset;
00060 class ExtPxFamily;
00061 class ExtPxListener;
00062 class TkFamily;
00063 class TkFramework;
00064 class TkGroup;
00065 class TkJoint;
00066 
00067 
00073 struct ExtPxFamilyDesc
00074 {
00075     ExtPxAsset*             pxAsset;        
00076     const NvBlastActorDesc* actorDesc;      
00077     TkGroup*                group;          
00078 };
00079 
00080 
00086 typedef physx::PxJoint*(*ExtPxCreateJointFunction)(ExtPxActor* actor0, const physx::PxTransform& localFrame0, ExtPxActor* actor1, const physx::PxTransform& localFrame1, physx::PxPhysics& physics, TkJoint& joint);
00087 
00088 
00094 class NV_DLL_EXPORT ExtPxManager
00095 {
00096 public:
00098 
00110     static ExtPxManager*        create(physx::PxPhysics& physics, TkFramework& framework, ExtPxCreateJointFunction createFn = nullptr, bool useUserData = true);
00111 
00115     virtual void                release() = 0;
00116 
00117 
00119 
00123     enum FilterDataAttributes
00124     {
00125         LEAF_CHUNK = 1,
00126     };
00127 
00128 
00130 
00138     virtual ExtPxFamily*        createFamily(const ExtPxFamilyDesc& desc) = 0;
00139 
00150     virtual bool                createJoint(TkJoint& joint) = 0;
00151 
00157     virtual void                destroyJoint(TkJoint& joint) = 0;
00158 
00164     virtual void                setCreateJointFunction(ExtPxCreateJointFunction createFn) = 0;
00165 
00171     virtual uint32_t            getFamilyCount() const = 0;
00172 
00181     virtual uint32_t            getFamilies(ExtPxFamily** buffer, uint32_t bufferSize) const = 0;
00182 
00190     virtual ExtPxFamily*        getFamilyFromTkFamily(TkFamily& family) const = 0;
00191 
00199     virtual ExtPxActor*         getActorFromPhysXActor(const physx::PxRigidDynamic& pxActor) const = 0;
00200 
00206     virtual physx::PxPhysics&   getPhysics() const = 0;
00207 
00213     virtual TkFramework&        getFramework() const = 0;
00214 
00220     virtual bool                isPxUserDataUsed() const = 0;
00221 
00227     virtual void                setActorCountLimit(uint32_t limit) = 0;
00228 
00234     virtual uint32_t            getActorCountLimit() = 0;
00235 
00241     virtual uint32_t            getPxActorCount() const = 0;
00242 
00248     virtual void                subscribe(ExtPxListener& listener) = 0;
00249 
00255     virtual void                unsubscribe(ExtPxListener& listener) = 0;
00256 };
00257 
00258 
00259 } // namespace Blast
00260 } // namespace Nv
00261 
00262 
00263 #endif // ifndef NVBLASTEXTPXMANAGER_H