Package physx.physics

Class PxRigidActor

Direct Known Subclasses:
PxRigidBody, PxRigidStatic

public class PxRigidActor extends PxActor
PxRigidActor represents a base class shared between dynamic and static rigid bodies in the physics SDK.

PxRigidActor objects specify the geometry of the object by defining a set of attached shapes (see #PxShape).

See Also:
  • 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

      public static PxRigidActor wrapPointer(long address)
    • arrayGet

      public static PxRigidActor arrayGet(long baseAddress, int index)
    • getGlobalPose

      public PxTransform 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

      public void setGlobalPose(PxTransform pose)
      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

      public void setGlobalPose(PxTransform pose, boolean autowake)
      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

      public boolean attachShape(PxShape shape)
      Attach a shape to an actor

      This 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

      public void detachShape(PxShape shape)
      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

      public void detachShape(PxShape shape, boolean wakeOnLostTouch)
      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: