PxActor#

Defined in include/PxActor.h

class PxActor : public 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.

Subclassed by PxDeformableBody, PxPBDParticleSystem, PxRigidActor

Environment ID

void *userData#

user can assign this to whatever, usually to create a 1:1 relationship with a user object.

virtual bool setEnvironmentID(PxU32 envID) = 0#

Sets the environment ID for this actor.

The environment ID is an extra built-in filter group for the GPU broadphase. Actors will only collide with each-other if they have the same environment ID.

The default value is PX_INVALID_U32. Actors with this ID will collide with other actors, regardless of which environment they are a part of.

The environment ID must be set before adding the actor to a scene, and cannot change while the actor is in the scene.

If it is not PX_INVALID_U32, the environment ID must be smaller than 1<<24, i.e. the system does not support more than 1<<24 environments.

Default: PX_INVALID_U32

Note

This is not available for CPU broadphases.

Parameters:

envID[in] Environment ID for this actor.

Returns:

True if success.

virtual PxU32 getEnvironmentID() const = 0#

Returns the environment ID for this actor.

Returns:

Environment ID for this actor.

inline PxActor(PxType concreteType, PxBaseFlags baseFlags)#
inline PxActor(PxBaseFlags baseFlags)#
inline virtual ~PxActor()#
inline virtual bool isKindOf(const char *name) const#

Returns whether a given type name matches with the type of this instance.

Public Functions

virtual void release() = 0#

Deletes the actor.

Do not keep a reference to the deleted instance.

If the actor belongs to a PxAggregate object, it is automatically removed from the aggregate.

virtual PxActorType::Enum getType() const = 0#

Retrieves the type of actor.

See also

PxActorType

Returns:

The actor type of the actor.

virtual PxScene *getScene() const = 0#

Retrieves the scene which this actor belongs to.

See also

PxScene

Returns:

Owner Scene. NULL if not part of a scene.

virtual void setName(const char *name) = 0#

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.

Default: NULL

See also

getName()

Parameters:

name[in] String to set the objects name to.

virtual const char *getName() const = 0#

Retrieves the name string set with setName().

See also

setName()

Returns:

Name string associated with object.

virtual PxBounds3 getWorldBounds(float inflation = 1.01f) const = 0#

Retrieves the axis aligned bounding box enclosing the actor.

See also

PxBounds3

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[in] Scale factor for computed world bounds. Box extents are multiplied by this value.

Returns:

The actor’s bounding box.

virtual void setActorFlag(PxActorFlag::Enum flag, bool value) = 0#

Raises or clears a particular actor flag.

See the list of flags PxActorFlag

Sleeping: Does NOT wake the actor up automatically.

Parameters:
  • flag[in] The PxActor flag to raise(set) or clear. See PxActorFlag.

  • value[in] The boolean value to assign to the flag.

virtual void setActorFlags(PxActorFlags inFlags) = 0#

Sets the actor flags.

See the list of flags PxActorFlag

virtual PxActorFlags getActorFlags() const = 0#

Reads the PxActor flags.

See the list of flags PxActorFlag

Returns:

The values of the PxActor flags.

virtual void setDominanceGroup(PxDominanceGroup dominanceGroup) = 0#

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[in] The dominance group identifier. Range: [0..31]

virtual PxDominanceGroup getDominanceGroup() const = 0#

Retrieves the value set with setDominanceGroup().

Returns:

The dominance group of this actor.

virtual void setOwnerClient(PxClientID inClient) = 0#

Sets the owner client of an actor.

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

Default: PX_DEFAULT_CLIENT

See also

PxClientID PxScene::createClient()

virtual PxClientID getOwnerClient() const = 0#

Returns the owner client that was specified at creation time.

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

See also

PxClientID PxScene::createClient()

virtual PxAggregate *getAggregate() const = 0#

Retrieves the aggregate the actor might be a part of.

See also

PxAggregate

Returns:

The aggregate the actor is a part of, or NULL if the actor does not belong to an aggregate.

virtual const char *getConcreteTypeName() const = 0#

Returns string name of dynamic type.

Returns:

Class name of most derived type of this object.

template<class T>
inline T *is()#
template<class T>
inline const T *is() const#
inline PxType getConcreteType() const#

Returns concrete type of object.

See also

PxConcreteType

Returns:

PxConcreteType::Enum of serialized object

inline void setBaseFlag(PxBaseFlag::Enum flag, bool value)#

Set PxBaseFlag

Parameters:
  • flag[in] The flag to be set

  • value[in] The flags new value

inline void setBaseFlags(PxBaseFlags inFlags)#

Set PxBaseFlags

See also

PxBaseFlags

Parameters:

inFlags[in] The flags to be set

inline PxBaseFlags getBaseFlags() const#

Returns PxBaseFlags.

See also

PxBaseFlags

Returns:

PxBaseFlags

inline virtual bool isReleasable() const#

Whether the object is subordinate.

A class is subordinate, if it can only be instantiated in the context of another class.

Returns:

Whether the class is subordinate

Protected Functions

template<class T>
inline bool typeMatch() const#

Protected Attributes

PxType mConcreteType#
PxBaseFlags mBaseFlags#
PxU32 mBuiltInRefCount#