Mausinator08 / bullet

Automatically exported from code.google.com/p/bullet
0 stars 0 forks source link

when to clear PredictiveContacts?i have a different idea #722

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.PredictiveContacts are clear when a frame is begin
2.if i remove and delete a object from dynamic world after a step over,the 
Predictive manifold will access a invalid pointer to the rigidbody

What is the expected output? What do you see instead?
i used a object to simulate a projectile,so when the projectile boomed,i remove 
the rigidbody and delete it.i wll cause a crash.so i think if remove the code:
void    btDiscreteDynamicsWorld::clearPredictiveContacts()
{
    BT_PROFILE("release predictive contact manifolds");

    for (int i=0;i<m_predictiveManifolds.size();i++)
    {
        btPersistentManifold* manifold = m_predictiveManifolds[i];
        this->m_dispatcher1->releaseManifold(manifold);
    }
    m_predictiveManifolds.clear();
}
int the end of a frame step ,will be more safely.
What version of the product are you using? On what operating system?
2.83 win7

Please provide any additional information below.

Original issue reported on code.google.com by chineseo...@gmail.com on 8 Jul 2013 at 1:32

GoogleCodeExporter commented 8 years ago
Can you reproduce this in any of the Bullet demos?

Original comment by erwin.coumans on 13 Sep 2013 at 4:55

GoogleCodeExporter commented 8 years ago
"i used a object to simulate a projectile,so when the projectile boomed,i 
remove the rigidbody and delete it.i wll cause a crash"

Do you have a full stack trace of the crash? (in debug mode)

Original comment by erwin.coumans on 16 Sep 2013 at 6:20

GoogleCodeExporter commented 8 years ago
We have a similar issue in the latest version. One of the collision object 
pointer is invalid. I'll try to reproduce in a demo. 

Original comment by nharisha...@gmail.com on 17 Sep 2013 at 4:33

GoogleCodeExporter commented 8 years ago
moved to https://github.com/bulletphysics/bullet3/issues/85

Original comment by erwin.coumans on 30 Mar 2014 at 5:51

GoogleCodeExporter commented 8 years ago
i think this is caused by the Manifold cache.I now send the modified version of 
me.i add two callback function when getNewManifold and releaseManifold.why i 
modified this is because ,i find if i use physics engine to check trigger box 
in the game scene,the addcontact callback will called manytimes and i should 
judge every time.but if i add the two callback,i can clearly know ,when object 
collide the trigger and when it leaved.
i add a clearPredictiveContacts function to avoid the rigidbody deleted in my 
game logic between two physice engine step logic.eg,if a not called 
clearPredictiveContacts ,when i called releaseManifold callback,i maybe get a 
wrong cache value of the rigidbody.

Original comment by chineseo...@gmail.com on 22 May 2014 at 2:22

Attachments: