PxRigidDynamic.h
Go to the documentation of this file.
1 //
2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions
4 // are met:
5 // * Redistributions of source code must retain the above copyright
6 // notice, this list of conditions and the following disclaimer.
7 // * Redistributions in binary form must reproduce the above copyright
8 // notice, this list of conditions and the following disclaimer in the
9 // documentation and/or other materials provided with the distribution.
10 // * Neither the name of NVIDIA CORPORATION nor the names of its
11 // contributors may be used to endorse or promote products derived
12 // from this software without specific prior written permission.
13 //
14 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
15 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
18 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
20 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
21 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
22 // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
24 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 //
26 // Copyright (c) 2008-2021 NVIDIA Corporation. All rights reserved.
27 // Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
28 // Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
29 
30 
31 #ifndef PX_PHYSICS_NX_RIGIDDYNAMIC
32 #define PX_PHYSICS_NX_RIGIDDYNAMIC
33 
37 #include "PxRigidBody.h"
38 
39 #if !PX_DOXYGEN
40 namespace physx
41 {
42 #endif
43 
44 
51 {
52  enum Enum
53  {
54  eLOCK_LINEAR_X = (1 << 0),
55  eLOCK_LINEAR_Y = (1 << 1),
56  eLOCK_LINEAR_Z = (1 << 2),
57  eLOCK_ANGULAR_X = (1 << 3),
58  eLOCK_ANGULAR_Y = (1 << 4),
59  eLOCK_ANGULAR_Z = (1 << 5)
60  };
61 };
62 
64 PX_FLAGS_OPERATORS(PxRigidDynamicLockFlag::Enum, PxU8)
65 
66 
84 {
85 public:
86  // Runtime modifications
87 
88 
89 /************************************************************************************************/
117  virtual void setKinematicTarget(const PxTransform& destination) = 0;
118 
127  virtual bool getKinematicTarget(PxTransform& target) const = 0;
128 
129 
130 /************************************************************************************************/
168  virtual bool isSleeping() const = 0;
169 
170 
182  virtual void setSleepThreshold(PxReal threshold) = 0;
183 
191  virtual PxReal getSleepThreshold() const = 0;
192 
206  virtual void setStabilizationThreshold(PxReal threshold) = 0;
207 
217  virtual PxReal getStabilizationThreshold() const = 0;
218 
219 
229  virtual PxRigidDynamicLockFlags getRigidDynamicLockFlags() const = 0;
230 
244  virtual void setRigidDynamicLockFlag(PxRigidDynamicLockFlag::Enum flag, bool value) = 0;
245  virtual void setRigidDynamicLockFlags(PxRigidDynamicLockFlags flags) = 0;
246 
247 
248 
269  virtual void setWakeCounter(PxReal wakeCounterValue) = 0;
270 
278  virtual PxReal getWakeCounter() const = 0;
279 
294  virtual void wakeUp() = 0;
295 
310  virtual void putToSleep() = 0;
311 
312 /************************************************************************************************/
313 
332  virtual void setSolverIterationCounts(PxU32 minPositionIters, PxU32 minVelocityIters = 1) = 0;
333 
339  virtual void getSolverIterationCounts(PxU32& minPositionIters, PxU32& minVelocityIters) const = 0;
340 
360  virtual PxReal getContactReportThreshold() const = 0;
361 
371  virtual void setContactReportThreshold(PxReal threshold) = 0;
372 
373  virtual const char* getConcreteTypeName() const { return "PxRigidDynamic"; }
374 
375 protected:
376  PX_INLINE PxRigidDynamic(PxType concreteType, PxBaseFlags baseFlags) : PxRigidBody(concreteType, baseFlags) {}
377  PX_INLINE PxRigidDynamic(PxBaseFlags baseFlags) : PxRigidBody(baseFlags) {}
378  virtual ~PxRigidDynamic() {}
379  virtual bool isKindOf(const char* name) const { return !::strcmp("PxRigidDynamic", name) || PxRigidBody::isKindOf(name); }
380 
381 };
382 
383 #if !PX_DOXYGEN
384 } // namespace physx
385 #endif
386 
388 #endif
Definition: GuContactBuffer.h:37
PxRigidDynamic represents a dynamic rigid simulation object in the physics SDK.
Definition: PxRigidDynamic.h:83
Collection of flags providing a mechanism to lock motion along/around a specific axis.
Definition: PxRigidDynamic.h:50
PxFlags< PxRigidDynamicLockFlag::Enum, PxU8 > PxRigidDynamicLockFlags
Definition: PxRigidDynamic.h:63
float PxReal
Definition: PxSimpleTypes.h:78
PX_INLINE PxRigidDynamic(PxBaseFlags baseFlags)
Definition: PxRigidDynamic.h:377
Enum
Definition: PxRigidDynamic.h:52
virtual bool isKindOf(const char *name) const
Returns whether a given type name matches with the type of this instance.
Definition: PxRigidDynamic.h:379
PxU16 PxType
Definition: PxBase.h:49
PxU16 flags
a set of Px1DConstraintFlags
Definition: PxConstraintDesc.h:110
uint8_t PxU8
Definition: PxSimpleTypes.h:75
class representing a rigid euclidean transform as a quaternion and a vector
Definition: PxTransform.h:48
virtual const char * getConcreteTypeName() const
Returns string name of dynamic type.
Definition: PxRigidDynamic.h:373
Container for bitfield flag variables associated with a specific enum type.
Definition: PxFlags.h:73
PxRigidBody is a base class shared between dynamic rigid body objects.
Definition: PxRigidBody.h:195
virtual bool isKindOf(const char *name) const
Returns whether a given type name matches with the type of this instance.
Definition: PxRigidBody.h:730
uint32_t PxU32
Definition: Px.h:48
PX_INLINE PxRigidDynamic(PxType concreteType, PxBaseFlags baseFlags)
Definition: PxRigidDynamic.h:376
#define PX_INLINE
Definition: PxPreprocessor.h:336
virtual ~PxRigidDynamic()
Definition: PxRigidDynamic.h:378