PxTaskManager
Defined in include/task/PxTaskManager.h
-
class PxTaskManager
The PxTaskManager interface.
A PxTaskManager instance holds references to user-provided dispatcher objects. When tasks are submitted the PxTaskManager routes them to the appropriate dispatcher and handles task profiling if enabled. Users should not implement the PxTaskManager interface, the SDK creates its own concrete PxTaskManager object per-scene which users can configure by passing dispatcher objects into the PxSceneDesc.
See also
Public Functions
-
virtual void setCpuDispatcher(PxCpuDispatcher &ref) = 0
Set the user-provided dispatcher object for CPU tasks.
See also
- Parameters
ref – [in] The dispatcher object.
-
virtual PxCpuDispatcher *getCpuDispatcher() const = 0
Get the user-provided dispatcher object for CPU tasks.
See also
- Returns
The CPU dispatcher object.
-
virtual void resetDependencies() = 0
Reset any dependencies between Tasks.
See also
Note
Will be called at the start of every frame before tasks are submitted.
-
virtual void startSimulation() = 0
Called by the owning scene to start the task graph.
See also
Note
All tasks with ref count of 1 will be dispatched.
-
virtual void stopSimulation() = 0
Called by the owning scene at the end of a simulation step.
-
virtual void taskCompleted(PxTask &task) = 0
Called by the worker threads to inform the PxTaskManager that a task has completed processing.
- Parameters
task – [in] The task which has been completed
-
virtual PxTaskID getNamedTask(const char *name) = 0
Retrieve a task by name.
- Parameters
name – [in] The unique name of a task
- Returns
The ID of the task with that name, or eNOT_PRESENT if not found
-
virtual PxTaskID submitNamedTask(PxTask *task, const char *name, PxTaskType::Enum type = PxTaskType::eCPU) = 0
Submit a task with a unique name.
- Parameters
task – [in] The task to be executed
name – [in] The unique name of a task
type – [in] The type of the task (default eCPU)
- Returns
The ID of the task with that name, or eNOT_PRESENT if not found
-
virtual PxTaskID submitUnnamedTask(PxTask &task, PxTaskType::Enum type = PxTaskType::eCPU) = 0
Submit an unnamed task.
- Parameters
task – [in] The task to be executed
type – [in] The type of the task (default eCPU)
- Returns
The ID of the task with that name, or eNOT_PRESENT if not found
-
virtual PxTask *getTaskFromID(PxTaskID id) = 0
Retrieve a task given a task ID.
- Parameters
id – [in] The ID of the task to return, a valid ID must be passed or results are undefined
- Returns
The task associated with the ID
-
virtual void release() = 0
Release the PxTaskManager object, referenced dispatchers will not be released.
Public Static Functions
-
static PxTaskManager *createTaskManager(PxErrorCallback &errorCallback, PxCpuDispatcher* = NULL)
Construct a new PxTaskManager instance with the given [optional] dispatchers.
Protected Functions
-
inline virtual ~PxTaskManager()
Friends
- friend class PxBaseTask
- friend class PxTask
- friend class PxLightCpuTask
-
virtual void setCpuDispatcher(PxCpuDispatcher &ref) = 0