irrBullet 0.1.8 - Bullet physics wrapper

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
Kamac
Posts: 6
Joined: Sat Jan 14, 2012 8:54 pm

Re: irrBullet 0.1.71 - Bullet physics wrapper

Post by Kamac »

Damn me,

Code: Select all

 
1>irrBullet.lib(bulletworld.obj) : error LNK2001: unresolved external symbol "public: static void __cdecl btGImpactCollisionAlgorithm::registerAlgorithm(class btCollisionDispatcher *)" (?registerAlgorithm@btGImpactCollisionAlgorithm@@SAXPAVbtCollisionDispatcher@@@Z)
1>irrBullet.lib(bulletworld.obj) : error LNK2001: unresolved external symbol "public: __thiscall btDbvtBroadphase::btDbvtBroadphase(class btOverlappingPairCache *)" (??0btDbvtBroadphase@@QAE@PAVbtOverlappingPairCache@@@Z)
1>irrBullet.lib(bulletworld.obj) : error LNK2001: unresolved external symbol "public: void __thiscall btDiscreteDynamicsWorld::synchronizeSingleMotionState(class btRigidBody *)" (?synchronizeSingleMotionState@btDiscreteDynamicsWorld@@QAEXPAVbtRigidBody@@@Z)
1>irrBullet.lib(bulletworld.obj) : error LNK2001: unresolved external symbol "public: __thiscall btCollisionDispatcher::btCollisionDispatcher(class btCollisionConfiguration *)" (??0btCollisionDispatcher@@QAE@PAVbtCollisionConfiguration@@@Z)
1>irrBullet.lib(bulletworld.obj) : error LNK2001: unresolved external symbol "void * __cdecl btAlignedAllocInternal(unsigned int,int)" (?btAlignedAllocInternal@@YAPAXIH@Z)
1>irrBullet.lib(bulletworld.obj) : error LNK2001: unresolved external symbol "public: void __thiscall btSoftRigidDynamicsWorld::removeSoftBody(class btSoftBody *)" (?removeSoftBody@btSoftRigidDynamicsWorld@@QAEXPAVbtSoftBody@@@Z)
1>irrBullet.lib(bulletworld.obj) : error LNK2001: unresolved external symbol "public: void __thiscall btSoftRigidDynamicsWorld::addSoftBody(class btSoftBody *,short,short)" (?addSoftBody@btSoftRigidDynamicsWorld@@QAEXPAVbtSoftBody@@FF@Z)
1>irrBullet.lib(bulletworld.obj) : error LNK2001: unresolved external symbol "public: __thiscall btSoftRigidDynamicsWorld::btSoftRigidDynamicsWorld(class btDispatcher *,class btBroadphaseInterface *,class btConstraintSolver *,class btCollisionConfiguration *,class btSoftBodySolver *)" (??0btSoftRigidDynamicsWorld@@QAE@PAVbtDispatcher@@PAVbtBroadphaseInterface@@PAVbtConstraintSolver@@PAVbtCollisionConfiguration@@PAVbtSoftBodySolver@@@Z)
1>irrBullet.lib(bulletworld.obj) : error LNK2001: unresolved external symbol "public: __thiscall btSoftBodyRigidBodyCollisionConfiguration::btSoftBodyRigidBodyCollisionConfiguration(struct btDefaultCollisionConstructionInfo const &)" (??0btSoftBodyRigidBodyCollisionConfiguration@@QAE@ABUbtDefaultCollisionConstructionInfo@@@Z)
1>irrBullet.lib(bulletworld.obj) : error LNK2001: unresolved external symbol "public: __thiscall btSequentialImpulseConstraintSolver::btSequentialImpulseConstraintSolver(void)" (??0btSequentialImpulseConstraintSolver@@QAE@XZ)
1>irrBullet.lib(bulletworld.obj) : error LNK2001: unresolved external symbol "void __cdecl btAlignedFreeInternal(void *)" (?btAlignedFreeInternal@@YAXPAX@Z)
1>irrBullet.lib(collisionobject.obj) : error LNK2001: unresolved external symbol "public: void __thiscall btSoftBody::transform(class btTransform const &)" (?transform@btSoftBody@@QAEXABVbtTransform@@@Z)
1>irrBullet.lib(collisionobject.obj) : error LNK2001: unresolved external symbol "public: void __thiscall btCollisionObject::activate(bool)" (?activate@btCollisionObject@@QAEX_N@Z)
1>irrBullet.lib(collisionobject.obj) : error LNK2001: unresolved external symbol "public: void __thiscall btCollisionObject::forceActivationState(int)" (?forceActivationState@btCollisionObject@@QAEXH@Z)
1>irrBullet.lib(collisionobject.obj) : error LNK2001: unresolved external symbol "public: void __thiscall btCollisionObject::setActivationState(int)" (?setActivationState@btCollisionObject@@QAEXH@Z)
1>irrBullet.lib(raycastvehicle.obj) : error LNK2001: unresolved external symbol "public: void __thiscall btRaycastVehicle::setBrake(float,int)" (?setBrake@btRaycastVehicle@@QAEXMH@Z)
1>irrBullet.lib(raycastvehicle.obj) : error LNK2001: unresolved external symbol "public: struct btWheelInfo & __thiscall btRaycastVehicle::getWheelInfo(int)" (?getWheelInfo@btRaycastVehicle@@QAEAAUbtWheelInfo@@H@Z)
1>irrBullet.lib(raycastvehicle.obj) : error LNK2001: unresolved external symbol "public: struct btWheelInfo & __thiscall btRaycastVehicle::addWheel(class btVector3 const &,class btVector3 const &,class btVector3 const &,float,float,class btRaycastVehicle::btVehicleTuning const &,bool)" (?addWheel@btRaycastVehicle@@QAEAAUbtWheelInfo@@ABVbtVector3@@00MMABVbtVehicleTuning@1@_N@Z)
1>irrBullet.lib(raycastvehicle.obj) : error LNK2001: unresolved external symbol "public: void __thiscall btRaycastVehicle::updateWheelTransform(int,bool)" (?updateWheelTransform@btRaycastVehicle@@QAEXH_N@Z)
1>irrBullet.lib(raycastvehicle.obj) : error LNK2001: unresolved external symbol "public: void __thiscall btRaycastVehicle::applyEngineForce(float,int)" (?applyEngineForce@btRaycastVehicle@@QAEXMH@Z)
1>irrBullet.lib(raycastvehicle.obj) : error LNK2001: unresolved external symbol "public: void __thiscall btRaycastVehicle::setSteeringValue(float,int)" (?setSteeringValue@btRaycastVehicle@@QAEXMH@Z)
1>irrBullet.lib(raycastvehicle.obj) : error LNK2001: unresolved external symbol "public: void __thiscall btRaycastVehicle::resetSuspension(void)" (?resetSuspension@btRaycastVehicle@@QAEXXZ)
1>irrBullet.lib(raycastvehicle.obj) : error LNK2001: unresolved external symbol "public: __thiscall btRaycastVehicle::btRaycastVehicle(class btRaycastVehicle::btVehicleTuning const &,class btRigidBody *,struct btVehicleRaycaster *)" (??0btRaycastVehicle@@QAE@ABVbtVehicleTuning@0@PAVbtRigidBody@@PAUbtVehicleRaycaster@@@Z)
1>irrBullet.lib(softbody.obj) : error LNK2001: unresolved external symbol "public: void __thiscall btSoftBody::randomizeConstraints(void)" (?randomizeConstraints@btSoftBody@@QAEXXZ)
1>irrBullet.lib(softbody.obj) : error LNK2001: unresolved external symbol "public: int __thiscall btSoftBody::generateBendingConstraints(int,struct btSoftBody::Material *)" (?generateBendingConstraints@btSoftBody@@QAEHHPAUMaterial@1@@Z)
1>irrBullet.lib(softbody.obj) : error LNK2001: unresolved external symbol "public: void __thiscall btSoftBody::setPose(bool,bool)" (?setPose@btSoftBody@@QAEX_N0@Z)
1>irrBullet.lib(softbody.obj) : error LNK2001: unresolved external symbol "public: void __thiscall btSoftBody::scale(class btVector3 const &)" (?scale@btSoftBody@@QAEXABVbtVector3@@@Z)
1>irrBullet.lib(softbody.obj) : error LNK2001: unresolved external symbol "public: void __thiscall btSoftBody::setVolumeDensity(float)" (?setVolumeDensity@btSoftBody@@QAEXM@Z)
1>irrBullet.lib(softbody.obj) : error LNK2001: unresolved external symbol "public: void __thiscall btSoftBody::setVolumeMass(float)" (?setVolumeMass@btSoftBody@@QAEXM@Z)
1>irrBullet.lib(softbody.obj) : error LNK2001: unresolved external symbol "public: void __thiscall btSoftBody::setTotalDensity(float)" (?setTotalDensity@btSoftBody@@QAEXM@Z)
1>irrBullet.lib(softbody.obj) : error LNK2001: unresolved external symbol "public: void __thiscall btSoftBody::setTotalMass(float,bool)" (?setTotalMass@btSoftBody@@QAEXM_N@Z)
1>irrBullet.lib(softbody.obj) : error LNK2001: unresolved external symbol "public: void __thiscall btSoftBody::setVelocity(class btVector3 const &)" (?setVelocity@btSoftBody@@QAEXABVbtVector3@@@Z)
1>irrBullet.lib(softbody.obj) : error LNK2001: unresolved external symbol "public: void __thiscall btSoftBody::addVelocity(class btVector3 const &)" (?addVelocity@btSoftBody@@QAEXABVbtVector3@@@Z)
1>irrBullet.lib(softbody.obj) : error LNK2001: unresolved external symbol "public: void __thiscall btSoftBody::addForce(class btVector3 const &)" (?addForce@btSoftBody@@QAEXABVbtVector3@@@Z)
1>irrBullet.lib(softbody.obj) : error LNK2001: unresolved external symbol "public: void __thiscall btSoftBody::addForce(class btVector3 const &,int)" (?addForce@btSoftBody@@QAEXABVbtVector3@@H@Z)
1>irrBullet.lib(softbody.obj) : error LNK2001: unresolved external symbol "public: void __thiscall btSoftBody::appendAnchor(int,class btRigidBody *,bool)" (?appendAnchor@btSoftBody@@QAEXHPAVbtRigidBody@@_N@Z)
1>irrBullet.lib(softbody.obj) : error LNK2001: unresolved external symbol "public: bool __thiscall btSoftBody::checkLink(int,int)const " (?checkLink@btSoftBody@@QBE_NHH@Z)
1>irrBullet.lib(softbody.obj) : error LNK2001: unresolved external symbol "public: static class btSoftBody * __cdecl btSoftBodyHelpers::CreateFromTriMesh(struct btSoftBodyWorldInfo &,float const *,int const *,int,bool)" (?CreateFromTriMesh@btSoftBodyHelpers@@SAPAVbtSoftBody@@AAUbtSoftBodyWorldInfo@@PBMPBHH_N@Z)
1>irrBullet.lib(rigidbody.obj) : error LNK2001: unresolved external symbol "bool gDisableDeactivation" (?gDisableDeactivation@@3_NA)
1>irrBullet.lib(rigidbody.obj) : error LNK2001: unresolved external symbol "float gDeactivationTime" (?gDeactivationTime@@3MA)
1>irrBullet.lib(rigidbody.obj) : error LNK2001: unresolved external symbol "public: void __thiscall btRigidBody::getAabb(class btVector3 &,class btVector3 &)const " (?getAabb@btRigidBody@@QBEXAAVbtVector3@@0@Z)
1>irrBullet.lib(rigidbody.obj) : error LNK2001: unresolved external symbol "public: void __thiscall btRigidBody::updateInertiaTensor(void)" (?updateInertiaTensor@btRigidBody@@QAEXXZ)
1>irrBullet.lib(rigidbody.obj) : error LNK2001: unresolved external symbol "public: void __thiscall btRigidBody::integrateVelocities(float)" (?integrateVelocities@btRigidBody@@QAEXM@Z)
1>irrBullet.lib(rigidbody.obj) : error LNK2001: unresolved external symbol "public: void __thiscall btRigidBody::setMassProps(float,class btVector3 const &)" (?setMassProps@btRigidBody@@QAEXMABVbtVector3@@@Z)
1>irrBullet.lib(rigidbody.obj) : error LNK2001: unresolved external symbol "public: void __thiscall btRigidBody::applyDamping(float)" (?applyDamping@btRigidBody@@QAEXM@Z)
1>irrBullet.lib(rigidbody.obj) : error LNK2001: unresolved external symbol "public: void __thiscall btRigidBody::setDamping(float,float)" (?setDamping@btRigidBody@@QAEXMM@Z)
1>irrBullet.lib(rigidbody.obj) : error LNK2001: unresolved external symbol "public: void __thiscall btRigidBody::setGravity(class btVector3 const &)" (?setGravity@btRigidBody@@QAEXABVbtVector3@@@Z)
1>irrBullet.lib(rigidbody.obj) : error LNK2001: unresolved external symbol "public: void __thiscall btRigidBody::applyGravity(void)" (?applyGravity@btRigidBody@@QAEXXZ)
1>irrBullet.lib(rigidbody.obj) : error LNK2001: unresolved external symbol "public: void __thiscall btRigidBody::saveKinematicState(float)" (?saveKinematicState@btRigidBody@@QAEXM@Z)
1>irrBullet.lib(rigidbody.obj) : error LNK2001: unresolved external symbol "public: __thiscall btRigidBody::btRigidBody(float,class btMotionState *,class btCollisionShape *,class btVector3 const &)" (??0btRigidBody@@QAE@MPAVbtMotionState@@PAVbtCollisionShape@@ABVbtVector3@@@Z)
I am using MSVC 2010. No idea what to do.


