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-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_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 
109 
111 {
112 public:
118  virtual PxArticulationLink& getParentArticulationLink() const = 0;
119 
129  virtual void setParentPose(const PxTransform& pose) = 0;
130 
139  virtual PxTransform getParentPose() const = 0;
140 
146  virtual PxArticulationLink& getChildArticulationLink() const = 0;
147 
148 
158  virtual void setChildPose(const PxTransform& pose) = 0;
159 
167  virtual PxTransform getChildPose() const = 0;
168 
169  virtual PxArticulationJointImpl* getImpl() = 0;
170  virtual const PxArticulationJointImpl* getImpl() const = 0;
171 
173 
174 private:
175 protected:
176  PX_INLINE PxArticulationJointBase(PxType concreteType, PxBaseFlags baseFlags) : PxBase(concreteType, baseFlags) {}
178 
179  virtual bool isKindOf(const char* name) const { return !::strcmp("PxArticulationJointBase", name) || PxBase::isKindOf(name); }
180 };
181 
182 
183 
194 {
195 public:
196 
209  virtual void setTargetOrientation(const PxQuat& orientation) = 0;
210 
218  virtual PxQuat getTargetOrientation() const = 0;
219 
230  virtual void setTargetVelocity(const PxVec3& velocity) = 0;
231 
239  virtual PxVec3 getTargetVelocity() const = 0;
240 
241 
250  virtual void setDriveType(PxArticulationJointDriveType::Enum driveType) = 0;
251 
260  getDriveType() const = 0;
261 
262 
263 
277  virtual void setStiffness(PxReal spring) = 0;
278 
286  virtual PxReal getStiffness() const = 0;
287 
288 
302  virtual void setDamping(PxReal damping) = 0;
303 
310  virtual PxReal getDamping() const = 0;
311 
331  virtual void setInternalCompliance(PxReal compliance) = 0;
332 
333 
341  virtual PxReal getInternalCompliance() const = 0;
342 
362  virtual void setExternalCompliance(PxReal compliance) = 0;
363 
371  virtual PxReal getExternalCompliance() const = 0;
372 
373 
374 
388  virtual void setSwingLimit(PxReal zLimit, PxReal yLimit) = 0;
389 
390 
401  virtual void getSwingLimit(PxReal& zLimit, PxReal& yLimit) const = 0;
402 
403 
404 
411  virtual void setTangentialStiffness(PxReal spring) = 0;
412 
413 
421  virtual PxReal getTangentialStiffness() const = 0;
422 
423 
430  virtual void setTangentialDamping(PxReal damping) = 0;
431 
432 
440  virtual PxReal getTangentialDamping() const = 0;
441 
442 
454  virtual void setSwingLimitContactDistance(PxReal contactDistance) = 0;
455 
456 
464  virtual PxReal getSwingLimitContactDistance() const = 0;
465 
466 
467 
476  virtual void setSwingLimitEnabled(bool enabled) = 0;
477 
486  virtual bool getSwingLimitEnabled() const = 0;
487 
488 
501  virtual void setTwistLimit(PxReal lower, PxReal upper) = 0;
502 
512  virtual void getTwistLimit(PxReal &lower, PxReal &upper) const = 0;
513 
522  virtual void setTwistLimitEnabled(bool enabled) = 0;
523 
532  virtual bool getTwistLimitEnabled() const = 0;
533 
534 
546  virtual void setTwistLimitContactDistance(PxReal contactDistance) = 0;
547 
548 
556  virtual PxReal getTwistLimitContactDistance() const = 0;
557 
558  virtual const char* getConcreteTypeName() const { return "PxArticulationJoint"; }
559 
560 protected:
561  PX_INLINE PxArticulationJoint(PxType concreteType, PxBaseFlags baseFlags) : PxArticulationJointBase(concreteType, baseFlags) {}
563  virtual ~PxArticulationJoint() {}
564  virtual bool isKindOf(const char* name) const { return !::strcmp("PxArticulationJoint", name) || PxArticulationJointBase::isKindOf(name); }
565 };
566 
567 #if !PX_DOXYGEN
568 } // namespace physx
569 #endif
570 
572 #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:564
virtual ~PxArticulationJoint()
Definition: PxArticulationJoint.h:563
a joint between two links in an articulation.
Definition: PxArticulationJoint.h:193
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:179
virtual const char * getConcreteTypeName() const
Returns string name of dynamic type.
Definition: PxArticulationJoint.h:558
PxFlags< PxArticulationMotion::Enum, PxU8 > PxArticulationMotions
Definition: PxArticulationJoint.h:94
Enum
Definition: PxArticulationJoint.h:61
Definition: PxArticulationJoint.h:110
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:177
PX_INLINE PxArticulationJoint(PxType concreteType, PxBaseFlags baseFlags)
Definition: PxArticulationJoint.h:561
virtual ~PxArticulationJointBase()
Definition: PxArticulationJoint.h:172
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:176
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:349
Definition: PxArticulationJoint.h:84
3 Element vector class.
Definition: PxVec3.h:49
PX_INLINE PxArticulationJoint(PxBaseFlags baseFlags)
Definition: PxArticulationJoint.h:562