-
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 PxConstraintarrayGet(long baseAddress, int index) getFlags()Retrieve the flags for this constraintvoidRetrieve the constraint force most recently applied to maintain this constraint.floatRetrieve the constraint break force and torque thresholdsgetScene()Retrieves the scene which this constraint belongs to.booleanisValid()whether the constraint is valid.voidNotify the scene that the constraint shader data has been updated by the applicationvoidsetActors(PxRigidActor actor0, PxRigidActor actor1) Sets the actors for this constraint.voidsetBreakForce(float linear, float angular) Set the break force and torque thresholds for this constraint.voidsetFlag(PxConstraintFlagEnum flag, boolean value) Set a flag for this constraintvoidsetFlags(PxConstraintFlags flags) Set the flags for this constraintvoidsetMinResponseThreshold(float threshold) Set the minimum response threshold for a constraint rowstatic PxConstraintwrapPointer(long address) Methods 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
-
PxConstraint
protected PxConstraint() -
PxConstraint
protected PxConstraint(long address)
-
-
Method Details
-
wrapPointer
-
arrayGet
-
getScene
Retrieves the scene which this constraint belongs to.- Returns:
- Owner Scene. NULL if not part of a scene.
- See Also:
-
setActors
Sets the actors for this constraint.- Parameters:
actor0- a reference to the pointer for the first actoractor1- a reference to the pointer for the second actor- See Also:
-
markDirty
public void markDirty()Notify the scene that the constraint shader data has been updated by the application -
setFlags
Set the flags for this constraint- Parameters:
flags- the new constraint flagsdefault: PxConstraintFlag::eDRIVE_LIMITS_ARE_FORCES
- See Also:
-
getFlags
Retrieve the flags for this constraint- Returns:
- the constraint flags
- See Also:
-
setFlag
Set a flag for this constraint- Parameters:
flag- the constraint flagvalue- the new value of the flag- See Also:
-
getForce
Retrieve the constraint force most recently applied to maintain this constraint.Note: It is not allowed to use this method while the simulation is running (except during PxScene::collide(), in PxContactModifyCallback or in contact report callbacks).
- Parameters:
linear- the constraint forceangular- the constraint torque
-
isValid
public boolean isValid()whether the constraint is valid.A constraint is valid if it has at least one dynamic rigid body or articulation link. A constraint that is not valid may not be inserted into a scene, and therefore a static actor to which an invalid constraint is attached may not be inserted into a scene.
Invalid constraints arise only when an actor to which the constraint is attached has been deleted.
-
setBreakForce
public void setBreakForce(float linear, float angular) Set the break force and torque thresholds for this constraint.If either the force or torque measured at the constraint exceed these thresholds the constraint will break.
- Parameters:
linear- the linear break thresholdangular- the angular break threshold
-
setMinResponseThreshold
public void setMinResponseThreshold(float threshold) Set the minimum response threshold for a constraint rowWhen using mass modification for a joint or infinite inertia for a jointed body, very stiff solver constraints can be generated which can destabilize simulation. Setting this value to a small positive value (e.g. 1e-8) will cause constraint rows to be ignored if very large changes in impulses will generate only small changes in velocity. When setting this value, also set PxConstraintFlag::eDISABLE_PREPROCESSING. The solver accuracy for this joint may be reduced.
- Parameters:
threshold- the minimum response threshold
-
getMinResponseThreshold
public float getMinResponseThreshold()Retrieve the constraint break force and torque thresholds- Returns:
- the minimum response threshold for a constraint row
-