can anyone get this bullet physics test app running?

Post Reply
Neurone
Posts: 7
Joined: Mon May 18, 2015 3:45 pm

can anyone get this bullet physics test app running?

Post by Neurone »

Hi,

I've tried compiling the following code on visual studio 2013 as debug configuration, win32 console app:

#include <memory>
#include <btBulletCollisionCommon.h>
#include <btBulletDynamicsCommon.h>

#pragma comment(lib,"BulletCollision_Debug.lib")
#pragma comment(lib,"BulletDynamics_Debug.lib")
#pragma comment(lib,"LinearMath_Debug.lib")

int _tmain(int argc, _TCHAR* argv[])
{
btVector3 inertia(0, 0, 0);
btScalar mass = 0.0;

std::shared_ptr<btDefaultMotionState> motionState = std::make_shared<btDefaultMotionState>(btTransform(btQuaternion(0, 0, 0, 1), btVector3(0, 0, 0)));
btCollisionShape* shape = new btBoxShape(btVector3(2, 2, 2));
shape->calculateLocalInertia(mass, inertia);
btRigidBody::btRigidBodyConstructionInfo info(mass, motionState.get(), shape, inertia);
std::shared_ptr<btRigidBody> body = std::make_shared<btRigidBody>(info);
return 0;
}

It compiles fine, but when i try running it it produces an access violation error. Can anyone else see if this code can be ran without any errors? I'm wondering if its something on my machine that doesn't like bullet physics very much.
Post Reply