mamairaja
23-02-2010 17:33:15
NO NEED TO LOOK AT MY CODE TO ANSWER MY QUESTION
Hi
Do we have a solution for collision callback with bloodymess 1.5.5 without including Physx.
I have just managed to complete basics but needed to use Physx.
Hi
Do we have a solution for collision callback with bloodymess 1.5.5 without including Physx.
I have just managed to complete basics but needed to use Physx.
mScene->getScene()->setUserContactReport(...);
#include <NxUserContactReport.h>
#include <NxActor.h>
#define DebugMessage(str) OutputDebugString(str)
class GameUserContactReport : public NxUserContactReport
{
private:
NxActor* playerActor;
NxActor* enemyActor;
public:
GameUserContactReport():NxUserContactReport()
{
playerActor = 0;
enemyActor = 0;
}
void setPlayerActor(NxActor* act)
{
this->playerActor = act;
}
void setEnemyActor(NxActor* act)
{
this->enemyActor = act;
}
void onContactNotify(NxContactPair& pair, NxU32 events)
{
if(pair.actors[0]==playerActor)
DebugMessage(" 0 playerActor\n");
if(pair.actors[0]==enemyActor)
DebugMessage("0 enemyActor\n");
if(pair.actors[1]==playerActor)
DebugMessage(" 1 playerActor\n");
if(pair.actors[1]==enemyActor)
DebugMessage("1 enemyActor\n");
}
};