RavEngine
Loading...
Searching...
No Matches
physx::PxRackAndPinionJoint Class Referenceabstract

A joint that connects an existing revolute joint to an existing prismatic joint, and constrains their relative angular/linear velocity and position with respect to each other. More...

#include <PxRackAndPinionJoint.h>

Inheritance diagram for physx::PxRackAndPinionJoint:
[legend]
Collaboration diagram for physx::PxRackAndPinionJoint:
[legend]

Public Member Functions

virtual bool setJoints (const PxBase *hinge, const PxBase *prismatic)=0
 Set the hinge & prismatic joints connected by the rack & pinion joint.
 
virtual void setRatio (float ratio)=0
 Set the desired ratio directly.
 
virtual float getRatio () const =0
 Get the ratio.
 
virtual bool setData (PxU32 nbRackTeeth, PxU32 nbPinionTeeth, float rackLength)=0
 Set the desired ratio indirectly.
 
virtual const char * getConcreteTypeName () const
 Returns string name of dynamic type.
 
- Public Member Functions inherited from physx::PxJoint
virtual void setActors (PxRigidActor *actor0, PxRigidActor *actor1)=0
 Set the actors for this joint.
 
virtual void getActors (PxRigidActor *&actor0, PxRigidActor *&actor1) const =0
 Get the actors for this joint.
 
virtual void setLocalPose (PxJointActorIndex::Enum actor, const PxTransform &localPose)=0
 Set the joint local pose for an actor.
 
virtual PxTransform getLocalPose (PxJointActorIndex::Enum actor) const =0
 get the joint local pose for an actor.
 
virtual PxTransform getRelativeTransform () const =0
 get the relative pose for this joint
 
virtual PxVec3 getRelativeLinearVelocity () const =0
 get the relative linear velocity of the joint
 
virtual PxVec3 getRelativeAngularVelocity () const =0
 get the relative angular velocity of the joint
 
virtual void setBreakForce (PxReal force, PxReal torque)=0
 set the break force for this joint.
 
virtual void getBreakForce (PxReal &force, PxReal &torque) const =0
 get the break force for this joint.
 
virtual void setConstraintFlags (PxConstraintFlags flags)=0
 set the constraint flags for this joint.
 
virtual void setConstraintFlag (PxConstraintFlag::Enum flag, bool value)=0
 set a constraint flags for this joint to a specified value.
 
virtual PxConstraintFlags getConstraintFlags () const =0
 get the constraint flags for this joint.
 
virtual void setInvMassScale0 (PxReal invMassScale)=0
 set the inverse mass scale for actor0.
 
virtual PxReal getInvMassScale0 () const =0
 get the inverse mass scale for actor0.
 
virtual void setInvInertiaScale0 (PxReal invInertiaScale)=0
 set the inverse inertia scale for actor0.
 
virtual PxReal getInvInertiaScale0 () const =0
 get the inverse inertia scale for actor0.
 
virtual void setInvMassScale1 (PxReal invMassScale)=0
 set the inverse mass scale for actor1.
 
virtual PxReal getInvMassScale1 () const =0
 get the inverse mass scale for actor1.
 
virtual void setInvInertiaScale1 (PxReal invInertiaScale)=0
 set the inverse inertia scale for actor1.
 
virtual PxReal getInvInertiaScale1 () const =0
 get the inverse inertia scale for actor1.
 
virtual PxConstraint * getConstraint () const =0
 Retrieves the PxConstraint corresponding to this joint.
 
virtual void setName (const char *name)=0
 Sets a name string for the object that can be retrieved with getName().
 
virtual const char * getName () const =0
 Retrieves the name string set with setName().
 
virtual void release ()=0
 Deletes the joint.
 
virtual PxScene * getScene () const =0
 Retrieves the scene which this joint belongs to.
 
- Public Member Functions inherited from physx::PxBase
template<class T >
T * is ()
 
template<class T >
const T * is () const
 
PX_FORCE_INLINE PxType getConcreteType () const
 Returns concrete type of object.
 
PX_FORCE_INLINE void setBaseFlag (PxBaseFlag::Enum flag, bool value)
 Set PxBaseFlag

 
PX_FORCE_INLINE void setBaseFlags (PxBaseFlags inFlags)
 Set PxBaseFlags

 
PX_FORCE_INLINE PxBaseFlags getBaseFlags () const
 Returns PxBaseFlags.
 
