PxJointLinearLimitPair
Defined in include/extensions/PxJointLimit.h
-
class PxJointLinearLimitPair : public PxJointLimitParameters
Describes a two-sided limit.
Public Functions
-
inline PxJointLinearLimitPair(const PxTolerancesScale &scale, PxReal lowerLimit = -PX_MAX_F32 / 3.0f, PxReal upperLimit = PX_MAX_F32 / 3.0f)
Construct a linear hard limit pair.
The lower distance value must be less than the upper distance value.
See also
- Parameters
scale – [in] A PxTolerancesScale struct. Should be the same as used when creating the PxPhysics object.
lowerLimit – [in] The lower distance of the limit
upperLimit – [in] The upper distance of the limit
-
inline PxJointLinearLimitPair(PxReal lowerLimit, PxReal upperLimit, const PxSpring &spring)
construct a linear soft limit pair
See also
- Parameters
lowerLimit – [in] The lower distance of the limit
upperLimit – [in] The upper distance of the limit
spring – [in] The stiffness and damping parameters of the limit spring
-
inline bool isValid() const
Returns true if the limit is valid.
- Returns
true if the current settings are valid
-
inline bool isSoft() const
Public Members
-
PxReal upper
the range of the limit.
The upper limit must be no lower than the lower limit, and if they are equal the limited degree of freedom will be treated as locked.
Range: See the joint on which the limit is used for detailsDefault: lower = -PX_MAX_F32/3, upper = PX_MAX_F32/3
-
PxReal restitution
Controls the amount of bounce when the joint hits a limit.
A restitution value of 1.0 causes the joint to bounce back with the velocity which it hit the limit. A value of zero causes the joint to stop dead.
In situations where the joint has many locked DOFs (e.g. 5) the restitution may not be applied correctly. This is due to a limitation in the solver which causes the restitution velocity to become zero as the solver enforces constraints on the other DOFs.
This limitation applies to both angular and linear limits, however it is generally most apparent with limited angular DOFs. Disabling joint projection and increasing the solver iteration count may improve this behavior to some extent.
Also, combining soft joint limits with joint drives driving against those limits may affect stability.
Range: [0,1]Default: 0.0
-
inline PxJointLinearLimitPair(const PxTolerancesScale &scale, PxReal lowerLimit = -PX_MAX_F32 / 3.0f, PxReal upperLimit = PX_MAX_F32 / 3.0f)