Bullets blooming to sphere when they hit ground or player |
class pCallBacks:public PxSimulationEventCallback{
public:
pCallBacks(void);
~pCallBacks(void);
PxFilterFlags TestFilterShader(
PxFilterObjectAttributes attributes0, PxFilterData filterData0,
PxFilterObjectAttributes attributes1, PxFilterData filterData1,
PxPairFlags& pairFlags, const void* constantBlock, PxU32 constantBlockSize);
void onConstraintBreak(PxConstraintInfo* constraints, PxU32 count);
void onWake(PxActor** actors, PxU32 count);
void onSleep(PxActor** actors, PxU32 count);
void onContact(const PxContactPairHeader& pairHeader, const PxContactPair* pairs, PxU32 nbPairs);
void onTrigger(PxTriggerPair* pairs, PxU32 count);
};
pCallBacks gCallbacks;
And then just set the callbacks on the init:
sceneDesc.simulationEventCallback = &gCallbacks;
The problem currently is that I need to make a new list for explosions and then remove these actors from the physics simulation (currentl the spheres bounce around instead of staying in one spot). Ill try to achieve that for the next post on the blog.
No comments:
Post a Comment