Jump to content
  • Advertisement
Sign in to follow this  

Invalid internal pointers after startup

This topic is 2084 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I've been playing around with bullet and bumped into a problem.

The collision shapes cannot be deleted right after they are created.


Here are some samples;


First the init:

coll_config=new btDefaultCollisionConfiguration();
coll_dispatch=new btCollisionDispatcher(coll_config);
overlap_paircache=new btDbvtBroadphase();
solver=new btSequentialImpulseConstraintSolver;
world=new btDiscreteDynamicsWorld(coll_dispatch,overlap_paircache,solver,coll_config);


pretty simple, from the basic samples.


And this is weird:

// Create the shape
btCollisionShape* shape=new btBoxShape(btVector3(1,1,1));
btVector3 inertia(0,0,0);
btTransform trans;

btDefaultMotionState* mstate=new btDefaultMotionState(trans);
btRigidBody::btRigidBodyConstructionInfo ci(5,mstate,shape,inertia);
btRigidBody* body=new btRigidBody(ci);

// And remove!
btCollisionObject* obj=world->getCollisionObjectArray()[0];
delete body->getCollisionShape();
delete body->getMotionState();
delete body;
delete obj;

The remove method is also from some basic sample.

But in this case the removeCollisionObject() references some uninitialized broadphase proxy pointer.


in btDbvtBroadphase::destroyProxy

The same happens with SimpleBroadphaseProxy.


the strange thing is, the whole thing works after the simulation is running for some time.



Did anybody have anything similar???


Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!