- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class physx.NativeObject
NativeObject.Allocator<T> -
Field Summary
FieldsFields inherited from class physx.NativeObject
address, isExternallyAllocated, SIZEOF_BYTE, SIZEOF_DOUBLE, SIZEOF_FLOAT, SIZEOF_INT, SIZEOF_LONG, SIZEOF_POINTER, SIZEOF_SHORT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic PxRackAndPinionJointarrayGet(long baseAddress, int index) voiddestroy()floatgetRatio()Get the ratio.booleansetData(int nbRackTeeth, int nbPinionTeeth, float rackLength) Set the desired ratio indirectly.booleanSet the hinge & prismatic joints connected by the rack & pinion joint.voidsetRatio(float ratio) Set the desired ratio directly.static PxRackAndPinionJointwrapPointer(long address) Methods inherited from class physx.extensions.PxJoint
getConstraint, getConstraintFlags, getInvMassScale0, getInvMassScale1, getLocalPose, getName, getRelativeAngularVelocity, getRelativeLinearVelocity, getRelativeTransform, getScene, getUserData, setActors, setBreakForce, setConstraintFlag, setConstraintFlags, setInvMassScale0, setInvMassScale1, setLocalPose, setName, setUserDataMethods inherited from class physx.common.PxBase
getBaseFlags, getConcreteType, getConcreteTypeName, isReleasable, release, setBaseFlag, setBaseFlagsMethods inherited from class physx.NativeObject
checkNotNull, equals, getAddress, hashCode
-
Field Details
-
SIZEOF
public static final int SIZEOF -
ALIGNOF
public static final int ALIGNOF- See Also:
-
-
Constructor Details
-
PxRackAndPinionJoint
protected PxRackAndPinionJoint() -
PxRackAndPinionJoint
protected PxRackAndPinionJoint(long address)
-
-
Method Details
-
wrapPointer
-
arrayGet
-
destroy
public void destroy() -
setJoints
Set the hinge & prismatic joints connected by the rack & pinion joint.The passed hinge joint can be either PxRevoluteJoint, PxD6Joint or PxArticulationJointReducedCoordinate. The passed prismatic joint can be either PxPrismaticJoint or PxD6Joint.
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:
hinge- The hinge joint (pinion)prismatic- The prismatic joint (rack)- Returns:
- true if success
-
setRatio
public void setRatio(float ratio) 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.
Note: Calling this function resets the internal positional error correction term.
- Parameters:
ratio- Desired ratio between the hinge and the prismatic.
-
getRatio
public float getRatio()Get the ratio.- Returns:
- Current ratio
-
setData
public boolean setData(int nbRackTeeth, int nbPinionTeeth, float rackLength) 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:
nbRackTeeth- Number of teeth on the rack (cannot be zero)nbPinionTeeth- Number of teeth on the pinion (cannot be zero)rackLength- Length of the rack- Returns:
- true if success
-