I am experimenting with the multithreading capability of bullet in the following simple example I get unknown address error. The btCollisionConfiguration is initialized correctly and I would appreciate some insight into the problem. here is the example:
#include <btBulletDynamicsCommon.h>
#include "BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolverMt.h"
#include "BulletCollision/CollisionDispatch/btCollisionDispatcherMt.h"
#include "BulletCollision/BroadphaseCollision/btDbvtBroadphase.h"
#include "BulletCollision/CollisionShapes/btBoxShape.h"
#include "BulletDynamics/Dynamics/btDiscreteDynamicsWorld.h"
int main() {
auto collisionConfig = std::make_unique<btDefaultCollisionConfiguration>();
auto dispatcher = std::make_unique<btCollisionDispatcherMt>(collisionConfig.get());
auto broadphase = std::make_unique<btDbvtBroadphase>();
auto solver = std::make_unique<btSequentialImpulseConstraintSolverMt>();
auto dynamicsWorld = std::make_unique<btDiscreteDynamicsWorld>(dispatcher.get(), broadphase.get(), solver.get(), collisionConfig.get());
dynamicsWorld->setGravity(btVector3(0, -10, 0));
auto boxShape = std::make_unique<btBoxShape>(btVector3(1, 1, 1));
btScalar mass = 1.0;
btVector3 localInertia(0, 0, 0);
boxShape->calculateLocalInertia(mass, localInertia);
btTransform startTransform;
startTransform.setIdentity();
startTransform.setOrigin(btVector3(0, 50, 0));
auto motionState = std::make_unique<btDefaultMotionState>(startTransform);
btRigidBody::btRigidBodyConstructionInfo rbInfo(mass, motionState.get(), boxShape.get(), localInertia);
auto body = std::make_unique<btRigidBody>(rbInfo);
dynamicsWorld->addRigidBody(body.get());
for (int i = 0; i < 100; ++i) {
dynamicsWorld->stepSimulation(1.f / 60.f, 10);
}
return 0;
}
I am experimenting with the multithreading capability of bullet in the following simple example I get unknown address error. The btCollisionConfiguration is initialized correctly and I would appreciate some insight into the problem. here is the example:
here is my Cmake file:
Here is the error: