Bug in sio2PhysicRemoveObject

View previous topic View next topic Go down

Bug in sio2PhysicRemoveObject

Post  matt on Fri Oct 03, 2008 5:13 pm

There's a bug in the sio2PhysicRemoveObject method.

It reads,
Code:
void sio2PhysicRemoveObject( SIO2physic *_SIO2physic,
                      SIO2object *_SIO2object )
{
   int i = 0;

   while( i != _SIO2physic->_btDiscreteDynamicsWorld->getNumCollisionObjects() )
   {
      btCollisionObject *_btCollisionObject = _SIO2physic->_btDiscreteDynamicsWorld->getCollisionObjectArray()[ 0 ];

but the array should be addressed with the current index [ i ] in order to search for the object to be removed.

Best,
Matt

matt

Posts : 155
Join date : 2008-09-30

View user profile http://elfrun.net

Back to top Go down

Re: Bug in sio2PhysicRemoveObject

Post  sio2interactive on Fri Oct 03, 2008 8:23 pm

Totally right, tks! and the same thing in sio2PhysicRemoveCamera()

it should be like this:

Code:

   int i = 0;

   while( i != _SIO2physic->_btDiscreteDynamicsWorld->getNumCollisionObjects() )
   {
      btCollisionObject *_btCollisionObject = _SIO2physic->_btDiscreteDynamicsWorld->getCollisionObjectArray()[ i ];

avatar
sio2interactive

Posts : 1526
Join date : 2008-08-26
Age : 37
Location : Shanghai

View user profile http://sio2interactive.com

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum