I'm trying to get PhysX SDK set up in C++ for Irrlicht and for some reason, it just wont create, i put a condition to exit the app if it didn't create and it exited. here's my code.
PhysX.h:
#ifndef PHYSX_H
#define PHYSX_H
#include <NxPhysics.h>
#include <PhysXLoader.h>
#define NOMINMAX
#include <Irrlicht.h>
using namespace irr;
using namespace scene;
class PhysX
{
protected:
NxPhysicsSDK* pPhysXSDK;
NxScene* pPhysXScene;
NxSceneDesc pSceneDesc;
NxMaterial* pDefaultMaterial;
NxVec3 defaultGravity;
NxActor* pGlobalActor;
public:
PhysX()
{
this->pPhysXSDK = NULL;
this->pPhysXScene = NULL;
//this->pSceneDesc = NULL;
this->defaultGravity = NxVec3(0,-9.81,0);
}
~PhysX()
{}
bool CreatePhysXEngine();
// NxActor CreateTestActor(scene::ISceneNode* Node);
void Update(NxReal Fps);
//NxPhysicsSDK* getPhysXSDK();
// NxScene* getScene();
};
#endif
PhysX.cpp:
#include "PhysX.h"
bool PhysX::CreatePhysXEngine()
{
pPhysXSDK = NxCreatePhysicsSDK(NX_PHYSICS_SDK_VERSION);
if(pPhysXSDK)
{
pPhysXSDK->setParameter(NX_SKIN_WIDTH,0.10f);
}
else
{
exit(0);
}
pSceneDesc.gravity = defaultGravity;
pPhysXScene =pPhysXSDK->createScene(pSceneDesc);
if(pPhysXScene)
{
pDefaultMaterial = pPhysXScene->getMaterialFromIndex(0);
pDefaultMaterial->setRestitution(0.0f);
pDefaultMaterial->setStaticFriction(0.5f);
pDefaultMaterial->setDynamicFriction(0.0f);
}
return true;
}
/*
NxActor PhysX::CreateTestActor(irr::scene::ISceneNode *Node)
{
NxActor Dummy;
NxActorDesc actorDesc;
NxBodyDesc bodyDesc;
NxBoxShapeDesc boxDesc;
boxDesc.dimensions.set(0.5f,0.5f,0.5f);
boxDesc.mass = 10.0f;
boxDesc.skinWidth = 0.5f;
actorDesc.shapes.push_back(&boxDesc);
actorDesc.body = &bodyDesc;
actorDesc.density = 10;
actorDesc.globalPose.t = NxVec3(0.0,10.0f,0.0f);
this->pPhysXScene->createActor(&Dummy);
//Dummy = this->pGlobalActor;
return Dummy;
}*/
void PhysX::Update(NxReal fps)
{
pPhysXScene->simulate(fps);
}
what do you guys think it could be? (I tried my other implamentation and i get access violations on the Scene Variable.)
"Originally I was going to have a BS on it but you know how that would be. I can't walk around with the letters BS on me." More or less a qoute by Syndrome from Jack, Jack, attack