Here !Who can tell why we should do it?

hehykissool
Posts: 5
Joined: Thu Oct 11, 2012 6:29 am

Here !Who can tell why we should do it?

Post by hehykissool »

When we are constructing a new btCollisionWorld
,We should

Code: Select all

btCollisionWorld (btDispatcher *dispatcher, btBroadphaseInterface *broadphasePairCache, btCollisionConfiguration *collisionConfiguration)
otherwise,

Code: Select all

btCollisionWorld::btCollisionWorld(btDispatcher* dispatcher,btBroadphaseInterface* pairCache, btCollisionConfiguration* collisionConfiguration)
:m_dispatcher1(dispatcher),
m_broadphasePairCache(pairCache),
m_debugDrawer(0),
m_forceUpdateAllAabbs(true)
{
	m_stackAlloc = collisionConfiguration->getStackAllocator();
	m_dispatchInfo.m_stackAllocator = m_stackAlloc;
}

the parameter btCollisionConfiguration *collisionConfiguration has never been used,so why we should input one here?
Mako_energy02
Posts: 171
Joined: Sun Jan 17, 2010 4:47 am

Re: Here !Who can tell why we should do it?

Post by Mako_energy02 »

It is used, actually. Even in your own example. >.>

In the curly brackets, it gets the stack allocator from the collision configuration and assigns that to the dispatcher's stack allocator.
hehykissool
Posts: 5
Joined: Thu Oct 11, 2012 6:29 am

Re: Here !Who can tell why we should do it?

Post by hehykissool »

Mako_energy02 wrote:It is used, actually. Even in your own example. >.>

In the curly brackets, it gets the stack allocator from the collision configuration and assigns that to the dispatcher's stack allocator.

so,why not use the dispatcher->getCollisionConfiguation(),could this CollisionConfiguation be different from the dispatcher->getCollisionConfiguation()?
hehykissool
Posts: 5
Joined: Thu Oct 11, 2012 6:29 am

Re: Here !Who can tell why we should do it?

Post by hehykissool »

Mako_energy02 wrote:It is used, actually. Even in your own example. >.>

In the curly brackets, it gets the stack allocator from the collision configuration and assigns that to the dispatcher's stack allocator.

Oh,I know where the I'm wrong , They're the same one , but Could it been using the dispatcher->getCollisionConfiguation() instead ?