- 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 PxGearJointarrayGet(long baseAddress, int index) voiddestroy()floatGet the gear ratio.voidsetGearRatio(float ratio) Set the desired gear ratio.booleanSet the hinge/revolute joints connected by the gear joint.static PxGearJointwrapPointer(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
-
PxGearJoint
protected PxGearJoint() -
PxGearJoint
protected PxGearJoint(long address)
-
-
Method Details
-
wrapPointer
-
arrayGet
-
destroy
public void destroy() -
setHinges
Set the hinge/revolute joints connected by the gear joint.The passed joints can be either PxRevoluteJoint, PxD6Joint or PxArticulationJointReducedCoordinate. The joints must define degrees of freedom around the twist axis.
Note that these joints are only used to compute the positional error correction term, used to adjust potential drift between jointed actors. The gear joint can run without calling this function, but in that case some visible overlap may develop over time between the teeth of the gear meshes.
Note: Calling this function resets the internal positional error correction term.
- Parameters:
hinge0- The first hinge jointhinge1- The second hinge joint- Returns:
- true if success
-
setGearRatio
public void setGearRatio(float ratio) Set the desired gear ratio.For two gears with n0 and n1 teeth respectively, the gear ratio is n0/n1.
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 two hinges.
-
getGearRatio
public float getGearRatio()Get the gear ratio.- Returns:
- Current ratio
-