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-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_JOINT
32 #define PX_PHYSICS_NX_ARTICULATION_JOINT
33 
36 #include "PxPhysXConfig.h"
37 #include "common/PxBase.h"
38 #include "solver/PxSolverDefs.h"
39 
40 #if !PX_DOXYGEN
41 namespace physx
42 {
43 #endif
44 
45 class PxArticulationJointImpl;
46 
61 {
62  enum Enum
63  {
64  eTARGET = 0, // use the quaternion as the drive target
65  eERROR = 1 // use the vector part of the quaternion as the drive error.
66  };
67 };
68 
70 {
71 public:
77  virtual PxArticulationLink& getParentArticulationLink() const = 0;
78 
87  virtual void setParentPose(const PxTransform& pose) = 0;
88 
96  virtual PxTransform getParentPose() const = 0;
97 
103  virtual PxArticulationLink& getChildArticulationLink() const = 0;
104 
113  virtual void setChildPose(const PxTransform& pose) = 0;
114 
122  virtual PxTransform getChildPose() const = 0;
123 
124  virtual PxArticulationJointImpl* getImpl() = 0;
125  virtual const PxArticulationJointImpl* getImpl() const = 0;
126 
128 
129 private:
130 protected:
131  PX_INLINE PxArticulationJointBase(PxType concreteType, PxBaseFlags baseFlags) : PxBase(concreteType, baseFlags) {}
133 
134  virtual bool isKindOf(const char* name) const { return !::strcmp("PxArticulationJointBase", name) || PxBase::isKindOf(name); }
135 };
136 
137 
138 
149 {
150 public:
151 
163  virtual void setTargetOrientation(const PxQuat& orientation) = 0;
164 
172  virtual PxQuat getTargetOrientation() const = 0;
173 
184  virtual void setTargetVelocity(const PxVec3& velocity) = 0;
185 
193  virtual PxVec3 getTargetVelocity() const = 0;
194 
203  virtual void setDriveType(PxArticulationJointDriveType::Enum driveType) = 0;
204 
212  virtual PxArticulationJointDriveType::Enum getDriveType() const = 0;
213 
227  virtual void setStiffness(PxReal spring) = 0;
228 
236  virtual PxReal getStiffness() const = 0;
237 
251  virtual void setDamping(PxReal damping) = 0;
252 
258  virtual PxReal getDamping() const = 0;
259 
278  virtual void setInternalCompliance(PxReal compliance) = 0;
279 
287  virtual PxReal getInternalCompliance() const = 0;
288 
307  virtual void setExternalCompliance(PxReal compliance) = 0;
308 
316  virtual PxReal getExternalCompliance() const = 0;
317 
331  virtual void setSwingLimit(PxReal zLimit, PxReal yLimit) = 0;
332 
343  virtual void getSwingLimit(PxReal& zLimit, PxReal& yLimit) const = 0;
344 
350  virtual void setTangentialStiffness(PxReal spring) = 0;
351 
359  virtual PxReal getTangentialStiffness() const = 0;
360 
366  virtual void setTangentialDamping(PxReal damping) = 0;
367 
375  virtual PxReal getTangentialDamping() const = 0;
376 
387  virtual void setSwingLimitContactDistance(PxReal contactDistance) = 0;
388 
396  virtual PxReal getSwingLimitContactDistance() const = 0;
397 
406  virtual void setSwingLimitEnabled(bool enabled) = 0;
407 
415  virtual bool getSwingLimitEnabled() const = 0;
416 
429  virtual void setTwistLimit(PxReal lower, PxReal upper) = 0;
430 
439  virtual void getTwistLimit(PxReal &lower, PxReal &upper) const = 0;
440 
449  virtual void setTwistLimitEnabled(bool enabled) = 0;
450 
458  virtual bool getTwistLimitEnabled() const = 0;
459 
470  virtual void setTwistLimitContactDistance(PxReal contactDistance) = 0;
471 
479  virtual PxReal getTwistLimitContactDistance() const = 0;
480 
481  virtual const char* getConcreteTypeName() const { return "PxArticulationJoint"; }
482 
483 protected:
484  PX_INLINE PxArticulationJoint(PxType concreteType, PxBaseFlags baseFlags) : PxArticulationJointBase(concreteType, baseFlags) {}
486  virtual ~PxArticulationJoint() {}
487  virtual bool isKindOf(const char* name) const { return !::strcmp("PxArticulationJoint", name) || PxArticulationJointBase::isKindOf(name); }
488 };
489 
490 #if !PX_DOXYGEN
491 } // namespace physx
492 #endif
493 
495 #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:487
virtual ~PxArticulationJoint()
Definition: PxArticulationJoint.h:486
a joint between two links in an articulation.
Definition: PxArticulationJoint.h:148
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:60
PxU16 PxType
Definition: PxBase.h:49
virtual bool isKindOf(const char *name) const
Returns whether a given type name matches with the type of this instance.
Definition: PxArticulationJoint.h:134
virtual const char * getConcreteTypeName() const
Returns string name of dynamic type.
Definition: PxArticulationJoint.h:481
Enum
Definition: PxArticulationJoint.h:62
Definition: PxArticulationJoint.h:69
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:132
PX_INLINE PxArticulationJoint(PxType concreteType, PxBaseFlags baseFlags)
Definition: PxArticulationJoint.h:484
virtual ~PxArticulationJointBase()
Definition: PxArticulationJoint.h:127
PX_INLINE PxArticulationJointBase(PxType concreteType, PxBaseFlags baseFlags)
Definition: PxArticulationJoint.h:131
Base class for objects that can be members of a PxCollection.
Definition: PxBase.h:73
#define PX_INLINE
Definition: PxPreprocessor.h:336
3 Element vector class.
Definition: PxVec3.h:49
PX_INLINE PxArticulationJoint(PxBaseFlags baseFlags)
Definition: PxArticulationJoint.h:485