@EDIT

Yay, it works!
I had to link all the other .libs which were for 2008, but they did work with 2010 atleast.

Through, i have a question: How ( if possible ) make a collision shape for a terrain?
Kamac
Posts: 6
Joined: Sat Jan 14, 2012 8:54 pm

Re: irrBullet 0.1.71 - Bullet physics wrapper

Post by Kamac »

Nevermind, it works!

Thanks RdR!
Granyte
Posts: 850
Joined: Tue Jan 25, 2011 11:07 pm
Contact:

Re: irrBullet 0.1.71 - Bullet physics wrapper

Post by Granyte »

polylux wrote:I don't think it's a good idea to update the physical representation of an object every time the visual one changes (can get computationally expensive). You apparently want to implement some sort of backface culling there. Have a look at the btBvhTriangleMeshShape class, it comes with a lot of optimizations. BulletPhysics recommends to pack many meshes into it to fully use these optimizations [recalling from the wiki].
the physic mesh is not updated every time i change the mesh only when it makes sens beside my planetary lod algorythm adrealy include horion culling and several other optimisation how ever back face culling makes no sens in this context as it would allow the player to fall through the world if the lod is not updated on time for him to be stoped by it in my aplication the lod is updated asycronously from the render and physic so that the lod never jam rendering or physic

