Package physx.physics

Class PxActor

Direct Known Subclasses:
PxParticleSystem, PxRigidActor

public class PxActor extends PxBase
PxActor is the base class for the main simulation objects in the physics SDK.

The actor is owned by and contained in a PxScene.

  • Field Details

    • SIZEOF

      public static final int SIZEOF
    • ALIGNOF

      public static final int ALIGNOF
      See Also:
  • Constructor Details

    • PxActor

      protected PxActor()
    • PxActor

      protected PxActor(long address)
  • Method Details

    • wrapPointer

      public static PxActor wrapPointer(long address)
    • arrayGet

      public static PxActor arrayGet(long baseAddress, int index)
    • getUserData

      public NativeObject getUserData()
      user can assign this to whatever, usually to create a 1:1 relationship with a user object.
    • setUserData

      public void setUserData(NativeObject value)
      user can assign this to whatever, usually to create a 1:1 relationship with a user object.
    • getType

      public PxActorTypeEnum getType()
      Retrieves the type of actor.
      Returns:
      The actor type of the actor.
    • getScene

      public PxScene getScene()
      Retrieves the scene which this actor belongs to.
      Returns:
      Owner Scene. NULL if not part of a scene.
      See Also:
    • setName

      public void setName(String name)
      Sets a name string for the object that can be retrieved with getName().

      This is for debugging and is not used by the SDK. The string is not copied by the SDK, only the pointer is stored.

      Parameters:
      name - String to set the objects name to.

      Default: NULL

      See Also:
    • getName

      public String getName()
      Retrieves the name string set with setName().
      Returns:
      Name string associated with object.
      See Also:
    • getWorldBounds

      public PxBounds3 getWorldBounds()
      Retrieves the axis aligned bounding box enclosing 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 actor's bounding box.
      See Also:
    • getWorldBounds

      public PxBounds3 getWorldBounds(float inflation)
      Retrieves the axis aligned bounding box enclosing 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).

      Parameters:
      inflation - Scale factor for computed world bounds. Box extents are multiplied by this value.
      Returns:
      The actor's bounding box.
      See Also:
    • setActorFlag

      public void setActorFlag(PxActorFlagEnum flag, boolean value)
      Raises or clears a particular actor flag.

      See the list of flags #PxActorFlag

      Sleeping: Does NOT wake the actor up automatically.

      Parameters:
      flag - The PxActor flag to raise(set) or clear. See #PxActorFlag.
      value - The boolean value to assign to the flag.
      See Also:
    • setActorFlags

      public void setActorFlags(PxActorFlags flags)
      Sets the actor flags.

      See the list of flags #PxActorFlag

      See Also:
    • getActorFlags

      public PxActorFlags getActorFlags()
      Reads the PxActor flags.

      See the list of flags #PxActorFlag

      Returns:
      The values of the PxActor flags.
      See Also:
    • setDominanceGroup

      public void setDominanceGroup(byte dominanceGroup)
      Assigns dynamic actors a dominance group identifier.

      PxDominanceGroup is a 5 bit group identifier (legal range from 0 to 31).

      The PxScene::setDominanceGroupPair() lets you set certain behaviors for pairs of dominance groups. By default every dynamic actor is created in group 0.

      Default: 0

      Sleeping: Changing the dominance group does NOT wake the actor up automatically.

      Parameters:
      dominanceGroup - The dominance group identifier. Range: [0..31]
      See Also:
    • getDominanceGroup

      public byte getDominanceGroup()
      Retrieves the value set with setDominanceGroup().
      Returns:
      The dominance group of this actor.
      See Also:
    • setOwnerClient

      public void setOwnerClient(byte inClient)
      Sets the owner client of an actor.

      This cannot be done once the actor has been placed into a scene.

      Default: PX_DEFAULT_CLIENT

    • getOwnerClient

      public byte getOwnerClient()
      Returns the owner client that was specified at creation time.

      This value cannot be changed once the object is placed into the scene.