RavEngine
Loading...
Searching...
No Matches
PxArticulationJointReducedCoordinate.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#ifndef PX_ARTICULATION_JOINT_RC_H
30#define PX_ARTICULATION_JOINT_RC_H
34#include "PxPhysXConfig.h"
35#include "common/PxBase.h"
36#include "solver/PxSolverDefs.h"
37
38#if !PX_DOXYGEN
39namespace physx
40{
41#endif
42
49 {
50 public:
51
58
69 virtual void setParentPose(const PxTransform& pose) = 0;
70
78 virtual PxTransform getParentPose() const = 0;
79
86
97 virtual void setChildPose(const PxTransform& pose) = 0;
98
106 virtual PxTransform getChildPose() const = 0;
107
118 virtual void setJointType(PxArticulationJointType::Enum jointType) = 0;
119
128
141
152
174 PX_DEPRECATED PX_FORCE_INLINE void setLimit(PxArticulationAxis::Enum axis, const PxReal lowLimit, const PxReal highLimit)
175 {
176 setLimitParams(axis, PxArticulationLimit(lowLimit, highLimit));
177 }
178
190 PX_DEPRECATED PX_FORCE_INLINE void getLimit(PxArticulationAxis::Enum axis, PxReal& lowLimit, PxReal& highLimit) const
191 {
193 lowLimit = pair.low;
194 highLimit = pair.high;
195 }
196
213 virtual void setLimitParams(PxArticulationAxis::Enum axis, const PxArticulationLimit& limit) = 0;
214
225
249 PX_DEPRECATED PX_FORCE_INLINE void setDrive(PxArticulationAxis::Enum axis, const PxReal stiffness, const PxReal damping, const PxReal maxForce, PxArticulationDriveType::Enum driveType = PxArticulationDriveType::eFORCE)
250 {
251 setDriveParams(axis, PxArticulationDrive(stiffness, damping, maxForce, driveType));
252 }
253
267 PX_DEPRECATED PX_FORCE_INLINE void getDrive(PxArticulationAxis::Enum axis, PxReal& stiffness, PxReal& damping, PxReal& maxForce, PxArticulationDriveType::Enum& driveType) const
268 {
270 stiffness = drive.stiffness;
271 damping = drive.damping;
272 maxForce = drive.maxForce;
273 driveType = drive.driveType;
274 }
275
288 virtual void setDriveParams(PxArticulationAxis::Enum axis, const PxArticulationDrive& drive) = 0;
289
299
320 virtual void setDriveTarget(PxArticulationAxis::Enum axis, const PxReal target, bool autowake = true) = 0;
321
331 virtual PxReal getDriveTarget(PxArticulationAxis::Enum axis) const = 0;
332
347 virtual void setDriveVelocity(PxArticulationAxis::Enum axis, const PxReal targetVel, bool autowake = true) = 0;
348
358 virtual PxReal getDriveVelocity(PxArticulationAxis::Enum axis) const = 0;
359
373 virtual void setArmature(PxArticulationAxis::Enum axis, const PxReal armature) = 0;
374
383 virtual PxReal getArmature(PxArticulationAxis::Enum axis) const = 0;
384
400 virtual void setFrictionCoefficient(const PxReal coefficient) = 0;
401
409 virtual PxReal getFrictionCoefficient() const = 0;
410
423 virtual void setMaxJointVelocity(const PxReal maxJointV) = 0;
424
432 virtual PxReal getMaxJointVelocity() const = 0;
433
454 virtual void setJointPosition(PxArticulationAxis::Enum axis, const PxReal jointPos) = 0;
455
470 virtual PxReal getJointPosition(PxArticulationAxis::Enum axis) const = 0;
471
486 virtual void setJointVelocity(PxArticulationAxis::Enum axis, const PxReal jointVel) = 0;
487
502 virtual PxReal getJointVelocity(PxArticulationAxis::Enum axis) const = 0;
503
509 virtual const char* getConcreteTypeName() const { return "PxArticulationJointReducedCoordinate"; }
510
512
513 //public variables:
514 void* userData;
515
516 protected:
517 PX_INLINE PxArticulationJointReducedCoordinate(PxType concreteType, PxBaseFlags baseFlags) : PxBase(concreteType, baseFlags) {}
519
520 virtual bool isKindOf(const char* name) const { return !::strcmp("PxArticulationJointReducedCoordinate", name) || PxBase::isKindOf(name); }
521 };
522
523#if !PX_DOXYGEN
524} // namespace physx
525#endif
526
528#endif
A joint between two links in an articulation.
Definition PxArticulationJointReducedCoordinate.h:49
virtual void setParentPose(const PxTransform &pose)=0
Sets the joint pose in the parent link actor frame.
virtual PxTransform getChildPose() const =0
Gets the joint pose in the child link actor frame.
virtual void setDriveTarget(PxArticulationAxis::Enum axis, const PxReal target, bool autowake=true)=0
Sets the joint drive position target for the given axis.
virtual PxReal getDriveVelocity(PxArticulationAxis::Enum axis) const =0
Returns the joint drive velocity target for the given axis.
virtual void setDriveParams(PxArticulationAxis::Enum axis, const PxArticulationDrive &drive)=0
Configures a joint drive for the given axis.
PX_DEPRECATED PX_FORCE_INLINE void setDrive(PxArticulationAxis::Enum axis, const PxReal stiffness, const PxReal damping, const PxReal maxForce, PxArticulationDriveType::Enum driveType=PxArticulationDriveType::eFORCE)
Configures a joint drive for the given axis.
Definition PxArticulationJointReducedCoordinate.h:249
virtual PxArticulationLink & getParentArticulationLink() const =0
Gets the parent articulation link of this joint.
virtual PxReal getFrictionCoefficient() const =0
Gets the joint friction coefficient.
PX_DEPRECATED PX_FORCE_INLINE void setLimit(PxArticulationAxis::Enum axis, const PxReal lowLimit, const PxReal highLimit)
Sets the joint limits for a given axis.
Definition PxArticulationJointReducedCoordinate.h:174
virtual void setChildPose(const PxTransform &pose)=0
Sets the joint pose in the child link actor frame.
virtual PxArticulationLimit getLimitParams(PxArticulationAxis::Enum axis) const =0
Returns the joint limits for a given axis.
virtual PxReal getJointVelocity(PxArticulationAxis::Enum axis) const =0
Gets the joint velocity for the given axis.
virtual PxArticulationLink & getChildArticulationLink() const =0
Gets the child articulation link of this joint.
virtual void setLimitParams(PxArticulationAxis::Enum axis, const PxArticulationLimit &limit)=0
Sets the joint limits for a given axis.
virtual void setArmature(PxArticulationAxis::Enum axis, const PxReal armature)=0
Sets the joint armature for the given axis.
virtual void setMotion(PxArticulationAxis::Enum axis, PxArticulationMotion::Enum motion)=0
Sets the joint motion for a given axis.
virtual void setJointType(PxArticulationJointType::Enum jointType)=0
Sets the joint type (e.g. revolute).
virtual void setJointVelocity(PxArticulationAxis::Enum axis, const PxReal jointVel)=0
Sets the joint velocity for the given axis.
virtual PxArticulationJointType::Enum getJointType() const =0
Gets the joint type.
virtual void setDriveVelocity(PxArticulationAxis::Enum axis, const PxReal targetVel, bool autowake=true)=0
Sets the joint drive velocity target for the given axis.
PX_DEPRECATED PX_FORCE_INLINE void getDrive(PxArticulationAxis::Enum axis, PxReal &stiffness, PxReal &damping, PxReal &maxForce, PxArticulationDriveType::Enum &driveType) const
Gets the joint drive configuration for the given axis.
Definition PxArticulationJointReducedCoordinate.h:267
void * userData
The user can assign this to whatever, usually to create a 1:1 relationship with a user object.
Definition PxArticulationJointReducedCoordinate.h:514
virtual PxReal getMaxJointVelocity() const =0
Gets the maximal joint velocity enforced for all axes.
virtual PxReal getJointPosition(PxArticulationAxis::Enum axis) const =0
Gets the joint position for the given axis, i.e. joint degree of freedom (DOF).
virtual bool isKindOf(const char *name) const
Returns whether a given type name matches with the type of this instance.
Definition PxArticulationJointReducedCoordinate.h:520
virtual void setMaxJointVelocity(const PxReal maxJointV)=0
Sets the maximal joint velocity enforced for all axes.
virtual void setJointPosition(PxArticulationAxis::Enum axis, const PxReal jointPos)=0
Sets the joint position for the given axis.
virtual PxArticulationMotion::Enum getMotion(PxArticulationAxis::Enum axis) const =0
Returns the joint motion for the given axis.
virtual PxReal getArmature(PxArticulationAxis::Enum axis) const =0
Gets the joint armature for the given axis.
virtual void setFrictionCoefficient(const PxReal coefficient)=0
Sets the joint friction coefficient, which applies to all joint axes.
virtual PxTransform getParentPose() const =0
Gets the joint pose in the parent link actor frame.
virtual PxReal getDriveTarget(PxArticulationAxis::Enum axis) const =0
Returns the joint drive position target for the given axis.
virtual const char * getConcreteTypeName() const
Returns the string name of the dynamic type.
Definition PxArticulationJointReducedCoordinate.h:509
virtual PxArticulationDrive getDriveParams(PxArticulationAxis::Enum axis) const =0
Gets the joint drive configuration for the given axis.
PX_DEPRECATED PX_FORCE_INLINE void getLimit(PxArticulationAxis::Enum axis, PxReal &lowLimit, PxReal &highLimit) const
Returns the joint limits for a given axis.
Definition PxArticulationJointReducedCoordinate.h:190
Base class for objects that can be members of a PxCollection.
Definition PxBase.h:73
virtual bool isKindOf(const char *superClass) const
Returns whether a given type name matches with the type of this instance.
Definition PxBase.h:179
class representing a rigid euclidean transform as a quaternion and a vector
Definition PxTransform.h:49
#define PX_FORCE_INLINE
Definition PxPreprocessor.h:335
#define PX_INLINE
Definition PxPreprocessor.h:320
#define PX_DEPRECATED
Definition PxPreprocessor.h:418
Sorts an array of objects in ascending order, assuming that the predicate implements the < operator:
Definition PxBoxController.h:39
Enum
Definition PxSolverDefs.h:252
Enum
Definition PxSolverDefs.h:308
@ eFORCE
The output of the implicit spring drive controller is a force/torque.
Definition PxSolverDefs.h:309
Data structure for articulation joint drive configuration.
Definition PxSolverDefs.h:359
PxArticulationDriveType::Enum driveType
The drive type.
Definition PxSolverDefs.h:414
PxReal stiffness
The drive stiffness, i.e. the proportional gain of the implicit PD controller.
Definition PxSolverDefs.h:381
PxReal damping
The drive damping, i.e. the derivative gain of the implicit PD controller.
Definition PxSolverDefs.h:394
PxReal maxForce
The drive force limit.
Definition PxSolverDefs.h:407
Enum
Definition PxSolverDefs.h:281
Data structure to set articulation joint limits.
Definition PxSolverDefs.h:327
PxReal high
The higher limit on the joint axis position.
Definition PxSolverDefs.h:350
PxReal low
The lower limit on the joint axis position.
Definition PxSolverDefs.h:342
Enum
Definition PxSolverDefs.h:268