PxArticulationJoint.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-2019 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_JOINT
32 #define PX_PHYSICS_NX_ARTICULATION_JOINT
33 
36 #include "PxPhysXConfig.h"
37 #include "common/PxBase.h"
38 
39 #if !PX_DOXYGEN
40 namespace physx
41 {
42 #endif
43 
44 class PxArticulationJointImpl;
45 
60 {
61  enum Enum
62  {
63  eTARGET = 0, // use the quaternion as the drive target
64  eERROR = 1 // use the vector part of the quaternion as the drive error.
65  };
66 };
67 
69 {
70  enum Enum
71  {
72  eTWIST = 0,
73  eSWING1 = 1,
74  eSWING2 = 2,
75  eX = 3,
76  eY = 4,
77  eZ = 5,
78  eCOUNT = 6
79  };
80 };
81 
82 PX_FLAGS_OPERATORS(PxArticulationAxis::Enum, PxU8)
83 
85 {
86  enum Enum
87  {
88  eLOCKED = 0,
89  eLIMITED = 1,
90  eFREE = 2
91  };
92 };
93 
95 PX_FLAGS_OPERATORS(PxArticulationMotion::Enum, PxU8)
96 
98 {
99  enum Enum
100  {
101  ePRISMATIC = 0,
102  eREVOLUTE = 1,
103  eSPHERICAL = 2,
104  eFIX = 3,
105  eUNDEFINED = 4
106  };
107 };
108 
110 {
111 public:
117  virtual PxArticulationLink& getParentArticulationLink() const = 0;
118 
127  virtual void setParentPose(const PxTransform& pose) = 0;
128 
136  virtual PxTransform getParentPose() const = 0;
137 
143  virtual PxArticulationLink& getChildArticulationLink() const = 0;
144 
153  virtual void setChildPose(const PxTransform& pose) = 0;
154 
162  virtual PxTransform getChildPose() const = 0;
163 
164  virtual PxArticulationJointImpl* getImpl() = 0;
165  virtual const PxArticulationJointImpl* getImpl() const = 0;
166 
168 
169 private:
170 protected:
171  PX_INLINE PxArticulationJointBase(PxType concreteType, PxBaseFlags baseFlags) : PxBase(concreteType, baseFlags) {}
173 
174  virtual bool isKindOf(const char* name) const { return !::strcmp("PxArticulationJointBase", name) || PxBase::isKindOf(name); }
175 };
176 
177 
178 
189 {
190 public:
191 
203  virtual void setTargetOrientation(const PxQuat& orientation) = 0;
204 
212  virtual PxQuat getTargetOrientation() const = 0;
213 
224  virtual void setTargetVelocity(const PxVec3& velocity) = 0;
225 
233  virtual PxVec3 getTargetVelocity() const = 0;
234 
243  virtual void setDriveType(PxArticulationJointDriveType::Enum driveType) = 0;
244 
253  getDriveType() const = 0;
254 
268  virtual void setStiffness(PxReal spring) = 0;
269 
277  virtual PxReal getStiffness() const = 0;
278 
292  virtual void setDamping(PxReal damping) = 0;
293 
299  virtual PxReal getDamping() const = 0;
300 
319  virtual void setInternalCompliance(PxReal compliance) = 0;
320 
328  virtual PxReal getInternalCompliance() const = 0;
329 
348  virtual void setExternalCompliance(PxReal compliance) = 0;
349 
357  virtual PxReal getExternalCompliance() const = 0;
358 
372  virtual void setSwingLimit(PxReal zLimit, PxReal yLimit) = 0;
373 
384  virtual void getSwingLimit(PxReal& zLimit, PxReal& yLimit) const = 0;
385 
391  virtual void setTangentialStiffness(PxReal spring) = 0;
392 
400  virtual PxReal getTangentialStiffness() const = 0;
401 
407  virtual void setTangentialDamping(PxReal damping) = 0;
408 
416  virtual PxReal getTangentialDamping() const = 0;
417 
428  virtual void setSwingLimitContactDistance(PxReal contactDistance) = 0;
429 
437  virtual PxReal getSwingLimitContactDistance() const = 0;
438 
447  virtual void setSwingLimitEnabled(bool enabled) = 0;
448 
456  virtual bool getSwingLimitEnabled() const = 0;
457 
470  virtual void setTwistLimit(PxReal lower, PxReal upper) = 0;
471 
480  virtual void getTwistLimit(PxReal &lower, PxReal &upper) const = 0;
481 
490  virtual void setTwistLimitEnabled(bool enabled) = 0;
491 
499  virtual bool getTwistLimitEnabled() const = 0;
500 
511  virtual void setTwistLimitContactDistance(PxReal contactDistance) = 0;
512 
520  virtual PxReal getTwistLimitContactDistance() const = 0;
521 
522  virtual const char* getConcreteTypeName() const { return "PxArticulationJoint"; }
523 
524 protected:
525  PX_INLINE PxArticulationJoint(PxType concreteType, PxBaseFlags baseFlags) : PxArticulationJointBase(concreteType, baseFlags) {}
527  virtual ~PxArticulationJoint() {}
528  virtual bool isKindOf(const char* name) const { return !::strcmp("PxArticulationJoint", name) || PxArticulationJointBase::isKindOf(name); }
529 };
530 
531 #if !PX_DOXYGEN
532 } // namespace physx
533 #endif
534 
536 #endif
Definition: GuContactBuffer.h:37
virtual bool isKindOf(const char *name) const
Returns whether a given type name matches with the type of this instance.
Definition: PxArticulationJoint.h:528
virtual ~PxArticulationJoint()
Definition: PxArticulationJoint.h:527
a joint between two links in an articulation.
Definition: PxArticulationJoint.h:188
Definition: PxArticulationJoint.h:68
This is a quaternion class. For more information on quaternion mathematics consult a mathematics sour...
Definition: PxQuat.h:49
float PxReal
Definition: PxSimpleTypes.h:78
struct @6::SpringModifiers spring
virtual bool isKindOf(const char *superClass) const
Returns whether a given type name matches with the type of this instance.
Definition: PxBase.h:178
The type of joint drive to use for the articulation joint.
Definition: PxArticulationJoint.h:59
Enum
Definition: PxArticulationJoint.h:86
PxU16 PxType
Definition: PxBase.h:49
Definition: PxArticulationJoint.h:97
virtual bool isKindOf(const char *name) const
Returns whether a given type name matches with the type of this instance.
Definition: PxArticulationJoint.h:174
virtual const char * getConcreteTypeName() const
Returns string name of dynamic type.
Definition: PxArticulationJoint.h:522
PxFlags< PxArticulationMotion::Enum, PxU8 > PxArticulationMotions
Definition: PxArticulationJoint.h:94
Enum
Definition: PxArticulationJoint.h:61
Definition: PxArticulationJoint.h:109
uint8_t PxU8
Definition: PxSimpleTypes.h:75
PxReal damping
damping parameter, for spring constraints
Definition: PxConstraintDesc.h:100
class representing a rigid euclidean transform as a quaternion and a vector
Definition: PxTransform.h:48
PX_INLINE PxArticulationJointBase(PxBaseFlags baseFlags)
Definition: PxArticulationJoint.h:172
PX_INLINE PxArticulationJoint(PxType concreteType, PxBaseFlags baseFlags)
Definition: PxArticulationJoint.h:525
virtual ~PxArticulationJointBase()
Definition: PxArticulationJoint.h:167
Enum
Definition: PxArticulationJoint.h:99
Container for bitfield flag variables associated with a specific enum type.
Definition: PxFlags.h:73
PX_INLINE PxArticulationJointBase(PxType concreteType, PxBaseFlags baseFlags)
Definition: PxArticulationJoint.h:171
Enum
Definition: PxArticulationJoint.h:70
Base class for objects that can be members of a PxCollection.
Definition: PxBase.h:73
#define PX_INLINE
Definition: PxPreprocessor.h:324
Definition: PxArticulationJoint.h:84
3 Element vector class.
Definition: PxVec3.h:49
PX_INLINE PxArticulationJoint(PxBaseFlags baseFlags)
Definition: PxArticulationJoint.h:526