32#include "PxSceneDesc.h"
33#include "DyThresholdTable.h"
34#include "PxcNpThreadContext.h"
35#include "PxsSimulationController.h"
36#include "DyConstraintWriteBack.h"
37#include "foundation/PxAllocator.h"
39#define DY_MAX_VELOCITY_COUNT 4
44class PxsIslandManager;
45class PxcNpMemBlockPool;
55 class SimpleIslandManager;
59template<
typename T,
typename P>
class PxcThreadCoherentCache;
60class PxcScratchAllocator;
63class PxsContactManagerOutputIterator;
64struct PxsContactManagerOutput;
65class PxsContactManager;
66struct PxsContactManagerOutputCounts;
68class PxvNphaseImplementationContext;
81 PX_FORCE_INLINE PxReal getMaxBiasCoefficient()
const {
return mMaxBiasCoefficient; }
82 PX_FORCE_INLINE void setMaxBiasCoefficient(PxReal coeff) { mMaxBiasCoefficient = coeff; }
248 virtual void getDataStreamBase(
void*& contactStreamBase,
void*& patchStreamBase,
void*& forceAndIndiceStreamBase) = 0;
257 void setStateDirty(
bool dirty) { mBodyStateDirty = dirty; }
259 bool isStateDirty() {
return mBodyStateDirty;}
261 void setSuppressReadback(
bool suppressReadback) { mSuppressReadback = suppressReadback; }
263 bool getSuppressReadback() {
return mSuppressReadback; }
265 void setDt(
const PxReal dt) {
mDt = dt; }
269 Context(IG::SimpleIslandManager* islandManager, PxVirtualAllocatorCallback* allocatorCallback,
270 PxvSimStats& simStats,
bool enableStabilization,
bool useEnhancedDeterminism,
271 const PxReal maxBiasCoefficient,
const PxReal lengthScale) :
272 mThresholdStream (NULL),
273 mForceChangedThresholdStream(NULL),
274 mIslandManager (islandManager),
277 mMaxBiasCoefficient (maxBiasCoefficient),
278 mEnableStabilization (enableStabilization),
279 mUseEnhancedDeterminism (useEnhancedDeterminism),
284 mSimStats (simStats),
285 mBodyStateDirty (false),
286 mSuppressReadback (false)
292 PX_DELETE(mThresholdStream);
293 PX_DELETE(mForceChangedThresholdStream);
296 ThresholdStream* mThresholdStream;
297 ThresholdStream* mForceChangedThresholdStream;
298 ThresholdTable mThresholdTable;
300 IG::SimpleIslandManager* mIslandManager;
301 PxsSimulationController* mSimulationController;
311 PxReal mMaxBiasCoefficient;
313 const bool mEnableStabilization;
315 const bool mUseEnhancedDeterminism;
387 bool mBodyStateDirty;
388 bool mSuppressReadback;
395 const bool enableStabilization,
const bool useEnhancedDeterminism,
const PxReal maxBiasCoefficient,
396 const bool frictionEveryIteration,
const PxReal lengthScale
403 const bool enableStabilization,
const bool useEnhancedDeterminism,
const PxReal lengthScale
Definition CmFlushPool.h:49
Definition DyContext.h:76
PX_FORCE_INLINE ThresholdTable & getThresholdTable()
Returns the threshold table.
Definition DyContext.h:180
PX_FORCE_INLINE void setFrictionOffsetThreshold(PxReal offset)
Sets the friction offset threshold.
Definition DyContext.h:126
PX_FORCE_INLINE void setSolverArticBatchSize(PxU32 f)
Sets the solver batch size.
Definition DyContext.h:154
PX_FORCE_INLINE PxU32 getSolverBatchSize() const
Returns the solver batch size.
Definition DyContext.h:138
PX_FORCE_INLINE void setFrictionType(PxFrictionType::Enum f)
Sets the friction model to be used.
Definition DyContext.h:186
PxcDataStreamPool mForceStreamPool
Structure to encapsulate force stream allocations. Used by GPU solver to reference pre-allocated pinn...
Definition DyContext.h:378
PX_FORCE_INLINE PxReal getLengthScale() const
Returns the length scale.
Definition DyContext.h:110
virtual void updateBodyCore(PxBaseTask *continuation)=0
This method copy gpu solver body data to cpu body core.
virtual void mergeResults()=0
Called after update's task chain has completed. This collects the results of the solver together.
PX_FORCE_INLINE PxReal getInvDt() const
Returns 1/(current frame's timestep)
Definition DyContext.h:210
PxcDataStreamPool mPatchStreamPool
Struct to encapsulate the contact patch stream allocations. Used by GPU solver to reference pre-alloc...
Definition DyContext.h:373
PxcDataStreamPool mContactStreamPool
Structure to encapsulate contact stream allocations. Used by GPU solver to reference pre-allocated pi...
Definition DyContext.h:367
PX_FORCE_INLINE PxReal getFrictionOffsetThreshold() const
Returns the friction offset threshold.
Definition DyContext.h:93
PX_FORCE_INLINE PxFrictionType::Enum getFrictionType() const
Returns the friction model being used.
Definition DyContext.h:166
PxReal mDt
Time-step.
Definition DyContext.h:305
PxReal mBounceThreshold
Threshold controlling the relative velocity at which the solver transitions between restitution and b...
Definition DyContext.h:326
PX_FORCE_INLINE PxU32 getMaxSolverConstraintSize() const
Returns the maximum solver constraint size.
Definition DyContext.h:160
PX_FORCE_INLINE void setCorrelationDistance(PxReal f)
Sets the correlation distance.
Definition DyContext.h:121
PX_FORCE_INLINE PxReal getCorrelationDistance() const
Returns the correlation distance.
Definition DyContext.h:98
PxReal mCCDSeparationThreshold
Threshold controlling whether distant contacts are processed using bias, restitution or a combination...
Definition DyContext.h:335
PxReal mCorrelationDistance
Threshold for controlling friction correlation.
Definition DyContext.h:340
PX_FORCE_INLINE PxReal getDt() const
Returns the current frame's timestep.
Definition DyContext.h:205
PxU32 mSolverArticBatchSize
The minimum number of articulations required to generate a solver task chain.
Definition DyContext.h:356
virtual void update(IG::SimpleIslandManager &simpleIslandManager, PxBaseTask *continuation, PxBaseTask *processLostTouchTask, PxvNphaseImplementationContext *nPhaseContext, const PxU32 maxPatchesPerCM, const PxU32 maxArticulationLinks, const PxReal dt, const PxVec3 &gravity, PxBitMapPinned &changedHandleMap)=0
The entry point for the constraint solver.
PX_FORCE_INLINE PxReal getCCDSeparationThreshold() const
Returns the CCD separation threshold.
Definition DyContext.h:104
PX_FORCE_INLINE void setSolverBatchSize(PxU32 f)
Sets the solver batch size.
Definition DyContext.h:143
virtual void destroy()=0
Destroys this dynamics context.
PxFrictionType::Enum mFrictionType
The current friction model being used.
Definition DyContext.h:362
PX_FORCE_INLINE ThresholdStream & getThresholdStream()
Returns the threshold stream.
Definition DyContext.h:172
PxPinnedArray< Dy::ConstraintWriteback > mConstraintWriteBackPool
Structure to encapsulate constraint write back allocations. Used by GPU/CPU solver to reference pre-a...
Definition DyContext.h:383
PxReal mFrictionOffsetThreshold
Threshold controlling whether friction anchors are constructed or not. If the separation is above mFr...
Definition DyContext.h:330
PxU32 mMaxSolverConstraintSize
max solver constraint size
Definition DyContext.h:321
PxReal mInvDt
1/time-step.
Definition DyContext.h:309
PxReal mLengthScale
The length scale from PxTolerancesScale::length.
Definition DyContext.h:346
PX_FORCE_INLINE PxReal getBounceThreshold() const
Returns the bounce threshold.
Definition DyContext.h:88
PxU32 mSolverBatchSize
The minimum size of an island to generate a solver task chain.
Definition DyContext.h:351
PX_FORCE_INLINE void setCCDSeparationThreshold(PxReal offset)
Sets the friction offset threshold.
Definition DyContext.h:132
PX_FORCE_INLINE void setBounceThreshold(PxReal f)
Sets the bounce threshold.
Definition DyContext.h:116
PX_FORCE_INLINE PxU32 getSolverArticBatchSize() const
Returns the solver batch size.
Definition DyContext.h:149
Definition DyThresholdTable.h:81
Definition DyThresholdTable.h:90
Definition PxsSimpleIslandManager.h:87
Base class of all task types.
Definition PxTask.h:45
The PxTaskManager interface.
Definition PxTaskManager.h:81
3 Element vector class.
Definition PxVec3.h:50
Definition PxAllocator.h:140
Definition PxcNpMemBlockPool.h:52
Definition PxcScratchAllocator.h:42
Definition PxsMaterialManager.h:126
Definition PxsSimulationController.h:124
Definition PxvNphaseImplementationContext.h:120
#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
Enum
Definition PxSceneDesc.h:71
Enum
Definition PxSceneDesc.h:89
Definition PxcNpThreadContext.h:64
Definition PxvSimStats.h:52