the issue is that when ever i hit over 7k poly bullet physic lagg to hell irrlicht handeled over more then 34 000 poly without any issue
on my system the whole program run arround 150-350 fps untill i update the bullet triangle mesh with say 8001 poly then goodbye 1-2 fps here i come and as such the bullet physic version of the mesh cannot be updated anymore as it use 100% of the processing time and my lod system can't find the proper window to update it


in anyways this is still only a verry minor issue compared to the imposed memory leak as you can see in the linked documentation btBvhTriangleMeshShape::~btBvhTriangleMeshShape () [virtual] is declared as virtual and so is every destructor of every btcollisionShape as well as the bttrianglemesh even the btrigidbody destructor is a virtual funtion so when you rebuild the mesh you can't delete the old version this is the main issue i'm facing

Code: Select all

 
delete Object->getMotionState();
delete Object->getCollisionShape();
delete Object;


calling these cause a pure virtual function call issue

even this code as taken from the basic demo sample cause pure virtual call issue and crash

Code: Select all

void    BasicDemo::exitPhysics()
{
 
        //cleanup in the reverse order of creation/initialization
 
        //remove the rigidbodies from the dynamics world and delete them
        int i;
        for (i=m_dynamicsWorld->getNumCollisionObjects()-1; i>=0 ;i--)
        {
                btCollisionObject* obj = m_dynamicsWorld->getCollisionObjectArray()[i];
                btRigidBody* body = btRigidBody::upcast(obj);
                if (body && body->getMotionState())
                {
                        delete body->getMotionState();
                }
                m_dynamicsWorld->removeCollisionObject( obj );
                delete obj;
        }
 
        //delete collision shapes
        for (int j=0;j<m_collisionShapes.size();j++)
        {
                btCollisionShape* shape = m_collisionShapes[j];
                delete shape;
        }
        m_collisionShapes.clear();
 
        delete m_dynamicsWorld;
        
        delete m_solver;
        
        delete m_broadphase;
        
        delete m_dispatcher;
 
        delete m_collisionConfiguration;
 
        
}
so what i'm wondering is how does anyone that has a game where he load a level does to unload the said level in order to load a new one ? you just leave the older rigid body there in a little dusty corner of your aplication and act like if there is no memory leak? cause in mine the issue is X1000 cause there can be hudreeds of objects loaded and unloaded from the game at run time
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Re: irrBullet 0.1.71 - Bullet physics wrapper

