world for soft bodies

OSasuke
Posts: 47
Joined: Tue Dec 09, 2008 10:12 am

world for soft bodies

Post by OSasuke »

Hello,

I have some problems to use soft bodies in my application.
I can't create a world for the soft bodies.

This is my code:

Code: Select all

#include <cstdlib>
#include <iostream>
#include <btBulletDynamicsCommon.h>
#include <Bullet-C-Api.h>
#include <btBulletCollisionCommon.h>
#include <BulletSoftBody/btSoftBody.h>
#include <BulletSoftBody/btSoftRigidDynamicsWorld.h>
#include <BulletSoftBody/btSoftBodyRigidBodyCollisionConfiguration.h>
#include <BulletSoftBody/btSoftBodyHelpers.h>

using namespace std ;

int main(int argc, char *argv)
{
    btVector3 worldAabbMin(-1000,-1000,-1000);
    btVector3 worldAabbMax(1000,1000,1000);

    btSoftBodyWorldInfo	m_softBodyWorldInfo;

    int maxProxies = 1024;
    btAxisSweep3* broadphase = new btAxisSweep3(worldAabbMin,worldAabbMax,maxProxies);

    m_softBodyWorldInfo.m_broadphase = broadphase;

    btDefaultCollisionConfiguration* collisionConfiguration = new btSoftBodyRigidBodyCollisionConfiguration() ;
    btCollisionDispatcher* dispatcher = new	btCollisionDispatcher(collisionConfiguration);
    m_softBodyWorldInfo.m_dispatcher = dispatcher;

    btSequentialImpulseConstraintSolver* solver = new btSequentialImpulseConstraintSolver();

    btDiscreteDynamicsWorld* world = new btSoftRigidDynamicsWorld(dispatcher,broadphase,solver,collisionConfiguration);

    world->getDispatchInfo().m_enableSPU = true;
    world->setGravity(btVector3(0,-10,0));
    m_softBodyWorldInfo.m_gravity.setValue(0,-10,0);

    delete broadphase;
    delete dispatcher;
    delete solver;
    delete collisionConfiguration;
    delete world;

    return 0;
}

And this is the build messages of the compiler:

Code: Select all

btDiscreteDynamicsWorld.cpp||undefined reference to `btSimulationIslandManager::btSimulationIslandManager()'|
btDiscreteDynamicsWorld.cpp||undefined reference to `btSimulationIslandManager::btSimulationIslandManager()'|
btDiscreteDynamicsWorld.cpp||undefined reference to `btSimulationIslandManager::buildAndProcessIslands(btDispatcher*, btCollisionWorld*, btSimulationIslandManager::IslandCallback*)'|
||=== Build finished: 3 errors, 0 warnings ===|
Can anyone help me ?
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: world for soft bodies

Post by Erwin Coumans »

Which version of Bullet do you use?

Do the Bullet demos compile fine for you?

What platform / compiler / build system do you use?
Thanks,
Erwin
OSasuke
Posts: 47
Joined: Tue Dec 09, 2008 10:12 am

Re: world for soft bodies

Post by OSasuke »

I am under windows XP and I use the gcc compiler with the code::blocks IDE and yhe version of bullet is 2.72 .

thanks.
OSasuke
Posts: 47
Joined: Tue Dec 09, 2008 10:12 am

Re: world for soft bodies

Post by OSasuke »

Sorry it is the version 2.73-sp1

What can I do ?

Is the version which has the problem ?
OSasuke
Posts: 47
Joined: Tue Dec 09, 2008 10:12 am

Re: world for soft bodies

Post by OSasuke »

I passed a lot of time to find the solution to my problem. And finaly, i found it.
The problem is the order of the linke librairies.

Before I place it in the following order:
1- libbulletcollision.a
2- libbulletdynamics.a
3- libbulletmath.a
4- libbulletsoftbody.a

When I saw the "CMakeLists.txt" of a bullet demo, the order is like this:
1- BulletSoftBody
2- libbulletdynamics.a
3- libbulletcollision.a
4- libbulletmath.a

Thanks again.

I have a last question (not very important): Why the order of the link librairies can cause problems ?