HELP!:a strange question but easy to perform

beyondlwm
Posts: 3
Joined: Thu Aug 30, 2007 11:38 am

HELP!:a strange question but easy to perform

Post by beyondlwm »

when I first use the "appBasicDemo"
the "floor" is :

btCollisionShape* groundShape = new btSphereShape(btScalar(50.));


but when I change it to:


btCollisionShape* groundShape = new btBoxShape(btVector3(50.,50,50));


I found that:the shotBox can run through the ground!

what's the matter?I am a learner,I need your help right now ,cause it's important for me.
beyondlwm
Posts: 3
Joined: Thu Aug 30, 2007 11:38 am

Post by beyondlwm »

dispatcher->registerCollisionCreateFunc(BOX_SHAPE_PROXYTYPE,BOX_SHAPE_PROXYTYPE,new BoxBoxCollisionAlgorithm::CreateFunc);



I am clear now ,sorry...
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Post by Erwin Coumans »

The basic demo is confusing indeed, it doesn't register any collision functions, because it passes 'true' in the constructor.

Code: Select all

	m_dispatcher = new	btCollisionDispatcher(true);
Please remove the 'true' to fix this:

Code: Select all

	m_dispatcher = new	btCollisionDispatcher();
Thanks,
Erwin
beyondlwm
Posts: 3
Joined: Thu Aug 30, 2007 11:38 am

Post by beyondlwm »

your suggestion is quite good!thanks ,now it's running well.
tjloughl
Posts: 23
Joined: Wed Oct 03, 2007 4:03 am

Re: HELP!:a strange question but easy to perform

Post by tjloughl »

Which version of bullet are you guys using? I downloaded Bullet 2.62 and I am getting an error that says

'btCollisionDispatcher' : no appropriate default constructor available

I get this when I leave the constructor blank, as was suggested in the last post. I have to do something like,

Code: Select all

dispatcher = new	btCollisionDispatcher(collisionConfiguration);
On a similar note, I have my world set up like this, based on some of the demo code I have been seeing:

Code: Select all

	btCollisionDispatcher* dispatcher=0;

	btDefaultCollisionConfiguration* collisionConfiguration = new btDefaultCollisionConfiguration();
	dispatcher = new	btCollisionDispatcher(collisionConfiguration);
	
	btVector3 worldAabbMin(-100000,-100000,-100000);
	btVector3 worldAabbMax(100000,100000,100000);

	btBroadphaseInterface* broadphase = new btAxisSweep3(-worldAabbMax,worldAabbMax);
	btSequentialImpulseConstraintSolver* solver = new btSequentialImpulseConstraintSolver;


	m_btDynamicsWorld = new btDiscreteDynamicsWorld(dispatcher, broadphase, solver);
	m_btDynamicsWorld->getDispatchInfo().m_enableSPU = true;
Is this right? My objects are going crazy in my world so I don't think my world is set up right.