PxArticulationJoint.h

Go to the documentation of this file.
00001 // This code contains NVIDIA Confidential Information and is disclosed to you
00002 // under a form of NVIDIA software license agreement provided separately to you.
00003 //
00004 // Notice
00005 // NVIDIA Corporation and its licensors retain all intellectual property and
00006 // proprietary rights in and to this software and related documentation and
00007 // any modifications thereto. Any use, reproduction, disclosure, or
00008 // distribution of this software and related documentation without an express
00009 // license agreement from NVIDIA Corporation is strictly prohibited.
00010 //
00011 // ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES
00012 // NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
00013 // THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT,
00014 // MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.
00015 //
00016 // Information and code furnished is believed to be accurate and reliable.
00017 // However, NVIDIA Corporation assumes no responsibility for the consequences of use of such
00018 // information or for any infringement of patents or other rights of third parties that may
00019 // result from its use. No license is granted by implication or otherwise under any patent
00020 // or patent rights of NVIDIA Corporation. Details are subject to change without notice.
00021 // This code supersedes and replaces all information previously supplied.
00022 // NVIDIA Corporation products are not authorized for use as critical
00023 // components in life support devices or systems without express written approval of
00024 // NVIDIA Corporation.
00025 //
00026 // Copyright (c) 2008-2018 NVIDIA Corporation. All rights reserved.
00027 // Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
00028 // Copyright (c) 2001-2004 NovodeX AG. All rights reserved.  
00029 
00030 
00031 #ifndef PX_PHYSICS_NX_ARTICULATION_JOINT
00032 #define PX_PHYSICS_NX_ARTICULATION_JOINT
00033 
00036 #include "PxPhysXConfig.h"
00037 #include "common/PxBase.h"
00038 
00039 #if !PX_DOXYGEN
00040 namespace physx
00041 {
00042 #endif
00043 
00044 class PxArticulationJointImpl;
00045 
00059 struct PxArticulationJointDriveType
00060 {
00061     enum Enum
00062     {
00063         eNONE   = 0,
00064         eTARGET = 1,            // use the quaternion as the drive target
00065         eERROR  = 2,                // use the vector part of the quaternion as the drive error.
00066         eTARGETVELOCITY = 3
00067     };
00068 };
00069 
00070 struct PxArticulationAxis
00071 {
00072     enum Enum
00073     {
00074         eTWIST = 0,
00075         eSWING1 = 1,
00076         eSWING2 = 2,
00077         eX = 3,
00078         eY = 4,
00079         eZ = 5,
00080         eCOUNT = 6
00081     };
00082 };
00083 
00084 PX_FLAGS_OPERATORS(PxArticulationAxis::Enum, PxU8)
00085 
00086 struct PxArticulationMotion
00087 {
00088     enum Enum
00089     {
00090         eLOCKED = 0,
00091         eLIMITED = 1,
00092         eFREE = 2
00093     };
00094 };
00095 
00096 typedef PxFlags<PxArticulationMotion::Enum, PxU8> PxArticulationMotions;
00097 PX_FLAGS_OPERATORS(PxArticulationMotion::Enum, PxU8)
00098 
00099 struct PxArticulationJointType
00100 {
00101     enum Enum
00102     {
00103         ePRISMATIC = 0,
00104         eREVOLUTE = 1,
00105         eSPHERICAL = 2,
00106         eFIX = 3
00107     };
00108 };
00109 
00110 
00111 class PxArticulationJointBase : public PxBase
00112 {
00113 public:
00119     virtual     PxArticulationLink& getParentArticulationLink() const = 0;
00120 
00130     virtual     void            setParentPose(const PxTransform& pose) = 0;
00131 
00140     virtual     PxTransform     getParentPose() const = 0;
00141 
00147     virtual     PxArticulationLink& getChildArticulationLink() const = 0;
00148 
00149 
00159     virtual     void            setChildPose(const PxTransform& pose) = 0;
00160 
00168     virtual     PxTransform     getChildPose() const = 0;
00169 
00170     virtual     PxArticulationJointImpl* getImpl() = 0;
00171     virtual     const PxArticulationJointImpl* getImpl() const = 0;
00172 
00173     virtual                     ~PxArticulationJointBase() {}
00174 
00175 private:
00176 protected:
00177     PX_INLINE                   PxArticulationJointBase(PxType concreteType, PxBaseFlags baseFlags) : PxBase(concreteType, baseFlags) {}
00178     PX_INLINE                   PxArticulationJointBase(PxBaseFlags baseFlags) : PxBase(baseFlags) {}
00179     
00180     virtual     bool            isKindOf(const char* name)  const { return !::strcmp("PxArticulationJointBase", name) || PxBase::isKindOf(name); }
00181 };
00182 
00183 
00184 
00194 class PxArticulationJoint : public PxArticulationJointBase
00195 {
00196 public:
00197 
00210     virtual     void            setTargetOrientation(const PxQuat& orientation) = 0;
00211 
00219     virtual     PxQuat          getTargetOrientation() const = 0;
00220 
00231     virtual     void            setTargetVelocity(const PxVec3& velocity) = 0;
00232 
00240     virtual     PxVec3          getTargetVelocity() const = 0;
00241 
00242 
00251     virtual     void            setDriveType(PxArticulationJointDriveType::Enum driveType) = 0;
00252 
00260     virtual     PxArticulationJointDriveType::Enum
00261                                 getDriveType() const = 0;
00262 
00263 
00264     
00278     virtual     void            setStiffness(PxReal spring) = 0;
00279 
00287     virtual     PxReal          getStiffness() const = 0;
00288 
00289 
00303     virtual     void            setDamping(PxReal damping) = 0;
00304 
00311     virtual     PxReal          getDamping() const = 0;
00312 
00332     virtual     void            setInternalCompliance(PxReal compliance) = 0;
00333 
00334 
00342     virtual     PxReal          getInternalCompliance() const = 0;
00343 
00363     virtual     void            setExternalCompliance(PxReal compliance) = 0;
00364 
00372     virtual     PxReal          getExternalCompliance() const = 0;
00373 
00374 
00375 
00389     virtual     void            setSwingLimit(PxReal zLimit, PxReal yLimit) = 0;
00390 
00391 
00402     virtual     void            getSwingLimit(PxReal& zLimit, PxReal& yLimit) const = 0;
00403 
00404 
00405 
00412     virtual     void            setTangentialStiffness(PxReal spring) = 0;
00413 
00414 
00422     virtual     PxReal          getTangentialStiffness() const = 0;
00423 
00424 
00431     virtual     void            setTangentialDamping(PxReal damping) = 0;
00432 
00433 
00441     virtual     PxReal          getTangentialDamping() const = 0;
00442 
00443 
00455     virtual     void            setSwingLimitContactDistance(PxReal contactDistance) = 0;
00456 
00457 
00465     virtual     PxReal          getSwingLimitContactDistance() const = 0;
00466 
00467 
00468 
00477     virtual     void            setSwingLimitEnabled(bool enabled) = 0;
00478 
00487     virtual     bool            getSwingLimitEnabled() const = 0;
00488 
00489 
00502     virtual     void            setTwistLimit(PxReal lower, PxReal upper) = 0;
00503 
00513     virtual     void            getTwistLimit(PxReal &lower, PxReal &upper) const = 0;
00514 
00523     virtual     void            setTwistLimitEnabled(bool enabled) = 0;
00524 
00533     virtual     bool            getTwistLimitEnabled() const = 0;
00534 
00535 
00547     virtual     void            setTwistLimitContactDistance(PxReal contactDistance) = 0;
00548 
00549 
00557     virtual     PxReal          getTwistLimitContactDistance() const = 0;
00558 
00559     virtual     const char*     getConcreteTypeName() const                 {   return "PxArticulationJoint"; }
00560 
00561 protected:
00562     PX_INLINE                   PxArticulationJoint(PxType concreteType, PxBaseFlags baseFlags) : PxArticulationJointBase(concreteType, baseFlags) {}
00563     PX_INLINE                   PxArticulationJoint(PxBaseFlags baseFlags) : PxArticulationJointBase(baseFlags) {}
00564     virtual                     ~PxArticulationJoint() {}
00565     virtual     bool            isKindOf(const char* name)  const       {   return !::strcmp("PxArticulationJoint", name) || PxArticulationJointBase::isKindOf(name); }
00566 };
00567 
00568 #if !PX_DOXYGEN
00569 } // namespace physx
00570 #endif
00571 
00573 #endif


Copyright © 2008-2018 NVIDIA Corporation, 2701 San Tomas Expressway, Santa Clara, CA 95050 U.S.A. All rights reserved. www.nvidia.com