- Direct Known Subclasses:
PxArticulationLink,PxRigidDynamic
- 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 TypeMethodDescriptionvoidApplies a force (or impulse) defined in the global coordinate frame to the actor at its center of mass.voidaddForce(PxVec3 force, PxForceModeEnum mode) Applies a force (or impulse) defined in the global coordinate frame to the actor at its center of mass.voidaddForce(PxVec3 force, PxForceModeEnum mode, boolean autowake) Applies a force (or impulse) defined in the global coordinate frame to the actor at its center of mass.voidApplies an impulsive torque defined in the global coordinate frame to the actor.voidaddTorque(PxVec3 torque, PxForceModeEnum mode) Applies an impulsive torque defined in the global coordinate frame to the actor.voidaddTorque(PxVec3 torque, PxForceModeEnum mode, boolean autowake) Applies an impulsive torque defined in the global coordinate frame to the actor.static PxRigidBodyarrayGet(long baseAddress, int index) voidclearForce(PxForceModeEnum mode) Clears the accumulated forces (sets the accumulated force back to zero).voidclearTorque(PxForceModeEnum mode) Clears the impulsive torque defined in the global coordinate frame to the actor.floatRetrieves the angular damping coefficient.Retrieves the angular velocity of the actor.Retrieves the center of mass pose relative to the actor frame.floatReturns the contact slop coefficient.floatRetrieves the inverse mass of the actor.floatRetrieves the linear damping coefficient.Retrieves the linear velocity of an actor.floatgetMass()Retrieves the mass of the actor.Retrieves the diagonal inertia tensor of the actor relative to the mass coordinate frame.Retrieves the diagonal inverse inertia tensor of the actor relative to the mass coordinate frame.floatRetrieves the maximum angular velocity permitted for this actor.floatReturns the maximum impulse that may be applied at a contact.floatReturns the maximum depenetration velocity the solver is permitted to introduced.floatRetrieves the maximum angular velocity permitted for this actor.floatGets the CCD minimum advance coefficient.Reads the PxRigidBody flags.voidsetAngularDamping(float angDamp) Sets the angular damping coefficient.voidsetCMassLocalPose(PxTransform pose) Sets the pose of the center of mass relative to the actor.voidsetContactSlopCoefficient(float slopCoefficient) Sets a distance scale whereby the angular influence of a contact on the normal constraint in a contact is zeroed if normal.cross(offset) falls below this tolerance.voidsetForceAndTorque(PxVec3 force, PxVec3 torque) Sets the impulsive force and torque defined in the global coordinate frame to the actor.voidsetForceAndTorque(PxVec3 force, PxVec3 torque, PxForceModeEnum mode) Sets the impulsive force and torque defined in the global coordinate frame to the actor.voidsetLinearDamping(float linDamp) Sets the linear damping coefficient.voidsetMass(float mass) Sets the mass of a dynamic actor.voidSets the inertia tensor, using a parameter specified in mass space coordinates.voidsetMaxAngularVelocity(float maxAngVel) Lets you set the maximum angular velocity permitted for this actor.voidsetMaxContactImpulse(float maxImpulse) Sets a limit on the impulse that may be applied at a contact.voidsetMaxDepenetrationVelocity(float biasClamp) Sets the maximum depenetration velocity permitted to be introduced by the solver.voidsetMaxLinearVelocity(float maxLinVel) Lets you set the maximum linear velocity permitted for this actor.voidsetMinCCDAdvanceCoefficient(float advanceCoefficient) Sets the CCD minimum advance coefficient.voidsetRigidBodyFlag(PxRigidBodyFlagEnum flag, boolean value) Raises or clears a particular rigid body flag.voidsetRigidBodyFlags(PxRigidBodyFlags inFlags) static PxRigidBodywrapPointer(long address) Methods inherited from class physx.physics.PxRigidActor
attachShape, detachShape, detachShape, getGlobalPose, getNbConstraints, getNbShapes, getShapes, setGlobalPose, setGlobalPoseMethods inherited from class physx.physics.PxActor
getActorFlags, getDominanceGroup, getName, getOwnerClient, getScene, getType, getUserData, getWorldBounds, getWorldBounds, setActorFlag, setActorFlags, setDominanceGroup, setName, setOwnerClient, 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
-
PxRigidBody
protected PxRigidBody() -
PxRigidBody
protected PxRigidBody(long address)
-
-
Method Details
-
wrapPointer
-
arrayGet
-
setCMassLocalPose
Sets the pose of the center of mass relative to the actor.Note: Changing this transform will not move the actor in the world!
Note: Setting an unrealistic center of mass which is a long way from the body can make it difficult for the SDK to solve constraints. Perhaps leading to instability and jittering bodies.
Note: Changing this transform will not update the linear velocity reported by getLinearVelocity() to account for the shift in center of mass. If the shift should be accounted for, the user should update the velocity using setLinearVelocity().
Default: the identity transform
- Parameters:
pose- Mass frame offset transform relative to the actor frame. Range: rigid body transform.- See Also:
-
getCMassLocalPose
Retrieves the center of mass pose relative to the actor frame.- Returns:
- The center of mass pose relative to the actor frame.
- See Also:
-
setMass
public void setMass(float mass) Sets the mass of a dynamic actor.The mass must be non-negative.
setMass() does not update the inertial properties of the body, to change the inertia tensor use setMassSpaceInertiaTensor() or the PhysX extensions method #PxRigidBodyExt::updateMassAndInertia().
Note: A value of 0 is interpreted as infinite mass. Note: Values of 0 are not permitted for instances of PxArticulationLink but are permitted for instances of PxRigidDynamic.
Default: 1.0
Sleeping: Does NOT wake the actor up automatically.
- Parameters:
mass- New mass value for the actor. Range: [0, PX_MAX_F32)- See Also:
-
getMass
public float getMass()Retrieves the mass of the actor.Note: A value of 0 is interpreted as infinite mass.
- Returns:
- The mass of this actor.
- See Also:
-
getInvMass
public float getInvMass()Retrieves the inverse mass of the actor.- Returns:
- The inverse mass of this actor.
- See Also:
-
setMassSpaceInertiaTensor
Sets the inertia tensor, using a parameter specified in mass space coordinates.Note that such matrices are diagonal -- the passed vector is the diagonal.
If you have a non diagonal world/actor space inertia tensor(3x3 matrix). Then you need to diagonalize it and set an appropriate mass space transform. See #setCMassLocalPose().
The inertia tensor elements must be non-negative.
Note: A value of 0 in an element is interpreted as infinite inertia along that axis. Note: Values of 0 are not permitted for instances of PxArticulationLink but are permitted for instances of PxRigidDynamic.
Default: (1.0, 1.0, 1.0)
Sleeping: Does NOT wake the actor up automatically.
- Parameters:
m- New mass space inertia tensor for the actor.- See Also:
-
getMassSpaceInertiaTensor
Retrieves the diagonal inertia tensor of the actor relative to the mass coordinate frame.This method retrieves a mass frame inertia vector.
- Returns:
- The mass space inertia tensor of this actor.
Note: A value of 0 in an element is interpreted as infinite inertia along that axis.
- See Also:
-
getMassSpaceInvInertiaTensor
Retrieves the diagonal inverse inertia tensor of the actor relative to the mass coordinate frame.This method retrieves a mass frame inverse inertia vector.
Note: A value of 0 in an element is interpreted as infinite inertia along that axis.
- Returns:
- The mass space inverse inertia tensor of this actor.
- See Also:
-
setLinearDamping
public void setLinearDamping(float linDamp) Sets the linear damping coefficient.Zero represents no damping. The damping coefficient must be nonnegative.
Default: 0.05 for PxArticulationLink, 0.0 for PxRigidDynamic
- Parameters:
linDamp- Linear damping coefficient. Range: [0, PX_MAX_F32)- See Also:
-
getLinearDamping
public float getLinearDamping()Retrieves the linear damping coefficient.- Returns:
- The linear damping coefficient associated with this actor.
- See Also:
-
setAngularDamping
public void setAngularDamping(float angDamp) Sets the angular damping coefficient.Zero represents no damping.
The angular damping coefficient must be nonnegative.
Default: 0.05
- Parameters:
angDamp- Angular damping coefficient. Range: [0, PX_MAX_F32)- See Also:
-
getAngularDamping
public float getAngularDamping()Retrieves the angular damping coefficient.- Returns:
- The angular damping coefficient associated with this actor.
- See Also:
-
getLinearVelocity
Retrieves the linear velocity of an actor.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).
Note: The linear velocity is reported with respect to the rigid body's center of mass and not the actor frame origin.
- Returns:
- The linear velocity of the actor.
- See Also:
-
getAngularVelocity
Retrieves the angular velocity of the actor.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).
- Returns:
- The angular velocity of the actor.
- See Also:
-
setMaxLinearVelocity
public void setMaxLinearVelocity(float maxLinVel) Lets you set the maximum linear velocity permitted for this actor.With this function, you can set the maximum linear velocity permitted for this rigid body. Higher linear velocities are clamped to this value.
Note: The linear velocity is clamped to the set value before the solver, which means that the limit may still be momentarily exceeded.
Note: Enforcing the limit introduces momentum into the simulation, causing potentially unphysical behavior. For articulation links, consider using joint damping and limits instead, which preserve momentum.
Default: 100 * PxTolerancesScale::length /s for PxArticulationLink, 1e^16 lengthUnits/s for PxRigidDynamic
- Parameters:
maxLinVel- Max allowable linear velocity for actor. Range: [0, 1e^16) lengthUnits/s- See Also:
-
getMaxLinearVelocity
public float getMaxLinearVelocity()Retrieves the maximum angular velocity permitted for this actor.- Returns:
- The maximum allowed angular velocity for this actor.
- See Also:
-
setMaxAngularVelocity
public void setMaxAngularVelocity(float maxAngVel) Lets you set the maximum angular velocity permitted for this actor.For various internal computations, very quickly rotating actors introduce error into the simulation, which leads to undesired results.
With this function, you can set the maximum angular velocity permitted for this rigid body. Higher angular velocities are clamped to this value.
Note: The angular velocity is clamped to the set value before the solver, which means that the limit may still be momentarily exceeded.
Note: Enforcing the limit introduces momentum into the simulation, causing potentially unphysical behavior. For articulation links, consider using joint damping and limits instead, which preserve momentum.
Default: 50.0 rad/s for PxArticulationLink, 100.0 rad/s for PxRigidDynamic
Range: [0, 1e^16) rad/s
- Parameters:
maxAngVel- Max allowable angular velocity for actor.- See Also:
-
getMaxAngularVelocity
public float getMaxAngularVelocity()Retrieves the maximum angular velocity permitted for this actor.- Returns:
- The maximum allowed angular velocity for this actor.
- See Also:
-
addForce
Applies a force (or impulse) defined in the global coordinate frame to the actor at its center of mass.This will not induce a torque.
::PxForceMode determines if the force is to be conventional or impulsive.
Each actor has an acceleration and a velocity change accumulator which are directly modified using the modes PxForceMode::eACCELERATION and PxForceMode::eVELOCITY_CHANGE respectively. The modes PxForceMode::eFORCE and PxForceMode::eIMPULSE also modify these same accumulators and are just short hand for multiplying the vector parameter by inverse mass and then using PxForceMode::eACCELERATION and PxForceMode::eVELOCITY_CHANGE respectively.
Note: It is invalid to use this method if the actor has not been added to a scene already or if PxActorFlag::eDISABLE_SIMULATION is set.
Note: The force modes PxForceMode::eIMPULSE and PxForceMode::eVELOCITY_CHANGE can not be applied to articulation links.
Note: if this is called on an articulation link, only the link is updated, not the entire articulation.
Note: see #PxRigidBodyExt::computeVelocityDeltaFromImpulse for details of how to compute the change in linear velocity that will arise from the application of an impulsive force, where an impulsive force is applied force multiplied by a timestep.
Note: Forces will be cleared automatically after they are applied during the next simulation step. If the forces should be retained for the following steps, PxRigidBodyFlag::eRETAIN_ACCELERATIONS should be raised.
Sleeping: This call wakes the actor if it is sleeping, and the autowake parameter is true (default) or the force is non-zero.
- Parameters:
force- Force/Impulse to apply defined in the global frame. is smaller than #PxSceneDesc::wakeCounterResetValue it will get increased to the reset value.- See Also:
-
addForce
Applies a force (or impulse) defined in the global coordinate frame to the actor at its center of mass.This will not induce a torque.
::PxForceMode determines if the force is to be conventional or impulsive.
Each actor has an acceleration and a velocity change accumulator which are directly modified using the modes PxForceMode::eACCELERATION and PxForceMode::eVELOCITY_CHANGE respectively. The modes PxForceMode::eFORCE and PxForceMode::eIMPULSE also modify these same accumulators and are just short hand for multiplying the vector parameter by inverse mass and then using PxForceMode::eACCELERATION and PxForceMode::eVELOCITY_CHANGE respectively.
Note: It is invalid to use this method if the actor has not been added to a scene already or if PxActorFlag::eDISABLE_SIMULATION is set.
Note: The force modes PxForceMode::eIMPULSE and PxForceMode::eVELOCITY_CHANGE can not be applied to articulation links.
Note: if this is called on an articulation link, only the link is updated, not the entire articulation.
Note: see #PxRigidBodyExt::computeVelocityDeltaFromImpulse for details of how to compute the change in linear velocity that will arise from the application of an impulsive force, where an impulsive force is applied force multiplied by a timestep.
Note: Forces will be cleared automatically after they are applied during the next simulation step. If the forces should be retained for the following steps, PxRigidBodyFlag::eRETAIN_ACCELERATIONS should be raised.
Sleeping: This call wakes the actor if it is sleeping, and the autowake parameter is true (default) or the force is non-zero.
- Parameters:
force- Force/Impulse to apply defined in the global frame.mode- The mode to use when applying the force/impulse(see #PxForceMode) is smaller than #PxSceneDesc::wakeCounterResetValue it will get increased to the reset value.- See Also:
-
addForce
Applies a force (or impulse) defined in the global coordinate frame to the actor at its center of mass.This will not induce a torque.
::PxForceMode determines if the force is to be conventional or impulsive.
Each actor has an acceleration and a velocity change accumulator which are directly modified using the modes PxForceMode::eACCELERATION and PxForceMode::eVELOCITY_CHANGE respectively. The modes PxForceMode::eFORCE and PxForceMode::eIMPULSE also modify these same accumulators and are just short hand for multiplying the vector parameter by inverse mass and then using PxForceMode::eACCELERATION and PxForceMode::eVELOCITY_CHANGE respectively.
Note: It is invalid to use this method if the actor has not been added to a scene already or if PxActorFlag::eDISABLE_SIMULATION is set.
Note: The force modes PxForceMode::eIMPULSE and PxForceMode::eVELOCITY_CHANGE can not be applied to articulation links.
Note: if this is called on an articulation link, only the link is updated, not the entire articulation.
Note: see #PxRigidBodyExt::computeVelocityDeltaFromImpulse for details of how to compute the change in linear velocity that will arise from the application of an impulsive force, where an impulsive force is applied force multiplied by a timestep.
Note: Forces will be cleared automatically after they are applied during the next simulation step. If the forces should be retained for the following steps, PxRigidBodyFlag::eRETAIN_ACCELERATIONS should be raised.
Sleeping: This call wakes the actor if it is sleeping, and the autowake parameter is true (default) or the force is non-zero.
- Parameters:
force- Force/Impulse to apply defined in the global frame.mode- The mode to use when applying the force/impulse(see #PxForceMode)autowake- Specify if the call should wake up the actor if it is currently asleep. If true and the current wake counter value is smaller than #PxSceneDesc::wakeCounterResetValue it will get increased to the reset value.- See Also:
-
addTorque
Applies an impulsive torque defined in the global coordinate frame to the actor.::PxForceMode determines if the torque is to be conventional or impulsive.
Each actor has an angular acceleration and an angular velocity change accumulator which are directly modified using the modes PxForceMode::eACCELERATION and PxForceMode::eVELOCITY_CHANGE respectively. The modes PxForceMode::eFORCE and PxForceMode::eIMPULSE also modify these same accumulators and are just short hand for multiplying the vector parameter by inverse inertia and then using PxForceMode::eACCELERATION and PxForceMode::eVELOCITY_CHANGE respectively.
Note: It is invalid to use this method if the actor has not been added to a scene already or if PxActorFlag::eDISABLE_SIMULATION is set.
Note: The force modes PxForceMode::eIMPULSE and PxForceMode::eVELOCITY_CHANGE can not be applied to articulation links.
Note: if this called on an articulation link, only the link is updated, not the entire articulation.
Note: see #PxRigidBodyExt::computeVelocityDeltaFromImpulse for details of how to compute the change in angular velocity that will arise from the application of an impulsive torque, where an impulsive torque is an applied torque multiplied by a timestep.
Note: Torques will be cleared after they are applied during the next simulation step. If the Torques should be retained for the following steps, PxRigidBodyFlag::eRETAIN_ACCELERATIONS should be raised.
Sleeping: This call wakes the actor if it is sleeping, and the autowake parameter is true (default) or the torque is non-zero.
- Parameters:
torque- Torque to apply defined in the global frame. Range: torque vector is smaller than #PxSceneDesc::wakeCounterResetValue it will get increased to the reset value.- See Also:
-
addTorque
Applies an impulsive torque defined in the global coordinate frame to the actor.::PxForceMode determines if the torque is to be conventional or impulsive.
Each actor has an angular acceleration and an angular velocity change accumulator which are directly modified using the modes PxForceMode::eACCELERATION and PxForceMode::eVELOCITY_CHANGE respectively. The modes PxForceMode::eFORCE and PxForceMode::eIMPULSE also modify these same accumulators and are just short hand for multiplying the vector parameter by inverse inertia and then using PxForceMode::eACCELERATION and PxForceMode::eVELOCITY_CHANGE respectively.
Note: It is invalid to use this method if the actor has not been added to a scene already or if PxActorFlag::eDISABLE_SIMULATION is set.
Note: The force modes PxForceMode::eIMPULSE and PxForceMode::eVELOCITY_CHANGE can not be applied to articulation links.
Note: if this called on an articulation link, only the link is updated, not the entire articulation.
Note: see #PxRigidBodyExt::computeVelocityDeltaFromImpulse for details of how to compute the change in angular velocity that will arise from the application of an impulsive torque, where an impulsive torque is an applied torque multiplied by a timestep.
Note: Torques will be cleared after they are applied during the next simulation step. If the Torques should be retained for the following steps, PxRigidBodyFlag::eRETAIN_ACCELERATIONS should be raised.
Sleeping: This call wakes the actor if it is sleeping, and the autowake parameter is true (default) or the torque is non-zero.
- Parameters:
torque- Torque to apply defined in the global frame. Range: torque vectormode- The mode to use when applying the force/impulse(see #PxForceMode). is smaller than #PxSceneDesc::wakeCounterResetValue it will get increased to the reset value.- See Also:
-
addTorque
Applies an impulsive torque defined in the global coordinate frame to the actor.::PxForceMode determines if the torque is to be conventional or impulsive.
Each actor has an angular acceleration and an angular velocity change accumulator which are directly modified using the modes PxForceMode::eACCELERATION and PxForceMode::eVELOCITY_CHANGE respectively. The modes PxForceMode::eFORCE and PxForceMode::eIMPULSE also modify these same accumulators and are just short hand for multiplying the vector parameter by inverse inertia and then using PxForceMode::eACCELERATION and PxForceMode::eVELOCITY_CHANGE respectively.
Note: It is invalid to use this method if the actor has not been added to a scene already or if PxActorFlag::eDISABLE_SIMULATION is set.
Note: The force modes PxForceMode::eIMPULSE and PxForceMode::eVELOCITY_CHANGE can not be applied to articulation links.
Note: if this called on an articulation link, only the link is updated, not the entire articulation.
Note: see #PxRigidBodyExt::computeVelocityDeltaFromImpulse for details of how to compute the change in angular velocity that will arise from the application of an impulsive torque, where an impulsive torque is an applied torque multiplied by a timestep.
Note: Torques will be cleared after they are applied during the next simulation step. If the Torques should be retained for the following steps, PxRigidBodyFlag::eRETAIN_ACCELERATIONS should be raised.
Sleeping: This call wakes the actor if it is sleeping, and the autowake parameter is true (default) or the torque is non-zero.
- Parameters:
torque- Torque to apply defined in the global frame. Range: torque vectormode- The mode to use when applying the force/impulse(see #PxForceMode).autowake- Specify if the call should wake up the actor if it is currently asleep. If true and the current wake counter value is smaller than #PxSceneDesc::wakeCounterResetValue it will get increased to the reset value.- See Also:
-
clearForce
Clears the accumulated forces (sets the accumulated force back to zero).Each actor has an acceleration and a velocity change accumulator which are directly modified using the modes PxForceMode::eACCELERATION and PxForceMode::eVELOCITY_CHANGE respectively. The modes PxForceMode::eFORCE and PxForceMode::eIMPULSE also modify these same accumulators (see PxRigidBody::addForce() for details); therefore the effect of calling clearForce(PxForceMode::eFORCE) is equivalent to calling clearForce(PxForceMode::eACCELERATION), and the effect of calling clearForce(PxForceMode::eIMPULSE) is equivalent to calling clearForce(PxForceMode::eVELOCITY_CHANGE).
::PxForceMode determines if the cleared force is to be conventional or impulsive.
Note: The force modes PxForceMode::eIMPULSE and PxForceMode::eVELOCITY_CHANGE can not be applied to articulation links.
Note: It is invalid to use this method if the actor has not been added to a scene already or if PxActorFlag::eDISABLE_SIMULATION is set.
- Parameters:
mode- The mode to use when clearing the force/impulse(see #PxForceMode)- See Also:
-
clearTorque
Clears the impulsive torque defined in the global coordinate frame to the actor.::PxForceMode determines if the cleared torque is to be conventional or impulsive.
Each actor has an angular acceleration and a velocity change accumulator which are directly modified using the modes PxForceMode::eACCELERATION and PxForceMode::eVELOCITY_CHANGE respectively. The modes PxForceMode::eFORCE and PxForceMode::eIMPULSE also modify these same accumulators (see PxRigidBody::addTorque() for details); therefore the effect of calling clearTorque(PxForceMode::eFORCE) is equivalent to calling clearTorque(PxForceMode::eACCELERATION), and the effect of calling clearTorque(PxForceMode::eIMPULSE) is equivalent to calling clearTorque(PxForceMode::eVELOCITY_CHANGE).
Note: The force modes PxForceMode::eIMPULSE and PxForceMode::eVELOCITY_CHANGE can not be applied to articulation links.
Note: It is invalid to use this method if the actor has not been added to a scene already or if PxActorFlag::eDISABLE_SIMULATION is set.
- Parameters:
mode- The mode to use when clearing the force/impulse(see #PxForceMode).- See Also:
-
setForceAndTorque
Sets the impulsive force and torque defined in the global coordinate frame to the actor.::PxForceMode determines if the cleared torque is to be conventional or impulsive.
Note: The force modes PxForceMode::eIMPULSE and PxForceMode::eVELOCITY_CHANGE can not be applied to articulation links.
Note: It is invalid to use this method if the actor has not been added to a scene already or if PxActorFlag::eDISABLE_SIMULATION is set.
Note: Forces and torques will be cleared after they are applied during the next simulation step. If they should be retained for the following steps, PxRigidBodyFlag::eRETAIN_ACCELERATIONS should be raised.
- See Also:
-
setForceAndTorque
Sets the impulsive force and torque defined in the global coordinate frame to the actor.::PxForceMode determines if the cleared torque is to be conventional or impulsive.
Note: The force modes PxForceMode::eIMPULSE and PxForceMode::eVELOCITY_CHANGE can not be applied to articulation links.
Note: It is invalid to use this method if the actor has not been added to a scene already or if PxActorFlag::eDISABLE_SIMULATION is set.
Note: Forces and torques will be cleared after they are applied during the next simulation step. If they should be retained for the following steps, PxRigidBodyFlag::eRETAIN_ACCELERATIONS should be raised.
- See Also:
-
setRigidBodyFlag
Raises or clears a particular rigid body flag.See the list of flags #PxRigidBodyFlag
Default: no flags are set
Sleeping: Does NOT wake the actor up automatically.
- Parameters:
flag- The PxRigidBody flag to raise(set) or clear. See #PxRigidBodyFlag.value- The new boolean value for the flag.- See Also:
-
setRigidBodyFlags
- Parameters:
inFlags- WebIDL type:PxRigidBodyFlags[Ref]
-
getRigidBodyFlags
Reads the PxRigidBody flags.See the list of flags #PxRigidBodyFlag
- Returns:
- The values of the PxRigidBody flags.
- See Also:
-
setMinCCDAdvanceCoefficient
public void setMinCCDAdvanceCoefficient(float advanceCoefficient) Sets the CCD minimum advance coefficient.The CCD minimum advance coefficient is a value in the range [0, 1] that is used to control the minimum amount of time a body is integrated when it has a CCD contact. The actual minimum amount of time that is integrated depends on various properties, including the relative speed and collision shapes of the bodies involved in the contact. From these properties, a numeric value is calculated that determines the maximum distance (and therefore maximum time) which these bodies could be integrated forwards that would ensure that these bodies did not pass through each-other. This value is then scaled by CCD minimum advance coefficient to determine the amount of time that will be consumed in the CCD pass.
Things to consider: A large value (approaching 1) ensures that the objects will always advance some time. However, larger values increase the chances of objects gently drifting through each-other in scenes which the constraint solver can't converge, e.g. scenes where an object is being dragged through a wall with a constraint. A value of 0 ensures that the pair of objects stop at the exact time-of-impact and will not gently drift through each-other. However, with very small/thin objects initially in contact, this can lead to a large amount of time being dropped and increases the chances of jamming. Jamming occurs when the an object is persistently in contact with an object such that the time-of-impact is 0, which results in no time being advanced for those objects in that CCD pass.
- Parameters:
advanceCoefficient- The CCD min advance coefficient. Range: [0, 1] Default: 0.15
-
getMinCCDAdvanceCoefficient
public float getMinCCDAdvanceCoefficient()Gets the CCD minimum advance coefficient.- Returns:
- The value of the CCD min advance coefficient.
- See Also:
-
setMaxDepenetrationVelocity
public void setMaxDepenetrationVelocity(float biasClamp) Sets the maximum depenetration velocity permitted to be introduced by the solver. This value controls how much velocity the solver can introduce to correct for penetrations in contacts.- Parameters:
biasClamp- The maximum velocity to de-penetrate by Range: (0, PX_MAX_F32].
-
getMaxDepenetrationVelocity
public float getMaxDepenetrationVelocity()Returns the maximum depenetration velocity the solver is permitted to introduced. This value controls how much velocity the solver can introduce to correct for penetrations in contacts.- Returns:
- The maximum penetration bias applied by the solver.
-
setMaxContactImpulse
public void setMaxContactImpulse(float maxImpulse) Sets a limit on the impulse that may be applied at a contact. The maximum impulse at a contact between two dynamic or kinematic bodies will be the minimum of the two limit values. For a collision between a static and a dynamic body, the impulse is limited by the value for the dynamic body.- Parameters:
maxImpulse- the maximum contact impulse. Range: [0, PX_MAX_F32] Default: PX_MAX_F32- See Also:
-
getMaxContactImpulse
public float getMaxContactImpulse()Returns the maximum impulse that may be applied at a contact.- Returns:
- The maximum impulse that may be applied at a contact
- See Also:
-
setContactSlopCoefficient
public void setContactSlopCoefficient(float slopCoefficient) Sets a distance scale whereby the angular influence of a contact on the normal constraint in a contact is zeroed if normal.cross(offset) falls below this tolerance. Rather than acting as an absolute value, this tolerance is scaled by the ratio rXn.dot(angVel)/normal.dot(linVel) such that contacts that have relatively larger angular velocity than linear normal velocity (e.g. rolling wheels) achieve larger slop values as the angular velocity increases.- Parameters:
slopCoefficient- the Slop coefficient. Range: [0, PX_MAX_F32] Default: 0- See Also:
-
getContactSlopCoefficient
public float getContactSlopCoefficient()Returns the contact slop coefficient.- Returns:
- The contact slop coefficient.
- See Also:
-