Post by serengeor »

You must have missed something that you dynamically alocated. Like btTriangleIndexVertexArray.
Working on game: Marrbles (Currently stopped).
mubashar
Posts: 63
Joined: Wed Sep 07, 2011 7:20 pm

Re: irrBullet 0.1.71 - Bullet physics wrapper

Post by mubashar »

hey every one i don't know why its happening in plaint bullet bounding box updates and transform correctly
Image

why it is not transforming in Irrbullet please help it causes false collisions with other geometry this problem causing me a mess up
Image
When it's all over, it's not who you were. It's whether you made a difference
Granyte
Posts: 850
Joined: Tue Jan 25, 2011 11:07 pm
Contact:

Re: irrBullet 0.1.71 - Bullet physics wrapper

Post by Granyte »

serengeor wrote:You must have missed something that you dynamically alocated. Like btTriangleIndexVertexArray.

the only object that seem some how derived from somethign that has a link to this is
btTriangleMesh()

and i have been asking for a week how do we properly clean these object or delete them with no answer over the buller forum
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Re: irrBullet 0.1.71 - Bullet physics wrapper

Post by serengeor »

how I destroyed/removed my bodies is this:

Code: Select all

void PhysicsManager::destroyBody(btRigidBody * body)
{
    if(body->getCollisionShape())
    {
        if(body->getCollisionShape()->getShapeType() == TRIANGLE_MESH_SHAPE_PROXYTYPE)
        {
            btTriangleMeshShape * shape = (btBvhTriangleMeshShape*)body->getCollisionShape();
            delete shape->getMeshInterface();
        }
        delete body->getCollisionShape();
    }
 
    if(body->getMotionState())
    {
        delete body->getMotionState();
    }
    delete body;
}
Might still be incomplete for some other collision shapes, since I haven't tried much of them. But it didn't leak for me.
Working on game: Marrbles (Currently stopped).
Granyte
Posts: 850
Joined: Tue Jan 25, 2011 11:07 pm
Contact:

