Main Page Class List Class Members

# sdk/extensions/physx/include/NvBlastExtPxFamily.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-2020 NVIDIA Corporation. All rights reserved.
    00027
    00028
    00029 #ifndef NVBLASTEXTPXFAMILY_H
    00030 #define NVBLASTEXTPXFAMILY_H
    00031
    00032 #include "PxFiltering.h"
    00033
    00034
    00035 // Forward declarations
    00036 namespace physx
    00037 {
    00038 class PxRigidDynamic;
    00039 class PxMaterial;
    00040 class PxScene;
    00041 class PxTransform;
    00042 }
    00043
    00044 struct NvBlastExtMaterial;
    00045
    00046
    00047 namespace Nv
    00048 {
    00049 namespace Blast
    00050 {
    00051
    00052 // Forward declarations
    00053 class ExtPxActor;
    00054 class ExtPxAsset;
    00055 class ExtPxListener;
    00056 class TkFamily;
    00057
    00058
    00066 struct ExtPxShapeDescTemplate
    00067 {
    00068     uint8_t             flags;
    00069     physx::PxFilterData simulationFilterData;
    00070     physx::PxFilterData queryFilterData;
    00071     float               contactOffset;
    00072     float               restOffset;
    00073 };
    00074
    00075
    00081 struct ExtPxActorDescTemplate
    00082 {
    00083     uint8_t             flags;
    00084 };
    00085
    00086
    00092 struct ExtPxSpawnSettings
    00093 {
    00094     physx::PxScene*     scene;
    00095     physx::PxMaterial*  material;
    00096     float               density;
    00097 };
    00098
    00099
    00105 class ExtPxFamily
    00106 {
    00107 public:
    00117     virtual bool                            spawn(const physx::PxTransform& pose, const physx::PxVec3& scale, const ExtPxSpawnSettings& settings) = 0;
    00118
    00119
    00128     virtual bool                            despawn() = 0;
    00129
    00130
    00136     virtual uint32_t                        getActorCount() const = 0;
    00137
    00146     virtual uint32_t                        getActors(ExtPxActor** buffer, uint32_t bufferSize) const = 0;
    00147
    00153     virtual TkFamily&                       getTkFamily() const = 0;
    00154
    00161     virtual const physx::PxShape* const*    getSubchunkShapes() const = 0;
    00162
    00168     virtual ExtPxAsset&                     getPxAsset() const = 0;
    00169
    00175     virtual void                            setMaterial(physx::PxMaterial& material) = 0;
    00176
    00177     /*
    00178     Set ExtPxPxShapeDesc to be used on all newly created PxShapes.
    00179
    00180     NOTE: Using it will override marking LEAF_CHUNK in simulationFilterData.word3 now.
    00181
    00182     \param[in] pxShapeDesc      The PxShape desc to be the new default. Can be nullptr.
    00183     */
    00184     virtual void                            setPxShapeDescTemplate(const ExtPxShapeDescTemplate* pxShapeDesc) = 0;
    00185
    00191     virtual const ExtPxShapeDescTemplate*   getPxShapeDescTemplate() const = 0;
    00192
    00193     /*
    00194     Set ExtPxPxActorDesc to be used on all newly created PxActors.
    00195
    00196     \param[in] pxActorDesc      The PxActor desc to be the new default. Can be nullptr.
    00197     */
    00198     virtual void                            setPxActorDesc(const ExtPxActorDescTemplate* pxActorDesc) = 0;
    00199
    00205     virtual const ExtPxActorDescTemplate*   getPxActorDesc() const = 0;
    00206
    00212     virtual const NvBlastExtMaterial*       getMaterial() const = 0;
    00213
    00219     virtual void                            setMaterial(const NvBlastExtMaterial* material) = 0;
    00220
    00226     virtual void                            subscribe(ExtPxListener& listener) = 0;
    00227
    00233     virtual void                            unsubscribe(ExtPxListener& listener) = 0;
    00234
    00238     virtual void                            postSplitUpdate() = 0;
    00239
    00243     virtual void                            release() = 0;
    00244
    00248     void* userData;
    00249 };
    00250
    00251
    00252
    00253 } // namespace Blast
    00254 } // namespace Nv
    00255
    00256
    00257 #endif // ifndef NVBLASTEXTPXFAMILY_H