the allocation of the block is in rigidbody.cpp, line 44:
Code: Select all
motionState = new IMotionState(internalTransform);
Bastian
Code: Select all
motionState = new IMotionState(internalTransform);
Code: Select all
// Inside some header somewhere
ISphereShape *physicsBounds;
IRigidBody *physicsBody;
// Inside actual source file
physicsBounds = new ISphereShape(sceneNode, mass, false); // sceneNode being an Irrlicht scene node
physicsBounds->setUnscaledRadius(boundingCircleRadius);
physicsBody = subsystems->physics->world->addRigidBody(physicsBounds); // world is an irrBulletWorld
physicsBody->getAttributes()->addBool("collide", true);
physicsBody->setAngularFactor(0);
// Fun time! Rest of program is running...
// Time to delete! Now what?
delete physicsBounds; // Works fine
subsystems->physics->world->removeCollisionObject(physicsBody); // Segfaults!
delete physicsBody; // If I remove removeCollisionObject -- segfaults!
Code: Select all
playerShape = new IGImpactMeshShape(playerNode,playerNode->getMesh(), 10);
playerBody = world->addRigidBody(playerShape);
playerBody->setActivationState(EAS_DISABLE_DEACTIVATION);
playerBody->setDamping(.8, .8);
playerBody->setAngularFactor(vector3df(0.0f,1.0f,0.0f));
Hi Rocko,Rocko Bonaparte wrote: I am running leak checks on my code, and finding a slew of stuff with the physics engine...
Code: Select all
void irrBulletWorld::removeCollisionObject(ICollisionObject* const obj, bool deleteObject)
We should now guess what linker errors you have and provide random solutions?Virror wrote:This looks like a very good wrapper : D
But i keep getting linker errors when trying to link with my VS2010 project.
Have included the three folders that should be added, have included the "irrBullet.h" file and added the .lib file to the lib directory. What am i missing?
The header guards should differ for every header, else you might have troubles with them.Virror wrote:Hmm, should not irrBullet and Bullet have the same #ifndef names in the include files? Else they will be included twice?
Edit: By making sure Bullet and irrBullet share the same .h files i have managed to get them both to compile..
Might be because the user wouldn't need to look for that specific version it was built on, because new/old versions get incompatibleVirror wrote:Well, might be. But why cant they just use the same header files? Why do irrBullet need a separate set of the same headers that exists in the bullet catalog?