Re: irrBullet 0.1.71 - Bullet physics wrapper

Post by Granyte »

thanks that code works i now have a proper way of cleaning my level how ever it still crash if i try to update the collision mesh and i have absolutely no idea why

this is how i currently try to do it

Code: Select all

 
         if(myRigidBody->getCollisionShape())
    {
        if(myRigidBody->getCollisionShape()->getShapeType() == TRIANGLE_MESH_SHAPE_PROXYTYPE)
        {
            btTriangleMeshShape * shape = (btBvhTriangleMeshShape*)myRigidBody->getCollisionShape();
            delete shape->getMeshInterface();
        }
        delete myRigidBody->getCollisionShape();
    }
 
        btTriangleMesh *pTriMesh = new btTriangleMesh();
        BuildMesh(static_cast<CTerrain*>(Node),pTriMesh);
        btCollisionShape* newShape = new btBvhTriangleMeshShape(pTriMesh,true,true);
        myRigidBody->setCollisionShape(newShape);
 


that part of the code still crash with pure virtual function call
this is when i try to update the collision mesh


the issue finally got fixed thanks to every one for thier sugestion here is the fix

Code: Select all

 
Bullet->World->removeRigidBody(myRigidBody);
         if(myRigidBody->getCollisionShape())
    {
        if(myRigidBody->getCollisionShape()->getShapeType() == TRIANGLE_MESH_SHAPE_PROXYTYPE)
        {
            btTriangleMeshShape * shape = (btBvhTriangleMeshShape*)myRigidBody->getCollisionShape();
            delete shape->getMeshInterface();
        }
        delete myRigidBody->getCollisionShape();
    }
 
        btTriangleMesh *pTriMesh = new btTriangleMesh();
        BuildMesh(static_cast<CTerrain*>(Node),pTriMesh);
        btCollisionShape* newShape = new btBvhTriangleMeshShape(pTriMesh,true,true);
        myRigidBody->setCollisionShape(newShape);
        Bullet->World->addRigidBody(myRigidBody);
 
