- Direct Known Subclasses:
PxRigidBody,PxRigidStatic
PxRigidActor objects specify the geometry of the object by defining a set of attached shapes (see #PxShape).
- 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 PxRigidActorarrayGet(long baseAddress, int index) booleanattachShape(PxShape shape) Attach a shape to an actorvoiddetachShape(PxShape shape) Detach a shape from an actor.voiddetachShape(PxShape shape, boolean wakeOnLostTouch) Detach a shape from an actor.Retrieves the actors world space transform.intReturns the number of constraint shaders attached to the actor.intReturns the number of shapes assigned to the actor.voidsetGlobalPose(PxTransform pose) Method for setting an actor's pose in the world.voidsetGlobalPose(PxTransform pose, boolean autowake) Method for setting an actor's pose in the world.static PxRigidActorwrapPointer(long address) Methods 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
-
PxRigidActor
protected PxRigidActor() -
PxRigidActor
protected PxRigidActor(long address)
-
-
Method Details
-
wrapPointer
-
arrayGet
-
getGlobalPose
Retrieves the actors world space transform.The getGlobalPose() method retrieves the actor's current actor space to world space transformation.
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:
- Global pose of object.
-
setGlobalPose
Method for setting an actor's pose in the world.This method instantaneously changes the actor space to world space transformation.
This method is mainly for dynamic rigid bodies (see #PxRigidDynamic). Calling this method on static actors is likely to result in a performance penalty, since internal optimization structures for static actors may need to be recomputed. In addition, moving static actors will not interact correctly with dynamic actors or joints.
To directly control an actor's position and have it correctly interact with dynamic bodies and joints, create a dynamic body with the PxRigidBodyFlag::eKINEMATIC flag, then use the setKinematicTarget() commands to define its path.
Even when moving dynamic actors, exercise restraint in making use of this method. Where possible, avoid:
\li moving actors into other actors, thus causing overlap (an invalid physical state)
\li moving an actor that is connected by a joint to another away from the other (thus causing joint error)
Sleeping: This call wakes dynamic actors if they are sleeping and the autowake parameter is true (default).
- Parameters:
pose- Transformation from the actors local frame to the global frame. Range: rigid body transform.- See Also:
-
setGlobalPose
Method for setting an actor's pose in the world.This method instantaneously changes the actor space to world space transformation.
This method is mainly for dynamic rigid bodies (see #PxRigidDynamic). Calling this method on static actors is likely to result in a performance penalty, since internal optimization structures for static actors may need to be recomputed. In addition, moving static actors will not interact correctly with dynamic actors or joints.
To directly control an actor's position and have it correctly interact with dynamic bodies and joints, create a dynamic body with the PxRigidBodyFlag::eKINEMATIC flag, then use the setKinematicTarget() commands to define its path.
Even when moving dynamic actors, exercise restraint in making use of this method. Where possible, avoid:
\li moving actors into other actors, thus causing overlap (an invalid physical state)
\li moving an actor that is connected by a joint to another away from the other (thus causing joint error)
Sleeping: This call wakes dynamic actors if they are sleeping and the autowake parameter is true (default).
- Parameters:
pose- Transformation from the actors local frame to the global frame. Range: rigid body transform.autowake- whether to wake the object if it is dynamic. This parameter has no effect for static or kinematic actors. If true and the current wake counter value is smaller than #PxSceneDesc::wakeCounterResetValue it will get increased to the reset value.- See Also:
-
attachShape
Attach a shape to an actorThis call will increment the reference count of the shape.
Note: Mass properties of dynamic rigid actors will not automatically be recomputed to reflect the new mass distribution implied by the shape. Follow this call with a call to the PhysX extensions method #PxRigidBodyExt::updateMassAndInertia() to do that.
Attaching a triangle mesh, heightfield or plane geometry shape configured as eSIMULATION_SHAPE is not supported for non-kinematic PxRigidDynamic instances.
Sleeping: Does NOT wake the actor up automatically.
- Parameters:
shape- the shape to attach.- Returns:
- True if success.
-
detachShape
Detach a shape from an actor.This will also decrement the reference count of the PxShape, and if the reference count is zero, will cause it to be deleted.
Sleeping: Does NOT wake the actor up automatically.
- Parameters:
shape- the shape to detach.
-
detachShape
Detach a shape from an actor.This will also decrement the reference count of the PxShape, and if the reference count is zero, will cause it to be deleted.
Sleeping: Does NOT wake the actor up automatically.
- Parameters:
shape- the shape to detach.wakeOnLostTouch- Specifies whether touching objects from the previous frame should get woken up in the next frame. Only applies to PxArticulationReducedCoordinate and PxRigidActor types.
-
getNbShapes
public int getNbShapes()Returns the number of shapes assigned to the actor.You can use #getShapes() to retrieve the shape pointers.
- Returns:
- Number of shapes associated with this actor.
- See Also:
-
getNbConstraints
public int getNbConstraints()Returns the number of constraint shaders attached to the actor.You can use #getConstraints() to retrieve the constraint shader pointers.
- Returns:
- Number of constraint shaders attached to this actor.
- See Also:
-