PhysX SDK 3.2 API Reference: PxSimulationEventCallback Class Reference

PhysX SDK 3.2 API

PxSimulationEventCallback Class Reference
[Physics]

An interface class that the user can implement in order to receive simulation events. More...

#include <PxSimulationEventCallback.h>

List of all members.


Public Member Functions

virtual void onConstraintBreak (PxConstraintInfo *constraints, PxU32 count)=0
 This is called when a breakable constraint breaks.
virtual void onWake (PxActor **actors, PxU32 count)=0
 This is called during PxScene::fetchResults with the actors which have just been woken up.
virtual void onSleep (PxActor **actors, PxU32 count)=0
 This is called during PxScene::fetchResults with the actors which have just been put to sleep.
virtual void onContact (const PxContactPairHeader &pairHeader, const PxContactPair *pairs, PxU32 nbPairs)=0
 The user needs to implement this interface class in order to be notified when certain contact events occur.
virtual void onTrigger (PxTriggerPair *pairs, PxU32 count)=0
virtual ~PxSimulationEventCallback ()

Detailed Description

An interface class that the user can implement in order to receive simulation events.

Note:
SDK state should not be modified from within the callbacks. In particular objects should not be created or destroyed. If state modification is needed then the changes should be stored to a buffer and performed after the simulation step.
Threading: It is not necessary to make this class thread safe as it will only be called in the context of the user thread.

See also:
PxScene.setSimulationEventCallback() PxScene.getSimulationEventCallback()

Constructor & Destructor Documentation

virtual PxSimulationEventCallback::~PxSimulationEventCallback (  )  [inline, virtual]


Member Function Documentation

virtual void PxSimulationEventCallback::onConstraintBreak ( PxConstraintInfo constraints,
PxU32  count 
) [pure virtual]

This is called when a breakable constraint breaks.

Note:
The user should not release the constraint shader inside this call!
Parameters:
[in] constraints - The constraints which have been broken.
[in] count - The number of constraints
See also:
PxConstraint PxConstraintDesc.linearBreakForce PxConstraintDesc.angularBreakForce

virtual void PxSimulationEventCallback::onContact ( const PxContactPairHeader pairHeader,
const PxContactPair pairs,
PxU32  nbPairs 
) [pure virtual]

The user needs to implement this interface class in order to be notified when certain contact events occur.

The method will be called for a pair of actors if one of the colliding shape pairs requested contact notification. You request which events are reported using the filter shader/callback mechanism (see PxSimulationFilterShader, PxSimulationFilterCallback, PxPairFlag).

Do not keep references to the passed objects, as they will be invalid after this function returns.

Parameters:
[in] pairHeader Information on the two actors whose shapes triggered a contact report.
[in] pairs The contact pairs of two actors for which contact reports have been requested. See PxContactPair.
[in] nbPairs The number of provided contact pairs.
See also:
PxScene.setSimulationEventCallback() PxSceneDesc.simulationEventCallback PxContactPair PxPairFlag PxSimulationFilterShader PxSimulationFilterCallback

virtual void PxSimulationEventCallback::onSleep ( PxActor **  actors,
PxU32  count 
) [pure virtual]

This is called during PxScene::fetchResults with the actors which have just been put to sleep.

Note:
Only supported by rigid bodies yet.

Only called on actors for which the PxActorFlag eSEND_SLEEP_NOTIFIES has been set.

Parameters:
[in] actors - The actors which have just been put to sleep.
[in] count - The number of actors
See also:
PxScene.setSimulationEventCallback() PxSceneDesc.simulationEventCallback PxActorFlag PxActor.setActorFlag()

virtual void PxSimulationEventCallback::onTrigger ( PxTriggerPair pairs,
PxU32  count 
) [pure virtual]

virtual void PxSimulationEventCallback::onWake ( PxActor **  actors,
PxU32  count 
) [pure virtual]

This is called during PxScene::fetchResults with the actors which have just been woken up.

Note:
Only supported by rigid bodies yet.

Only called on actors for which the PxActorFlag eSEND_SLEEP_NOTIFIES has been set.

Parameters:
[in] actors - The actors which just woke up.
[in] count - The number of actors
See also:
PxScene.setSimulationEventCallback() PxSceneDesc.simulationEventCallback PxActorFlag PxActor.setActorFlag()


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



Copyright © 2008-2012 NVIDIA Corporation, 2701 San Tomas Expressway, Santa Clara, CA 95050 U.S.A. All rights reserved. www.nvidia.com