Physics Simulation Forum

 

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Wed May 09, 2012 8:45 pm 
Offline

Joined: Tue May 08, 2012 8:32 pm
Posts: 2
Hi all,

I have a bug that i just can't fix , i would really appreciate your help.

I'm using bullet for a FPS ( using Ogre), this problem occurs on windows, linux, with release 2.80 && 2.79 of bullet.

I'm creating bullets like this:

Code:
btPairCachingGhostObject * tirGhostObject =new btPairCachingGhostObject();
tirGhostObject->setWorldTransform(startTransform);
btScalar bulletDimension = 0.2f;

btConvexShape * capsule =new btBoxShape(btVector3(bulletDimension,bulletDimension,bulletDimension));
mPhysics->addCollisionShape(capsule);
tirGhostObject->setCollisionShape(capsule);
               tirGhostObject->setCollisionFlags(btCollisionObject::CF_NO_CONTACT_RESPONSE);//|btCollisionObject::CF_NO_CONTACT_RESPONSE);
mPhysics->addCollisionObject(tirGhostObject, btBroadphaseProxy::SensorTrigger,//&btBroadphaseProxy::DefaultFilter,
                                 btBroadphaseProxy::CharacterFilter);

Vector3 orientation(mShootNode->getOrientation().zAxis());
mPhysics->getBroadphase()->getOverlappingPairCache()->setInternalGhostPairCallback(new btGhostPairCallback());


// This one ==========>
mPhysics->getDynamicsWorld()->addCollisionObject(tirGhostObject, btBroadphaseProxy::SensorTrigger,btBroadphaseProxy::CharacterFilter);
<=====================

mPhysics->getDynamicsWorld()->addAction(newTir->getPhysics());


I detect collision with the characters by using the flags spécified up there!

My program randomly crashes (segmentation fault),when i add collision object to my discrete dynamic world (not at the moment when i add them, but after). Sometimes it happens after 10 bullets, sometimes after 3.

If i dont add them to the world (by not adding the line specified , there is no problems in my application

I've tried everything i know, does someone have an idea?


Top
 Profile  
 
PostPosted: Thu May 10, 2012 3:12 pm 
Offline

Joined: Tue May 08, 2012 8:32 pm
Posts: 2
(Sorry for the double post, but maybe this data could help)

In fact I just realized that i have the same problem with the characters (that i create approximatly the same way that in the character demo), it only has crash problems when i addacollision object from an other thread !
if i shoot 100 times or a create 100 characters the application works well, but if an other thread does it, crashes !

Is there any know problem about multi-threading, (an sfml thread, and a Ogre thread) in bullet?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group