X11OpenGLWindow: create stencil buffer for shadows in OpenGL2 mode (OpenGL3 uses shadow maps)
Add 'createCollisionObjectGraphicsObject' API for CommonPhysicsSetup Add 'pthread' dependency as workaround for NVIDIA graphics driver issue (see //See https://bugs.launchpad.net/ubuntu/+source/nvidia-graphics-drivers-319/+bug/1248642 )
This commit is contained in:
@@ -3,19 +3,59 @@
|
||||
|
||||
SerializeSetup::SerializeSetup()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
SerializeSetup::~SerializeSetup()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
void SerializeSetup::initPhysics(GraphicsPhysicsBridge& gfxBridge)
|
||||
{
|
||||
this->createEmptyDynamicsWorld();
|
||||
gfxBridge.createPhysicsDebugDrawer(m_dynamicsWorld);
|
||||
m_dynamicsWorld->getDebugDrawer()->setDebugMode(btIDebugDraw::DBG_DrawWireframe);
|
||||
btBulletWorldImporter* importer = new btBulletWorldImporter(m_dynamicsWorld);
|
||||
const char* filename = "testFile.bullet";
|
||||
importer->loadFile(filename);
|
||||
}
|
||||
const char* someFileName="spider.bullet";
|
||||
|
||||
const char* prefix[]={"./","./data/","../data/","../../data/","../../../data/","../../../../data/"};
|
||||
int numPrefixes = sizeof(prefix)/sizeof(const char*);
|
||||
char relativeFileName[1024];
|
||||
FILE* f=0;
|
||||
bool fileFound = false;
|
||||
int result = 0;
|
||||
|
||||
for (int i=0;!f && i<numPrefixes;i++)
|
||||
{
|
||||
sprintf(relativeFileName,"%s%s",prefix[i],someFileName);
|
||||
f = fopen(relativeFileName,"rb");
|
||||
if (f)
|
||||
{
|
||||
fileFound = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (f)
|
||||
{
|
||||
fclose(f);
|
||||
}
|
||||
|
||||
|
||||
importer->loadFile(relativeFileName);
|
||||
|
||||
//for now, guess the up axis from gravity
|
||||
if (m_dynamicsWorld->getGravity()[1] == 0.f)
|
||||
{
|
||||
gfxBridge.setUpAxis(2);
|
||||
} else
|
||||
{
|
||||
gfxBridge.setUpAxis(1);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
void SerializeSetup::stepSimulation(float deltaTime)
|
||||
{
|
||||
CommonRigidBodySetup::stepSimulation(deltaTime);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user