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-2018 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 
45  class PxArticulationImpl;
46 
57  class PxArticulationBase : public PxBase
58  {
59  public:
60 
61  enum Enum
62  {
63  eReducedCoordinate = 0,
64  eMaximumCoordinate = 1
65  };
66 
74  virtual PxScene* getScene() const = 0;
75 
92  virtual void setSolverIterationCounts(PxU32 minPositionIters, PxU32 minVelocityIters = 1) = 0;
93 
99  virtual void getSolverIterationCounts(PxU32 & minPositionIters, PxU32 & minVelocityIters) const = 0;
100 
133  virtual bool isSleeping() const = 0;
134 
144  virtual void setSleepThreshold(PxReal threshold) = 0;
145 
153  virtual PxReal getSleepThreshold() const = 0;
154 
168  virtual void setStabilizationThreshold(PxReal threshold) = 0;
169 
179  virtual PxReal getStabilizationThreshold() const = 0;
180 
196  virtual void setWakeCounter(PxReal wakeCounterValue) = 0;
197 
205  virtual PxReal getWakeCounter() const = 0;
206 
218  virtual void wakeUp() = 0;
219 
231  virtual void putToSleep() = 0;
232 
245  virtual PxArticulationLink* createLink(PxArticulationLink* parent, const PxTransform& pose) = 0;
246 
247 
252  virtual PxU32 getNbLinks() const = 0;
253 
267  virtual PxU32 getLinks(PxArticulationLink** userBuffer, PxU32 bufferSize, PxU32 startIndex = 0) const = 0;
268 
269 
280  virtual void setName(const char* name) = 0;
281 
289  virtual const char* getName() const = 0;
290 
300  virtual PxBounds3 getWorldBounds(float inflation = 1.01f) const = 0;
301 
309  virtual PxAggregate* getAggregate() const = 0;
310 
311  virtual PxArticulationImpl* getImpl() = 0;
312 
313  virtual const PxArticulationImpl* getImpl() const = 0;
314 
315  virtual PxArticulationBase::Enum getType() const = 0;
316 
317  void* userData;
318 
319  virtual ~PxArticulationBase() {}
320 
321  protected:
322  PX_INLINE PxArticulationBase(PxType concreteType, PxBaseFlags baseFlags) : PxBase(concreteType, baseFlags) {}
323  PX_INLINE PxArticulationBase(PxBaseFlags baseFlags) : PxBase(baseFlags) {}
324 public:
325  virtual PxArticulationJointBase* createArticulationJoint(PxArticulationLink& parent,
326  const PxTransform& parentFrame,
327  PxArticulationLink& child,
328  const PxTransform& childFrame) = 0;
329  virtual void releaseArticulationJoint(PxArticulationJointBase* joint) = 0;
330  };
331 
332 #if !PX_DOXYGEN
333 } // namespace physx
334 #endif
335 
337 #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:319
float PxReal
Definition: PxSimpleTypes.h:78
PX_INLINE PxArticulationBase(PxBaseFlags baseFlags)
Definition: PxArticulationBase.h:323
PxU16 PxType
Definition: PxBase.h:49
Enum
Definition: PxArticulationBase.h:61
PX_INLINE PxArticulationBase(PxType concreteType, PxBaseFlags baseFlags)
Definition: PxArticulationBase.h:322
void * userData
user can assign this to whatever, usually to create a 1:1 relationship with a user object...
Definition: PxArticulationBase.h:317
PX_FORCE_INLINE PxGeometryType::Enum getType() const
Definition: PxGeometryHelpers.h:88
Definition: PxArticulationJoint.h:110
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:57
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:349