PxArticulationBase.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_ARTICULATION_BASE
32 #define PX_PHYSICS_NX_ARTICULATION_BASE
33 
36 #include "PxPhysXConfig.h"
37 #include "common/PxBase.h"
38 
39 #if !PX_DOXYGEN
40 namespace physx
41 {
42 #endif
43 
44  class PxArticulationImpl;
45 
56  class PxArticulationBase : public PxBase
57  {
58  public:
59 
67  virtual PxScene* getScene() const = 0;
68 
85  virtual void setSolverIterationCounts(PxU32 minPositionIters, PxU32 minVelocityIters = 1) = 0;
86 
92  virtual void getSolverIterationCounts(PxU32 & minPositionIters, PxU32 & minVelocityIters) const = 0;
93 
126  virtual bool isSleeping() const = 0;
127 
137  virtual void setSleepThreshold(PxReal threshold) = 0;
138 
146  virtual PxReal getSleepThreshold() const = 0;
147 
161  virtual void setStabilizationThreshold(PxReal threshold) = 0;
162 
172  virtual PxReal getStabilizationThreshold() const = 0;
173 
189  virtual void setWakeCounter(PxReal wakeCounterValue) = 0;
190 
198  virtual PxReal getWakeCounter() const = 0;
199 
211  virtual void wakeUp() = 0;
212 
224  virtual void putToSleep() = 0;
225 
237  virtual PxArticulationLink* createLink(PxArticulationLink* parent, const PxTransform& pose) = 0;
238 
242  virtual PxU32 getNbLinks() const = 0;
243 
256  virtual PxU32 getLinks(PxArticulationLink** userBuffer, PxU32 bufferSize, PxU32 startIndex = 0) const = 0;
257 
268  virtual void setName(const char* name) = 0;
269 
277  virtual const char* getName() const = 0;
278 
288  virtual PxBounds3 getWorldBounds(float inflation = 1.01f) const = 0;
289 
297  virtual PxAggregate* getAggregate() const = 0;
298 
299  virtual PxArticulationImpl* getImpl() = 0;
300  virtual const PxArticulationImpl* getImpl() const = 0;
301 
302  void* userData;
303 
304  virtual ~PxArticulationBase() {}
305 
306  protected:
307  PX_INLINE PxArticulationBase(PxType concreteType, PxBaseFlags baseFlags) : PxBase(concreteType, baseFlags), userData(NULL) {}
308  PX_INLINE PxArticulationBase(PxBaseFlags baseFlags) : PxBase(baseFlags) {}
309 
310  public:
311  virtual PxArticulationJointBase* createArticulationJoint(PxArticulationLink& parent, const PxTransform& parentFrame, PxArticulationLink& child, const PxTransform& childFrame) = 0;
312  virtual void releaseArticulationJoint(PxArticulationJointBase* joint) = 0;
313  };
314 
315 #if !PX_DOXYGEN
316 } // namespace physx
317 #endif
318 
320 #endif
Definition: GuContactBuffer.h:37
A scene is a collection of bodies and constraints which can interact.
Definition: PxScene.h:169
virtual ~PxArticulationBase()
Definition: PxArticulationBase.h:304
float PxReal
Definition: PxSimpleTypes.h:78
PX_INLINE PxArticulationBase(PxBaseFlags baseFlags)
Definition: PxArticulationBase.h:308
PxU16 PxType
Definition: PxBase.h:49
PX_INLINE PxArticulationBase(PxType concreteType, PxBaseFlags baseFlags)
Definition: PxArticulationBase.h:307
void * userData
user can assign this to whatever, usually to create a 1:1 relationship with a user object...
Definition: PxArticulationBase.h:302
Definition: PxArticulationJoint.h:69
class representing a rigid euclidean transform as a quaternion and a vector
Definition: PxTransform.h:48
Class representing 3D range or axis aligned bounding box.
Definition: PxBounds3.h:58
a tree structure of bodies connected by joints that is treated as a unit by the dynamics solver ...
Definition: PxArticulationBase.h:56
Class to aggregate actors into a single broad-phase entry.
Definition: PxAggregate.h:70
uint32_t PxU32
Definition: Px.h:48
Base class for objects that can be members of a PxCollection.
Definition: PxBase.h:73
#define PX_INLINE
Definition: PxPreprocessor.h:336