NvBlastExtPxFamily.h
Go to the documentation of this file.
1 // This code contains NVIDIA Confidential Information and is disclosed to you
2 // under a form of NVIDIA software license agreement provided separately to you.
3 //
4 // Notice
5 // NVIDIA Corporation and its licensors retain all intellectual property and
6 // proprietary rights in and to this software and related documentation and
7 // any modifications thereto. Any use, reproduction, disclosure, or
8 // distribution of this software and related documentation without an express
9 // license agreement from NVIDIA Corporation is strictly prohibited.
10 //
11 // ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES
12 // NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
13 // THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT,
14 // MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.
15 //
16 // Information and code furnished is believed to be accurate and reliable.
17 // However, NVIDIA Corporation assumes no responsibility for the consequences of use of such
18 // information or for any infringement of patents or other rights of third parties that may
19 // result from its use. No license is granted by implication or otherwise under any patent
20 // or patent rights of NVIDIA Corporation. Details are subject to change without notice.
21 // This code supersedes and replaces all information previously supplied.
22 // NVIDIA Corporation products are not authorized for use as critical
23 // components in life support devices or systems without express written approval of
24 // NVIDIA Corporation.
25 //
26 // Copyright (c) 2016-2020 NVIDIA Corporation. All rights reserved.
27 
28 
29 #ifndef NVBLASTEXTPXFAMILY_H
30 #define NVBLASTEXTPXFAMILY_H
31 
32 #include "PxFiltering.h"
33 
34 
35 // Forward declarations
36 namespace physx
37 {
38 class PxRigidDynamic;
39 class PxMaterial;
40 class PxScene;
41 class PxTransform;
42 }
43 
44 struct NvBlastExtMaterial;
45 
46 
47 namespace Nv
48 {
49 namespace Blast
50 {
51 
52 // Forward declarations
53 class ExtPxActor;
54 class ExtPxAsset;
55 class ExtPxListener;
56 class TkFamily;
57 
58 
67 {
68  uint8_t flags;
69  physx::PxFilterData simulationFilterData;
70  physx::PxFilterData queryFilterData;
71  float contactOffset;
72  float restOffset;
73 };
74 
75 
82 {
83  uint8_t flags;
84 };
85 
86 
93 {
94  physx::PxScene* scene;
95  physx::PxMaterial* material;
96  float density;
97 };
98 
99 
106 {
107 public:
117  virtual bool spawn(const physx::PxTransform& pose, const physx::PxVec3& scale, const ExtPxSpawnSettings& settings) = 0;
118 
119 
128  virtual bool despawn() = 0;
129 
130 
136  virtual uint32_t getActorCount() const = 0;
137 
146  virtual uint32_t getActors(ExtPxActor** buffer, uint32_t bufferSize) const = 0;
147 
153  virtual TkFamily& getTkFamily() const = 0;
154 
161  virtual const physx::PxShape* const* getSubchunkShapes() const = 0;
162 
168  virtual ExtPxAsset& getPxAsset() const = 0;
169 
175  virtual void setMaterial(physx::PxMaterial& material) = 0;
176 
177  /*
178  Set ExtPxPxShapeDesc to be used on all newly created PxShapes.
179 
180  NOTE: Using it will override marking LEAF_CHUNK in simulationFilterData.word3 now.
181 
182  \param[in] pxShapeDesc The PxShape desc to be the new default. Can be nullptr.
183  */
184  virtual void setPxShapeDescTemplate(const ExtPxShapeDescTemplate* pxShapeDesc) = 0;
185 
191  virtual const ExtPxShapeDescTemplate* getPxShapeDescTemplate() const = 0;
192 
193  /*
194  Set ExtPxPxActorDesc to be used on all newly created PxActors.
195 
196  \param[in] pxActorDesc The PxActor desc to be the new default. Can be nullptr.
197  */
198  virtual void setPxActorDesc(const ExtPxActorDescTemplate* pxActorDesc) = 0;
199 
205  virtual const ExtPxActorDescTemplate* getPxActorDesc() const = 0;
206 
212  virtual const NvBlastExtMaterial* getMaterial() const = 0;
213 
219  virtual void setMaterial(const NvBlastExtMaterial* material) = 0;
220 
226  virtual void subscribe(ExtPxListener& listener) = 0;
227 
233  virtual void unsubscribe(ExtPxListener& listener) = 0;
234 
238  virtual void postSplitUpdate() = 0;
239 
243  virtual void release() = 0;
244 
248  void* userData;
249 };
250 
251 
252 
253 } // namespace Blast
254 } // namespace Nv
255 
256 
257 #endif // ifndef NVBLASTEXTPXFAMILY_H
physx::PxScene * scene
PxScene for PxActors to be spawned.
Definition: NvBlastExtPxFamily.h:94
Definition: NvBlastExtApexSharedParts.h:34
Definition: NvBlastTkFamily.h:55
float density
default density for PhysX
Definition: NvBlastExtPxFamily.h:96
Definition: NvBlastExtPxFamily.h:66
uint8_t flags
PxShapeFlags flags.
Definition: NvBlastExtPxFamily.h:68
uint8_t flags
actor flags
Definition: NvBlastExtPxFamily.h:83
physx::PxFilterData simulationFilterData
user definable collision filter data
Definition: NvBlastExtPxFamily.h:69
void * userData
Definition: NvBlastExtPxFamily.h:248
Definition: NvBlastExtPxFamily.h:81
Definition: NvBlastExtPxAsset.h:123
physx::PxMaterial * material
default PxMaterial
Definition: NvBlastExtPxFamily.h:95
Definition: NvBlastExtPxFamily.h:92
Definition: NvBlastExtPxListener.h:48
float contactOffset
contact offset
Definition: NvBlastExtPxFamily.h:71
Definition: NvBlastExtPxActor.h:57
physx::PxFilterData queryFilterData
user definable query filter data.
Definition: NvBlastExtPxFamily.h:70
Definition: NvBlastExtPxFamily.h:105
float restOffset
rest offset
Definition: NvBlastExtPxFamily.h:72
Definition: NvBlastArray.h:37
Definition: NvBlastExtDamageShaders.h:94