Open 3D Engine PhysX Gem API Reference  24.09
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
PhysX::CharacterControllerCallbackManager Class Reference

Manages callbacks for character controller collision filtering, collision notifications, and handling riding on objects. More...

#include <CharacterController.h>

Inherits physx::PxControllerFilterCallback, physx::PxQueryFilterCallback, physx::PxUserControllerHitReport, and physx::PxControllerBehaviorCallback.

Public Types

using ControllerFilter = AZStd::function< bool(const physx::PxController &, const physx::PxController &)>
 Determines whether this controller should be obstructed by other controllers or able to move through them.
 
using ObjectPreFilter = AZStd::function< physx::PxQueryHitType::Enum(const physx::PxFilterData &, const physx::PxShape *, const physx::PxRigidActor *, physx::PxHitFlags &)>
 
using ObjectPostFilter = AZStd::function< physx::PxQueryHitType::Enum(const physx::PxFilterData &, const physx::PxQueryHit &)>
 
using OnShapeHit = AZStd::function< void(const physx::PxControllerShapeHit &)>
 Called when the controller collides with another object.
 
using OnControllerHit = AZStd::function< void(const physx::PxControllersHit &)>
 Called when the controller collides with another controller.
 
using OnObstacleHit = AZStd::function< void(const physx::PxControllerObstacleHit &)>
 Called when the controller collides with an obstacle.
 
using ObjectRidingBehavior = AZStd::function< physx::PxControllerBehaviorFlags(const physx::PxShape &, const physx::PxActor &)>
 Determines whether the controller should be able to ride on other objects or should slide.
 
using ControllerRidingBehavior = AZStd::function< physx::PxControllerBehaviorFlags(const physx::PxController &)>
 Determines whether the controller should slide when standing on another character.
 
using ObstacleRidingBehavior = AZStd::function< physx::PxControllerBehaviorFlags(const physx::PxObstacle &)>
 Determines whether the controller should be able to ride on obstacles or should slide.
 

Public Member Functions

 AZ_CLASS_ALLOCATOR (CharacterControllerCallbackManager, AZ::SystemAllocator)
 
 AZ_TYPE_INFO (CharacterControllerCallbackManager, "93C7DEA8-98E6-4C07-96B7-D215800D0ECB")
 
void SetControllerFilter (ControllerFilter controllerFilter)
 
void SetObjectPreFilter (ObjectPreFilter objectPreFilter)
 
void SetObjectPostFilter (ObjectPostFilter objectPostFilter)
 
void SetOnShapeHit (OnShapeHit onShapeHit)
 Sets the function which is called when the controller collides with another object.
 
void SetOnControllerHit (OnControllerHit onControllerHit)
 Sets the function which is called when the controller collides with another controller.
 
void SetOnObstacleHit (OnObstacleHit onObstacleHit)
 Sets the function which is called when the controller collides with an obstacle.
 
void SetObjectRidingBehavior (ObjectRidingBehavior objectRidingBehavior)
 Sets the function which determines whether the controller should be able to ride on other objects or should slide.
 
void SetControllerRidingBehavior (ControllerRidingBehavior controllerRidingBehavior)
 Sets the function which determines whether the controller should slide when standing on another character.
 
void SetObstacleRidingBehavior (ObstacleRidingBehavior obstacleRidingBehavior)
 Sets the function which determines whether the controller should be able to ride on obstacles or should slide.
 
bool filter (const physx::PxController &controllerA, const physx::PxController &controllerB) override
 
physx::PxQueryHitType::Enum preFilter (const physx::PxFilterData &filterData, const physx::PxShape *shape, const physx::PxRigidActor *actor, physx::PxHitFlags &queryFlags) override
 
physx::PxQueryHitType::Enum postFilter (const physx::PxFilterData &filterData, const physx::PxQueryHit &hit) override
 
void onShapeHit (const physx::PxControllerShapeHit &hit) override
 
void onControllerHit (const physx::PxControllersHit &hit) override
 
void onObstacleHit (const physx::PxControllerObstacleHit &hit) override
 
physx::PxControllerBehaviorFlags getBehaviorFlags (const physx::PxShape &shape, const physx::PxActor &actor) override
 
physx::PxControllerBehaviorFlags getBehaviorFlags (const physx::PxController &controller) override
 
physx::PxControllerBehaviorFlags getBehaviorFlags (const physx::PxObstacle &obstacle) override
 

Detailed Description

Manages callbacks for character controller collision filtering, collision notifications, and handling riding on objects.

Member Typedef Documentation

◆ ObjectPostFilter

using PhysX::CharacterControllerCallbackManager::ObjectPostFilter = AZStd::function<physx::PxQueryHitType::Enum(const physx::PxFilterData&, const physx::PxQueryHit&)>

Called after an exact intersection test has identified another object as obstructing the controller's path (if the ePOSTFILTER flag is set in the controller's filter flags).

◆ ObjectPreFilter

using PhysX::CharacterControllerCallbackManager::ObjectPreFilter = AZStd::function<physx::PxQueryHitType::Enum(const physx::PxFilterData&, const physx::PxShape*,const physx::PxRigidActor*, physx::PxHitFlags&)>

Called when another object has been identified as potentially obstructing the controller's path, but before an exact intersection test has been performed (if the ePREFILTER flag is set in the controller's filter flags).

Member Function Documentation

◆ SetControllerFilter()

void PhysX::CharacterControllerCallbackManager::SetControllerFilter ( ControllerFilter  controllerFilter)

Sets the function which determines whether this controller should be obstructed by other controllers or able to move through them.

◆ SetObjectPostFilter()

void PhysX::CharacterControllerCallbackManager::SetObjectPostFilter ( ObjectPostFilter  objectPostFilter)

Sets the function which is called after an exact intersection test has identified another object as obstructing the controller's path. The function will only be called if the ePOSTFILTER flag is set in the controller's filter flags.

◆ SetObjectPreFilter()

void PhysX::CharacterControllerCallbackManager::SetObjectPreFilter ( ObjectPreFilter  objectPreFilter)

Sets the function which is called when another object has been identified as potentially obstructing the controller's path, but before an exact intersection test has been performed. The function will only be called if the ePREFILTER flag is set in the controller's filter flags.


The documentation for this class was generated from the following file: