| 1 | /* |
| 2 | * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. |
| 3 | * |
| 4 | * NVIDIA CORPORATION and its licensors retain all intellectual property |
| 5 | * and proprietary rights in and to this software, related documentation |
| 6 | * and any modifications thereto. Any use, reproduction, disclosure or |
| 7 | * distribution of this software and related documentation without an express |
| 8 | * license agreement from NVIDIA CORPORATION is strictly prohibited. |
| 9 | */ |
| 10 | // Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved. |
| 11 | // Copyright (c) 2001-2004 NovodeX AG. All rights reserved. |
| 12 | |
| 13 | |
| 14 | #ifndef PX_PHYSICS_NX_ARTICULATION_LINK |
| 15 | #define PX_PHYSICS_NX_ARTICULATION_LINK |
| 16 | /** \addtogroup physics |
| 17 | @{ */ |
| 18 | |
| 19 | #include "PxPhysXConfig.h" |
| 20 | #include "PxArticulationJoint.h" |
| 21 | #include "PxRigidBody.h" |
| 22 | |
| 23 | #ifndef PX_DOXYGEN |
| 24 | namespace physx |
| 25 | { |
| 26 | #endif |
| 27 | |
| 28 | /** |
| 29 | \brief a component of an articulation that represents a rigid body |
| 30 | |
| 31 | A limited subset of the properties of PxRigidDynamic are supported. In particular, sleep properties |
| 32 | are attributes of the articulation rather than each individual body, damping and velocity limits |
| 33 | are not supported, and links may not be kinematic. |
| 34 | |
| 35 | @see PxArticulation PxArticulation.createLink PxArticulationJoint PxRigidBody |
| 36 | */ |
| 37 | |
| 38 | class PxArticulationLink : public PxRigidBody |
| 39 | { |
| 40 | public: |
| 41 | /** |
| 42 | \brief Deletes the articulation link. |
| 43 | |
| 44 | \note Only a leaf articulation link can be released |
| 45 | |
| 46 | Do not keep a reference to the deleted instance. |
| 47 | |
| 48 | @see PxArticulation::createLink() |
| 49 | */ |
| 50 | virtual void release() = 0; |
| 51 | |
| 52 | |
| 53 | /** |
| 54 | \brief get the articulation to which this articulation link belongs |
| 55 | |
| 56 | \return the articulation to which this link belongs |
| 57 | */ |
| 58 | virtual PxArticulation& getArticulation() const = 0; |
| 59 | |
| 60 | /** |
| 61 | \brief Get the joint which connects this link to its parent. |
| 62 | |
| 63 | \return The joint connecting the link to the parent. NULL for the root link. |
| 64 | |
| 65 | @see PxArticulationJoint |
| 66 | */ |
| 67 | virtual PxArticulationJoint* getInboundJoint() const = 0; |
| 68 | |
| 69 | /** |
| 70 | \brief Get number of child links. |
| 71 | |
| 72 | \return the number of child links |
| 73 | |
| 74 | @see getChildren() |
| 75 | */ |
| 76 | virtual PxU32 getNbChildren() const = 0; |
| 77 | |
| 78 | /** |
| 79 | \brief Retrieve all the child links. |
| 80 | |
| 81 | \param[out] userBuffer The buffer to receive articulation link pointers. |
| 82 | \param[in] bufferSize Size of provided user buffer. |
| 83 | \return Number of articulation links written to the buffer. |
| 84 | |
| 85 | @see getNbChildren() |
| 86 | */ |
| 87 | virtual PxU32 getChildren(PxArticulationLink** userBuffer, PxU32 bufferSize) const = 0; |
| 88 | |
| 89 | virtual const char* getConcreteTypeName() const { return "PxArticulationLink" ; } |
| 90 | |
| 91 | protected: |
| 92 | PX_INLINE PxArticulationLink(PxType concreteType, PxBaseFlags baseFlags) : PxRigidBody(concreteType, baseFlags) {} |
| 93 | PX_INLINE PxArticulationLink(PxBaseFlags baseFlags) : PxRigidBody(baseFlags) {} |
| 94 | virtual ~PxArticulationLink() {} |
| 95 | virtual bool isKindOf(const char* name) const { return !strcmp("PxArticulationLink" , name) || PxRigidBody::isKindOf(name); } |
| 96 | }; |
| 97 | |
| 98 | PX_DEPRECATED PX_INLINE PxArticulationLink* PxActor::isArticulationLink() { return is<PxArticulationLink>(); } |
| 99 | PX_DEPRECATED PX_INLINE const PxArticulationLink* PxActor::isArticulationLink() const { return is<PxArticulationLink>(); } |
| 100 | |
| 101 | |
| 102 | #ifndef PX_DOXYGEN |
| 103 | } // namespace physx |
| 104 | #endif |
| 105 | |
| 106 | /** @} */ |
| 107 | #endif |
| 108 | |