Simulation Callback not Calling Back

OK, so I have a class called Level which inherits from PxSimulationEventCallback and it has all needed methods implemented, yet none of the methods get called.

To assign the class as the callback for the particular scene I do this:

// This inside the Level constructor, where the scene is created. (I removed that part for the sake of simplicity)
sceneDesc.flags |= PxSceneFlag::eENABLE_ACTIVETRANSFORMS;
mPxScene = mPxPhysics->createScene(sceneDesc);

Is there anything I’m missing, perhaps I’m adding the flag wrongly ?

EDIT: I also tried calling mPxScene->getActiveTransforms() and that did nothing to change the situation.

I haven’t specified the callback like this before. But technically it looks okay to me.

You could try specifying the callback in the sceneDesc and see if that makes any difference for you.

sceneDesc.flags |= PxSceneFlag::eENABLE_ACTIVETRANSFORMS;
sceneDesc.simulationEventCallback = this;
mPxScene = mPxPhysics->createScene(sceneDesc);

Which functions of PxSimulationEventCallback are you trying to call?

For onWake, onSleep: Only called on actors for which the PxActorFlag eSEND_SLEEP_NOTIFIES has been set.

For onContact, onTrigger, remember to return corresponding flags in the filter shader (eNOTIFY_TOUCH_FOUND, eTRIGGER_DEFAULT, etc) eTRIGGER_SHAPE.

onSleep and onWake are what I needed. I tried cjtallman’s suggestion, but that didn’t help. I’ll try adding the Actor flags too. Thanks for the reply :)

EDIT: Yupp, that did it :) Thanks a lot.