PxSphericalJoint.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 #ifndef PX_SPHERICALJOINT_H
31 #define PX_SPHERICALJOINT_H
32 
36 #include "extensions/PxJoint.h"
38 
39 #if !PX_DOXYGEN
40 namespace physx
41 {
42 #endif
43 
44 class PxSphericalJoint;
45 
57 PxSphericalJoint* PxSphericalJointCreate(PxPhysics& physics, PxRigidActor* actor0, const PxTransform& localFrame0, PxRigidActor* actor1, const PxTransform& localFrame1);
58 
59 
66 {
67  enum Enum
68  {
69  eLIMIT_ENABLED = 1<<1
70  };
71 };
73 PX_FLAGS_OPERATORS(PxSphericalJointFlag::Enum, PxU16)
74 
75 
89 class PxSphericalJoint : public PxJoint
90 {
91 public:
92 
103  virtual PxJointLimitCone getLimitCone() const = 0;
104 
112  virtual void setLimitCone(const PxJointLimitCone& limit) = 0;
113 
117  virtual PxReal getSwingYAngle() const = 0;
118 
122  virtual PxReal getSwingZAngle() const = 0;
123 
133  virtual void setSphericalJointFlags(PxSphericalJointFlags flags) = 0;
134 
143  virtual void setSphericalJointFlag(PxSphericalJointFlag::Enum flag, bool value) = 0;
144 
152  virtual PxSphericalJointFlags getSphericalJointFlags() const = 0;
153 
172  virtual void setProjectionLinearTolerance(PxReal tolerance) = 0;
173 
181  virtual PxReal getProjectionLinearTolerance() const = 0;
182 
186  virtual const char* getConcreteTypeName() const { return "PxSphericalJoint"; }
187 
188 protected:
189 
190  //serialization
191 
195  PX_INLINE PxSphericalJoint(PxType concreteType, PxBaseFlags baseFlags) : PxJoint(concreteType, baseFlags) {}
196 
200  PX_INLINE PxSphericalJoint(PxBaseFlags baseFlags) : PxJoint(baseFlags) {}
201 
205  virtual bool isKindOf(const char* name) const { return !::strcmp("PxSphericalJoint", name) || PxJoint::isKindOf(name); }
206 
207  //~serialization
208 };
209 
210 #if !PX_DOXYGEN
211 } // namespace physx
212 #endif
213 
215 #endif
Definition: GuContactBuffer.h:37
PX_INLINE PxSphericalJoint(PxType concreteType, PxBaseFlags baseFlags)
Constructor.
Definition: PxSphericalJoint.h:195
float PxReal
Definition: PxSimpleTypes.h:78
PX_INLINE PxSphericalJoint(PxBaseFlags baseFlags)
Deserialization constructor.
Definition: PxSphericalJoint.h:200
PxU16 PxType
Definition: PxBase.h:49
PxRigidActor represents a base class shared between dynamic and static rigid bodies in the physics SD...
Definition: PxRigidActor.h:58
a base interface providing common functionality for PhysX joints
Definition: PxJoint.h:101
virtual const char * getConcreteTypeName() const
Returns string name of PxSphericalJoint, used for serialization.
Definition: PxSphericalJoint.h:186
PxSphericalJoint * PxSphericalJointCreate(PxPhysics &physics, PxRigidActor *actor0, const PxTransform &localFrame0, PxRigidActor *actor1, const PxTransform &localFrame1)
Create a spherical joint.
virtual bool isKindOf(const char *name) const
Returns whether a given type name matches with the type of this instance.
Definition: PxJoint.h:376
PxU16 flags
a set of Px1DConstraintFlags
Definition: PxConstraintDesc.h:110
class representing a rigid euclidean transform as a quaternion and a vector
Definition: PxTransform.h:48
A joint which behaves in a similar way to a ball and socket.
Definition: PxSphericalJoint.h:89
PxFlags< PxSphericalJointFlag::Enum, PxU16 > PxSphericalJointFlags
Definition: PxSphericalJoint.h:72
Flags specific to the spherical joint.
Definition: PxSphericalJoint.h:65
Enum
Definition: PxSphericalJoint.h:67
Describes an elliptical conical joint limit. Note that very small or highly elliptical limit cones ma...
Definition: PxJointLimit.h:369
virtual bool isKindOf(const char *name) const
Returns whether a given type name matches with the type of this instance.
Definition: PxSphericalJoint.h:205
Container for bitfield flag variables associated with a specific enum type.
Definition: PxFlags.h:73
Abstract singleton factory class used for instancing objects in the Physics SDK.
Definition: PxPhysics.h:71
uint16_t PxU16
Definition: PxSimpleTypes.h:73
#define PX_INLINE
Definition: PxPreprocessor.h:336