00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 #ifndef PX_PHYSICS_NX_ARTICULATION
00032 #define PX_PHYSICS_NX_ARTICULATION
00033
00036 #include "PxPhysXConfig.h"
00037 #include "common/PxBase.h"
00038
00039 #if !PX_DOXYGEN
00040 namespace physx
00041 {
00042 #endif
00043
00044 class PxArticulationLink;
00045
00053 class PxArticulationDriveCache
00054 {
00055 protected:
00056 PxArticulationDriveCache();
00057 };
00058
00069 class PxArticulation : public PxBase
00070 {
00071 public:
00079 virtual void release() = 0;
00080
00088 virtual PxScene* getScene() const = 0;
00089
00090
00103 virtual void setMaxProjectionIterations(PxU32 iterations) = 0;
00104
00113 virtual PxU32 getMaxProjectionIterations() const = 0;
00114
00126 virtual void setSeparationTolerance(PxReal tolerance) = 0;
00127
00136 virtual PxReal getSeparationTolerance() const = 0;
00137
00138
00151 virtual void setInternalDriveIterations(PxU32 iterations) = 0;
00152
00161 virtual PxU32 getInternalDriveIterations() const = 0;
00162
00163
00177 virtual void setExternalDriveIterations(PxU32 iterations) = 0;
00178
00187 virtual PxU32 getExternalDriveIterations() const = 0;
00188
00189
00190
00207 virtual void setSolverIterationCounts(PxU32 minPositionIters, PxU32 minVelocityIters = 1) = 0;
00208
00214 virtual void getSolverIterationCounts(PxU32 & minPositionIters, PxU32 & minVelocityIters) const = 0;
00215
00248 virtual bool isSleeping() const = 0;
00249
00259 virtual void setSleepThreshold(PxReal threshold) = 0;
00260
00268 virtual PxReal getSleepThreshold() const = 0;
00269
00283 virtual void setStabilizationThreshold(PxReal threshold) = 0;
00284
00294 virtual PxReal getStabilizationThreshold() const = 0;
00295
00311 virtual void setWakeCounter(PxReal wakeCounterValue) = 0;
00312
00320 virtual PxReal getWakeCounter() const = 0;
00321
00333 virtual void wakeUp() = 0;
00334
00346 virtual void putToSleep() = 0;
00347
00360 virtual PxArticulationLink* createLink(PxArticulationLink* parent, const PxTransform& pose) = 0;
00361
00362
00367 virtual PxU32 getNbLinks() const = 0;
00368
00382 virtual PxU32 getLinks(PxArticulationLink** userBuffer, PxU32 bufferSize, PxU32 startIndex=0) const = 0;
00383
00394 virtual void setName(const char* name) = 0;
00395
00403 virtual const char* getName() const = 0;
00404
00414 virtual PxBounds3 getWorldBounds(float inflation=1.01f) const = 0;
00415
00423 virtual PxAggregate* getAggregate() const = 0;
00424
00439 virtual PxArticulationDriveCache*
00440 createDriveCache(PxReal compliance, PxU32 driveIterations) const = 0;
00441
00442
00455 virtual void updateDriveCache(PxArticulationDriveCache& driveCache,
00456 PxReal compliance,
00457 PxU32 driveIterations) const = 0;
00458
00466 virtual void releaseDriveCache(PxArticulationDriveCache& driveCache) const = 0;
00467
00481 virtual void applyImpulse(PxArticulationLink* link,
00482 const PxArticulationDriveCache& driveCache,
00483 const PxVec3& linearImpulse,
00484 const PxVec3& angularImpulse) = 0;
00485
00503 virtual void computeImpulseResponse(PxArticulationLink*link,
00504 PxVec3& linearResponse,
00505 PxVec3& angularResponse,
00506 const PxArticulationDriveCache& driveCache,
00507 const PxVec3& linearImpulse,
00508 const PxVec3& angularImpulse) const = 0;
00509
00510
00511
00512 void* userData;
00513
00514 virtual const char* getConcreteTypeName() const { return "PxArticulation"; }
00515
00516 protected:
00517 PX_INLINE PxArticulation(PxType concreteType, PxBaseFlags baseFlags) : PxBase(concreteType, baseFlags) {}
00518 PX_INLINE PxArticulation(PxBaseFlags baseFlags) : PxBase(baseFlags) {}
00519 virtual ~PxArticulation() {}
00520 virtual bool isKindOf(const char* name) const { return !::strcmp("PxArticulation", name) || PxBase::isKindOf(name); }
00521
00522
00523 };
00524
00525 #if !PX_DOXYGEN
00526 }
00527 #endif
00528
00530 #endif