if you plan to update the mesh of a body on the fly you acutaly have to remove it from the world befor and put it back after
this might be a default bullet behaviour or because i'm running bullet in a diferent thread
Last edited by Granyte on Mon Jan 16, 2012 7:05 am, edited 1 time in total.
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Re: irrBullet 0.1.71 - Bullet physics wrapper

Post by serengeor »

which line to be exact?
Working on game: Marrbles (Currently stopped).
Granyte
Posts: 850
Joined: Tue Jan 25, 2011 11:07 pm
Contact:

Re: irrBullet 0.1.71 - Bullet physics wrapper

Post by Granyte »

that was the wierd part about the crash i could not get a specific line because the crash was happening somewhere inside the bullet dll so i had to deal with assembly when i got in debug mode but the command line output of irrlicht was telling me abotu a pure virtual function call ethier way it's now fixed thanks alot for taking the time to help me
polylux
Posts: 267
Joined: Thu Aug 27, 2009 12:39 pm
Location: EU

Re: irrBullet 0.1.71 - Bullet physics wrapper

Post by polylux »

mubashar wrote:hey every one i don't know why its happening in plaint bullet bounding box updates and transform correctly
Image

why it is not transforming in Irrbullet please help it causes false collisions with other geometry this problem causing me a mess up
Image
Seems to be the axis-aligned bounding box?
beer->setMotivationCallback(this);
mubashar
Posts: 63
Joined: Wed Sep 07, 2011 7:20 pm

Re: irrBullet 0.1.71 - Bullet physics wrapper

Post by mubashar »

@polylux yeah Axis Aligned Bounding Box is not transformed correctly with irrbullet i have checked IGImpact and Convex Hull shapes but have same response
When it's all over, it's not who you were. It's whether you made a difference
polylux
Posts: 267
Joined: Thu Aug 27, 2009 12:39 pm
Location: EU

Re: irrBullet 0.1.71 - Bullet physics wrapper

Post by polylux »

Well, if it's the AABB, this looks quite valid to me.
beer->setMotivationCallback(this);
mubashar
Posts: 63
Joined: Wed Sep 07, 2011 7:20 pm

Re: irrBullet 0.1.71 - Bullet physics wrapper

Post by mubashar »

@polylux looks valid to you ? man its not rotating with shape i mean it should rotate as the car rotates when i am running through terrains it causes false collision impacts
When it's all over, it's not who you were. It's whether you made a difference
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Re: irrBullet 0.1.71 - Bullet physics wrapper

Post by serengeor »

mubashar wrote:@polylux looks valid to you ?
Didn't he just say that?
wikipedia wrote:In geometry, an axis-aligned object (axis-parallel, axis-oriented) is an object in n-dimensional space whose shape is aligned with the coordinate axes of the space.
I'm pretty sure bullet does not really do any real collision calculations based on AABB. (is that even bullet's AABB?)
Working on game: Marrbles (Currently stopped).
Post Reply