RavEngine
Loading...
Searching...
No Matches
PxArticulationTendon.h
1// Redistribution and use in source and binary forms, with or without
2// modification, are permitted provided that the following conditions
3// are met:
4// * Redistributions of source code must retain the above copyright
5// notice, this list of conditions and the following disclaimer.
6// * Redistributions in binary form must reproduce the above copyright
7// notice, this list of conditions and the following disclaimer in the
8// documentation and/or other materials provided with the distribution.
9// * Neither the name of NVIDIA CORPORATION nor the names of its
10// contributors may be used to endorse or promote products derived
11// from this software without specific prior written permission.
12//
13// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
14// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
17// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24//
25// Copyright (c) 2008-2022 NVIDIA Corporation. All rights reserved.
26// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
27// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
28
29
30#ifndef PX_ARTICULATION_TENDON_H
31#define PX_ARTICULATION_TENDON_H
35#include "PxPhysXConfig.h"
36#include "common/PxBase.h"
37#include "solver/PxSolverDefs.h"
38
39#if !PX_DOXYGEN
40namespace physx
41{
42#endif
43 class PxArticulationSpatialTendon;
44 class PxArticulationFixedTendon;
45 class PxArticulationLink;
50 {
51 public:
52 PxReal lowLimit;
53 PxReal highLimit;
54 };
55
60 {
61
62 public:
63
64 virtual ~PxArticulationAttachment() {}
75 virtual void setRestLength(const PxReal restLength) = 0;
76
84 virtual PxReal getRestLength() const = 0;
85
96 virtual void setLimitParameters(const PxArticulationTendonLimit& parameters) = 0;
97
106
114 virtual void setRelativeOffset(const PxVec3& offset) = 0;
115
123 virtual PxVec3 getRelativeOffset() const = 0;
124
132 virtual void setCoefficient(const PxReal coefficient) = 0;
133
141 virtual PxReal getCoefficient() const = 0;
142
148 virtual PxArticulationLink* getLink() const = 0;
149
156
162 virtual bool isLeaf() const = 0;
163
172
181 virtual void release() = 0;
182
183 void* userData;
184
190 virtual const char* getConcreteTypeName() const { return "PxArticulationAttachment"; }
191
192 protected:
193
194 PX_INLINE PxArticulationAttachment(PxType concreteType, PxBaseFlags baseFlags) : PxBase(concreteType, baseFlags) {}
195 PX_INLINE PxArticulationAttachment(PxBaseFlags baseFlags) : PxBase(baseFlags) {}
196 };
197
198
203 {
204
205 public:
206
207 virtual ~PxArticulationTendonJoint() {}
208
221 virtual void setCoefficient(const PxArticulationAxis::Enum axis, const PxReal coefficient, const PxReal recipCoefficient) = 0;
222
232 virtual void getCoefficient(PxArticulationAxis::Enum& axis, PxReal& coefficient, PxReal& recipCoefficient) const = 0;
233
239 virtual PxArticulationLink* getLink() const = 0;
240
247
256
265 virtual void release() = 0;
266
267 void* userData;
268
274 virtual const char* getConcreteTypeName() const { return "PxArticulationTendonJoint"; }
275
276 protected:
277
278 PX_INLINE PxArticulationTendonJoint(PxType concreteType, PxBaseFlags baseFlags) : PxBase(concreteType, baseFlags) {}
279 PX_INLINE PxArticulationTendonJoint(PxBaseFlags baseFlags) : PxBase(baseFlags) {}
280 };
281
282
287 {
288 public:
297 virtual void setStiffness(const PxReal stiffness) = 0;
298
306 virtual PxReal getStiffness() const = 0;
307
316 virtual void setDamping(const PxReal damping) = 0;
317
325 virtual PxReal getDamping() const = 0;
326
337 virtual void setLimitStiffness(const PxReal stiffness) = 0;
338
348 virtual PxReal getLimitStiffness() const = 0;
349
362 virtual void setOffset(const PxReal offset, bool autowake = true) = 0;
363
371 virtual PxReal getOffset() const = 0;
372
381
391 virtual void release() = 0;
392
393 virtual ~PxArticulationTendon() {}
394
395 void* userData;
396
397 protected:
398 PX_INLINE PxArticulationTendon(PxType concreteType, PxBaseFlags baseFlags) : PxBase(concreteType, baseFlags) {}
399 PX_INLINE PxArticulationTendon(PxBaseFlags baseFlags) : PxBase(baseFlags) {}
400 };
401
413 {
414 public:
430 virtual PxArticulationAttachment* createAttachment(PxArticulationAttachment* parent, const PxReal coefficient, const PxVec3 relativeOffset, PxArticulationLink* link) = 0;
431
444 virtual PxU32 getAttachments(PxArticulationAttachment** userBuffer, PxU32 bufferSize, PxU32 startIndex = 0) const = 0;
445
451 virtual PxU32 getNbAttachments() const = 0;
452
458 virtual const char* getConcreteTypeName() const { return "PxArticulationSpatialTendon"; }
459
461
462 protected:
463 PX_INLINE PxArticulationSpatialTendon(PxType concreteType, PxBaseFlags baseFlags) : PxArticulationTendon(concreteType, baseFlags) {}
464 PX_INLINE PxArticulationSpatialTendon(PxBaseFlags baseFlags) : PxArticulationTendon(baseFlags) {}
465
466 };
467
478 {
479 public:
500 virtual PxArticulationTendonJoint* createTendonJoint(PxArticulationTendonJoint* parent, PxArticulationAxis::Enum axis, const PxReal coefficient, const PxReal recipCoefficient, PxArticulationLink* link) = 0;
501
514 virtual PxU32 getTendonJoints(PxArticulationTendonJoint** userBuffer, PxU32 bufferSize, PxU32 startIndex = 0) const = 0;
515
521 virtual PxU32 getNbTendonJoints() const = 0;
522
537 virtual void setRestLength(const PxReal restLength) = 0;
538
546 virtual PxReal getRestLength() const = 0;
547
557 virtual void setLimitParameters(const PxArticulationTendonLimit& parameter) = 0;
558
559
568
574 virtual const char* getConcreteTypeName() const { return "PxArticulationFixedTendon"; }
575
576 virtual ~PxArticulationFixedTendon() {}
577
578 protected:
579 PX_INLINE PxArticulationFixedTendon(PxType concreteType, PxBaseFlags baseFlags) : PxArticulationTendon(concreteType, baseFlags) {}
580 PX_INLINE PxArticulationFixedTendon(PxBaseFlags baseFlags) : PxArticulationTendon(baseFlags) {}
581 };
582
583#if !PX_DOXYGEN
584} // namespace physx
585#endif
586
588#endif
589
Defines a spatial tendon attachment point on a link.
Definition PxArticulationTendon.h:60
virtual const char * getConcreteTypeName() const
Returns the string name of the dynamic type.
Definition PxArticulationTendon.h:190
virtual void setLimitParameters(const PxArticulationTendonLimit &parameters)=0
Sets the low and high limit on the length of the sub-tendon from the root to this leaf attachment.
virtual PxArticulationTendonLimit getLimitParameters() const =0
Gets the low and high limit on the length of the sub-tendon from the root to this leaf attachment.
virtual PxVec3 getRelativeOffset() const =0
Gets the attachment's relative offset in the link actor frame.
void * userData
user can assign this to whatever, usually to create a 1:1 relationship with a user object.
Definition PxArticulationTendon.h:183
virtual bool isLeaf() const =0
Indicates that this attachment is a leaf, and thus defines a sub-tendon from the root to this attachm...
virtual void setCoefficient(const PxReal coefficient)=0
Sets the attachment coefficient.
virtual PxReal getCoefficient() const =0
Gets the attachment coefficient.
virtual void release()=0
Releases the attachment.
virtual PxReal getRestLength() const =0
Gets the spring rest length for the sub-tendon from the root to this leaf attachment.
virtual void setRestLength(const PxReal restLength)=0
Sets the spring rest length for the sub-tendon from the root to this leaf attachment.
virtual void setRelativeOffset(const PxVec3 &offset)=0
Sets the attachment's relative offset in the link actor frame.
virtual PxArticulationSpatialTendon * getTendon() const =0
Gets the spatial tendon that the attachment is a part of.
virtual PxArticulationLink * getLink() const =0
Gets the articulation link.
virtual PxArticulationAttachment * getParent() const =0
Gets the parent attachment.
A fixed tendon that can be used to link multiple degrees of freedom of multiple articulation joints v...
Definition PxArticulationTendon.h:478
virtual PxArticulationTendonLimit getLimitParameters() const =0
Gets the low and high limit on the length of the tendon.
virtual PxArticulationTendonJoint * createTendonJoint(PxArticulationTendonJoint *parent, PxArticulationAxis::Enum axis, const PxReal coefficient, const PxReal recipCoefficient, PxArticulationLink *link)=0
Creates an articulation tendon joint and adds it to the list of children in the parent tendon joint.
virtual void setRestLength(const PxReal restLength)=0
Sets the spring rest length of the tendon.
virtual const char * getConcreteTypeName() const
Returns the string name of the dynamic type.
Definition PxArticulationTendon.h:574
virtual void setLimitParameters(const PxArticulationTendonLimit &parameter)=0
Sets the low and high limit on the length of the tendon.
virtual PxU32 getNbTendonJoints() const =0
Returns the number of tendon joints in the tendon.
virtual PxU32 getTendonJoints(PxArticulationTendonJoint **userBuffer, PxU32 bufferSize, PxU32 startIndex=0) const =0
Fills a user-provided buffer of tendon-joint pointers with the set of tendon joints.
virtual PxReal getRestLength() const =0
Gets the spring rest length of the tendon.
A tree structure of bodies connected by joints that is treated as a unit by the dynamics solver....
Definition PxArticulationReducedCoordinate.h:448
A spatial tendon that attaches to an articulation.
Definition PxArticulationTendon.h:413
virtual const char * getConcreteTypeName() const
Returns the string name of the dynamic type.
Definition PxArticulationTendon.h:458
virtual PxU32 getAttachments(PxArticulationAttachment **userBuffer, PxU32 bufferSize, PxU32 startIndex=0) const =0
Fills a user-provided buffer of attachment pointers with the set of attachments.
virtual PxU32 getNbAttachments() const =0
Returns the number of attachments in the tendon.
virtual PxArticulationAttachment * createAttachment(PxArticulationAttachment *parent, const PxReal coefficient, const PxVec3 relativeOffset, PxArticulationLink *link)=0
Creates an articulation attachment and adds it to the list of children in the parent attachment.
Defines a fixed-tendon joint on an articulation joint degree of freedom.
Definition PxArticulationTendon.h:203
virtual void setCoefficient(const PxArticulationAxis::Enum axis, const PxReal coefficient, const PxReal recipCoefficient)=0
Sets the tendon joint coefficient.
virtual PxArticulationTendonJoint * getParent() const =0
Gets the parent tendon joint.
virtual const char * getConcreteTypeName() const
Returns the string name of the dynamic type.
Definition PxArticulationTendon.h:274
virtual PxArticulationFixedTendon * getTendon() const =0
Gets the tendon that the joint is a part of.
void * userData
user can assign this to whatever, usually to create a 1:1 relationship with a user object.
Definition PxArticulationTendon.h:267
virtual void getCoefficient(PxArticulationAxis::Enum &axis, PxReal &coefficient, PxReal &recipCoefficient) const =0
Gets the tendon joint coefficient.
virtual void release()=0
Releases a tendon joint.
virtual PxArticulationLink * getLink() const =0
Gets the articulation link.
Defines the low/high limits of the length of a tendon.
Definition PxArticulationTendon.h:50
Common API base class shared by PxArticulationSpatialTendon and PxArticulationFixedTendon.
Definition PxArticulationTendon.h:287
virtual void release()=0
Releases a tendon to remove it from the articulation and free its associated memory.
void * userData
user can assign this to whatever, usually to create a 1:1 relationship with a user object.
Definition PxArticulationTendon.h:395
virtual PxArticulationReducedCoordinate * getArticulation() const =0
Gets the articulation that the tendon is a part of.
virtual void setOffset(const PxReal offset, bool autowake=true)=0
Sets the length offset term for the tendon.
virtual PxReal getOffset() const =0
Gets the length offset term for the tendon.
virtual void setDamping(const PxReal damping)=0
Sets the damping term acting both on the tendon length and tendon-length limits.
virtual void setStiffness(const PxReal stiffness)=0
Sets the spring stiffness term acting on the tendon length.
virtual void setLimitStiffness(const PxReal stiffness)=0
Sets the limit stiffness term acting on the tendon's length limits.
virtual PxReal getLimitStiffness() const =0
Gets the limit stiffness term acting on the tendon's length limits.
virtual PxReal getStiffness() const =0
Gets the spring stiffness of the tendon.
virtual PxReal getDamping() const =0
Gets the damping term acting both on the tendon length and tendon-length limits.
Base class for objects that can be members of a PxCollection.
Definition PxBase.h:73
3 Element vector class.
Definition PxVec3.h:50
#define PX_INLINE
Definition PxPreprocessor.h:320
Sorts an array of objects in ascending order, assuming that the predicate implements the < operator:
Definition PxBoxController.h:39
Enum
Definition PxSolverDefs.h:252