29#ifndef NP_SCENE_PVD_CLIENT_H
30#define NP_SCENE_PVD_CLIENT_H
32#include "PxPhysXConfig.h"
36#include "foundation/PxStrideIterator.h"
37#include "pvd/PxPvdTransport.h"
38#include "pvd/PxPvdSceneClient.h"
40#include "PvdMetaDataPvdBinding.h"
41#include "foundation/PxBitMap.h"
42#include "PxPvdClient.h"
43#include "PxPvdUserRenderer.h"
46#include "PxsMaterialCore.h"
47#include "PxsFEMSoftBodyMaterialCore.h"
48#include "PxsFEMClothMaterialCore.h"
49#include "PxsPBDMaterialCore.h"
50#include "PxsFLIPMaterialCore.h"
51#include "PxsMPMMaterialCore.h"
56class PxArticulationLink;
63class NpArticulationLink;
64class NpArticulationJointReducedCoordinate;
65class NpArticulationReducedCoordinate;
66class NpArticulationSpatialTendon;
67class NpArticulationFixedTendon;
68class NpArticulationSensor;
72#if PX_SUPPORT_GPU_PHYSX
75class NpPBDParticleSystem;
76class NpFLIPParticleSystem;
77class NpMPMParticleSystem;
78class NpCustomParticleSystem;
89class PvdSceneClient :
public PxPvdSceneClient,
public PvdClient,
public PvdVisualizer
91 PX_NOCOPY(PvdSceneClient)
93 PvdSceneClient(NpScene& scene);
94 virtual ~PvdSceneClient();
97 virtual void setScenePvdFlag(PxPvdSceneFlag::Enum flag,
bool value);
98 virtual void setScenePvdFlags(PxPvdSceneFlags flags) { mFlags = flags; }
100 virtual void updateCamera(
const char* name,
const PxVec3& origin,
const PxVec3& up,
const PxVec3& target);
101 virtual void drawPoints(
const PxDebugPoint* points, PxU32 count);
102 virtual void drawLines(
const PxDebugLine* lines, PxU32 count);
103 virtual void drawTriangles(
const PxDebugTriangle* triangles, PxU32 count);
104 virtual void drawText(
const PxDebugText& text);
105 virtual PvdClient* getClientInternal() {
return this; }
109 virtual PvdDataStream* getDataStream() {
return mPvdDataStream; }
110 virtual bool isConnected()
const {
return mIsConnected; }
111 virtual void onPvdConnected();
112 virtual void onPvdDisconnected();
113 virtual void flush() {}
118 return mIsConnected && (mPvd->getInstrumentationFlags() & PxPvdInstrumentationFlag::eDEBUG);
124 void frameStart(PxReal simulateElapsedTime);
127 void updatePvdProperties();
128 void releasePvdInstance();
130 void createPvdInstance (
const PxActor* actor);
131 void updatePvdProperties(
const PxActor* actor);
132 void releasePvdInstance (
const PxActor* actor);
134 void createPvdInstance (
const NpActor* actor);
135 void updatePvdProperties(
const NpActor* actor);
136 void releasePvdInstance (
const NpActor* actor);
138 void createPvdInstance (
const NpRigidDynamic* body);
139 void createPvdInstance (
const NpArticulationLink* body);
140 void updatePvdProperties (
const NpRigidDynamic* body);
141 void updatePvdProperties (
const NpArticulationLink* body);
142 void releasePvdInstance (
const NpRigidDynamic* body);
143 void releasePvdInstance (
const NpArticulationLink* body);
144 void updateBodyPvdProperties(
const NpActor* body);
145 void updateKinematicTarget (
const NpActor* body,
const PxTransform& p);
147 void createPvdInstance (
const NpRigidStatic* rigidStatic);
148 void updatePvdProperties (
const NpRigidStatic* rigidStatic);
149 void releasePvdInstance (
const NpRigidStatic* rigidStatic);
151 void createPvdInstance (
const NpConstraint* constraint);
152 void updatePvdProperties(
const NpConstraint* constraint);
153 void releasePvdInstance (
const NpConstraint* constraint);
155 void createPvdInstance (
const NpArticulationReducedCoordinate* articulation);
156 void updatePvdProperties(
const NpArticulationReducedCoordinate* articulation);
157 void releasePvdInstance (
const NpArticulationReducedCoordinate* articulation);
159 void createPvdInstance (
const NpArticulationJointReducedCoordinate* articulationJoint);
160 void updatePvdProperties(
const NpArticulationJointReducedCoordinate* articulationJoint);
161 void releasePvdInstance (
const NpArticulationJointReducedCoordinate* articulationJoint);
163 void createPvdInstance(
const NpArticulationSpatialTendon* articulationTendon);
164 void updatePvdProperties(
const NpArticulationSpatialTendon* articulationTendon);
165 void releasePvdInstance(
const NpArticulationSpatialTendon* articulationTendon);
167 void createPvdInstance(
const NpArticulationFixedTendon* articulationTendon);
168 void updatePvdProperties(
const NpArticulationFixedTendon* articulationTendon);
169 void releasePvdInstance(
const NpArticulationFixedTendon* articulationTendon);
171 void createPvdInstance(
const NpArticulationSensor* sensor);
172 void updatePvdProperties(
const NpArticulationSensor* sensor);
173 void releasePvdInstance(
const NpArticulationSensor* sensor);
177 void createPvdInstance (
const PxsMaterialCore* materialCore);
178 void updatePvdProperties(
const PxsMaterialCore* materialCore);
179 void releasePvdInstance (
const PxsMaterialCore* materialCore);
181 void createPvdInstance (
const PxsFEMSoftBodyMaterialCore* materialCore);
182 void updatePvdProperties(
const PxsFEMSoftBodyMaterialCore* materialCore);
183 void releasePvdInstance (
const PxsFEMSoftBodyMaterialCore* materialCore);
185 void createPvdInstance (
const PxsFEMClothMaterialCore* materialCore);
186 void updatePvdProperties(
const PxsFEMClothMaterialCore* materialCore);
187 void releasePvdInstance (
const PxsFEMClothMaterialCore* materialCore);
189 void createPvdInstance (
const PxsPBDMaterialCore* materialCore);
190 void updatePvdProperties(
const PxsPBDMaterialCore* materialCore);
191 void releasePvdInstance (
const PxsPBDMaterialCore* materialCore);
193 void createPvdInstance (
const PxsFLIPMaterialCore* materialCore);
194 void updatePvdProperties(
const PxsFLIPMaterialCore* materialCore);
195 void releasePvdInstance (
const PxsFLIPMaterialCore* materialCore);
197 void createPvdInstance (
const PxsMPMMaterialCore* materialCore);
198 void updatePvdProperties(
const PxsMPMMaterialCore* materialCore);
199 void releasePvdInstance (
const PxsMPMMaterialCore* materialCore);
201 void createPvdInstance (
const PxsCustomMaterialCore* materialCore);
202 void updatePvdProperties(
const PxsCustomMaterialCore* materialCore);
203 void releasePvdInstance (
const PxsCustomMaterialCore* materialCore);
207 void createPvdInstance (
const NpShape* shape, PxActor& owner);
208 void updateMaterials (
const NpShape* shape);
209 void updatePvdProperties (
const NpShape* shape);
210 void releaseAndRecreateGeometry (
const NpShape* shape);
211 void releasePvdInstance (
const NpShape* shape, PxActor& owner);
212 void addBodyAndShapesToPvd (NpRigidDynamic& b);
213 void addStaticAndShapesToPvd (NpRigidStatic& s);
215 void createPvdInstance (
const NpAggregate* aggregate);
216 void updatePvdProperties (
const NpAggregate* aggregate);
217 void attachAggregateActor (
const NpAggregate* aggregate, NpActor* actor);
218 void detachAggregateActor (
const NpAggregate* aggregate, NpActor* actor);
219 void releasePvdInstance (
const NpAggregate* aggregate);
221#if PX_SUPPORT_GPU_PHYSX
222 void createPvdInstance(
const NpSoftBody* softBody);
223 void updatePvdProperties(
const NpSoftBody* softBody);
224 void attachAggregateActor(
const NpSoftBody* softBody, NpActor* actor);
225 void detachAggregateActor(
const NpSoftBody* softBody, NpActor* actor);
226 void releasePvdInstance(
const NpSoftBody* softBody);
228 void createPvdInstance(
const NpFEMCloth* femCloth);
229 void updatePvdProperties(
const NpFEMCloth* femCloth);
230 void attachAggregateActor(
const NpFEMCloth* femCloth, NpActor* actor);
231 void detachAggregateActor(
const NpFEMCloth* femCloth, NpActor* actor);
232 void releasePvdInstance(
const NpFEMCloth* femCloth);
234 void createPvdInstance(
const NpPBDParticleSystem* particleSystem);
235 void updatePvdProperties(
const NpPBDParticleSystem* particleSystem);
236 void attachAggregateActor(
const NpPBDParticleSystem* particleSystem, NpActor* actor);
237 void detachAggregateActor(
const NpPBDParticleSystem* particleSystem, NpActor* actor);
238 void releasePvdInstance(
const NpPBDParticleSystem* particleSystem);
240 void createPvdInstance(
const NpFLIPParticleSystem* particleSystem);
241 void updatePvdProperties(
const NpFLIPParticleSystem* particleSystem);
242 void attachAggregateActor(
const NpFLIPParticleSystem* particleSystem, NpActor* actor);
243 void detachAggregateActor(
const NpFLIPParticleSystem* particleSystem, NpActor* actor);
244 void releasePvdInstance(
const NpFLIPParticleSystem* particleSystem);
246 void createPvdInstance(
const NpMPMParticleSystem* particleSystem);
247 void updatePvdProperties(
const NpMPMParticleSystem* particleSystem);
248 void attachAggregateActor(
const NpMPMParticleSystem* particleSystem, NpActor* actor);
249 void detachAggregateActor(
const NpMPMParticleSystem* particleSystem, NpActor* actor);
250 void releasePvdInstance(
const NpMPMParticleSystem* particleSystem);
252 void createPvdInstance(
const NpCustomParticleSystem* particleSystem);
253 void updatePvdProperties(
const NpCustomParticleSystem* particleSystem);
254 void attachAggregateActor(
const NpCustomParticleSystem* particleSystem, NpActor* actor);
255 void detachAggregateActor(
const NpCustomParticleSystem* particleSystem, NpActor* actor);
256 void releasePvdInstance(
const NpCustomParticleSystem* particleSystem);
258 void createPvdInstance(
const NpHairSystem* hairSystem);
259 void updatePvdProperties(
const NpHairSystem* hairSystem);
260 void attachAggregateActor(
const NpHairSystem* hairSystem, NpActor* actor);
261 void detachAggregateActor(
const NpHairSystem* hairSystem, NpActor* actor);
262 void releasePvdInstance(
const NpHairSystem* hairSystem);
265 void originShift(PxVec3 shift);
267 void updateContacts();
268 void updateSceneQueries();
271 void visualize(PxArticulationLink& link);
272 void visualize(
const PxRenderBuffer& debugRenderable);
276 void sendEntireScene();
277 void updateConstraint(
const Sc::ConstraintCore& scConstraint, PxU32 updateType);
283 PvdDataStream* mPvdDataStream;
284 PvdMetaDataBinding mMetaDataBinding;
285 PvdUserRenderer* mUserRender;
286 RendererEventClient* mRenderClient;
#define PX_FORCE_INLINE
Definition PxPreprocessor.h:335
Sorts an array of objects in ascending order, assuming that the predicate implements the < operator:
Definition PxBoxController.h:39
PxFlags< PxPvdSceneFlag::Enum, PxU8 > PxPvdSceneFlags
Bitfield that contains a set of raised flags defined in PxPvdSceneFlag.
Definition PxPvdSceneClient.h:77