virtual bool isReleasable () const
 Whether the object is subordinate.
 

Protected Member Functions

PX_INLINE PxRackAndPinionJoint (PxType concreteType, PxBaseFlags baseFlags)
 
PX_INLINE PxRackAndPinionJoint (PxBaseFlags baseFlags)
 
virtual bool isKindOf (const char *name) const
 Returns whether a given type name matches with the type of this instance.
 
- Protected Member Functions inherited from physx::PxJoint
PX_INLINE PxJoint (PxType concreteType, PxBaseFlags baseFlags)
 Constructor.
 
PX_INLINE PxJoint (PxBaseFlags baseFlags)
 Deserialization constructor.
 
- Protected Member Functions inherited from physx::PxBase
PX_INLINE PxBase (PxType concreteType, PxBaseFlags baseFlags)
 Constructor setting concrete type and base flags.
 
PX_INLINE PxBase (PxBaseFlags baseFlags)
 Deserialization constructor setting base flags.
 
virtual ~PxBase ()
 Destructor.
 
template<class T >
bool typeMatch () const
 

Additional Inherited Members

- Static Public Member Functions inherited from physx::PxJoint
static void getBinaryMetaData (PxOutputStream &stream)
 Put class meta data in stream, used for serialization.
 
- Public Attributes inherited from physx::PxJoint
void * userData
 user can assign this to whatever, usually to create a 1:1 relationship with a user object.
 
- Protected Attributes inherited from physx::PxBase
PxType mConcreteType
 
PxBaseFlags mBaseFlags
 
PxU32 mBuiltInRefCount
 

Detailed Description

A joint that connects an existing revolute joint to an existing prismatic joint, and constrains their relative angular/linear velocity and position with respect to each other.

See also
PxRackAndPinionJointCreate PxJoint

Member Function Documentation

◆ getConcreteTypeName()

virtual const char * physx::PxRackAndPinionJoint::getConcreteTypeName ( ) const
inlinevirtual

Returns string name of dynamic type.

Returns
Class name of most derived type of this object.

Implements physx::PxBase.

◆ getRatio()

virtual float physx::PxRackAndPinionJoint::getRatio ( ) const
pure virtual

Get the ratio.

Returns
Current ratio

◆ isKindOf()

virtual bool physx::PxRackAndPinionJoint::isKindOf ( const char *  name) const
inlineprotectedvirtual

Returns whether a given type name matches with the type of this instance.

Reimplemented from physx::PxJoint.

◆ setData()

virtual bool physx::PxRackAndPinionJoint::setData ( PxU32  nbRackTeeth,
PxU32  nbPinionTeeth,
float  rackLength 
)
pure virtual

Set the desired ratio indirectly.

This is a simple helper function that computes the ratio from passed data:

ratio = (PI*2*nbRackTeeth)/(rackLength*nbPinionTeeth)

Note
Calling this function resets the internal positional error correction term.
Parameters
[in]nbRackTeethNumber of teeth on the rack (cannot be zero)
[in]nbPinionTeethNumber of teeth on the pinion (cannot be zero)
[in]rackLengthLength of the rack
Returns
true if success

◆ setJoints()

virtual bool physx::PxRackAndPinionJoint::setJoints ( const PxBase *  hinge,
const PxBase *  prismatic 
)
pure virtual

Set the hinge & prismatic joints connected by the rack & pinion joint.

The passed hinge joint can be either PxRevoluteJoint, PxD6Joint or PxArticulationJointReducedCoordinate. It cannot be null. The passed prismatic joint can be either PxPrismaticJoint or PxD6Joint. It cannot be null.

Note that these joints are only used to compute the positional error correction term, used to adjust potential drift between jointed actors. The rack & pinion joint can run without calling this function, but in that case some visible overlap may develop over time between the teeth of the rack & pinion meshes.

Note
Calling this function resets the internal positional error correction term.
Parameters
[in]hingeThe hinge joint (pinion)
[in]prismaticThe prismatic joint (rack)
Returns
true if success

◆ setRatio()

virtual void physx::PxRackAndPinionJoint::setRatio ( float  ratio)
pure virtual

Set the desired ratio directly.

Note
You may need to use a negative gear ratio if the joint frames of involved actors are not oriented in the same direction.
Calling this function resets the internal positional error correction term.
Parameters
[in]ratioDesired ratio between the hinge and the prismatic.

The documentation for this class was generated from the following file: