Page 30 of 31

Re: irrBullet 0.1.8 - Bullet physics wrapper

Posted: Fri Jun 07, 2013 3:40 pm
by Lithumist
Hey,

I've been trying to get irrBullet working in my project but my program keeps crashing whever I try to create the bullet world. I'm not if the cause is just my bad code, or not linking to irrBullet correctly or something completely different.

Here's the code that crashes:

Code: Select all

 
irrBulletWorld* b = createIrrBulletWorld(engine->getDevice(), false, debug_draw);
 
It crashes and complains about trying to access a null pointer:
Access violation reading location 0xffffffff.
I'm pretty sure that engine->getDevice() works because I use it in lots of other parts of my code with no errors, and i'm quite sure that engine points to something valid.

I tried using the debugger and it pointed to this line in bulletworld.cpp when the program crashes:

Code: Select all

 
printf("irrBullet %i.%i.%i\n", IRRBULLET_VER_MAJOR, IRRBULLET_VER_MINOR, IRRBULLET_VER_MICRO);
 
I am using Visual C++ 2010 and linking to the libraries that came with the download. I'm also going to add that i've tried compiling and running in debug and release mode, and I get a number of weird linker warnings when I compile, i have a feeling they have something to do with it: :lol:
(Compiling in Release mode)
Generating code
1> Finished generating code
1>irrBullet.lib(softbody.obj) : warning LNK4049: locally defined symbol ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@ABV01@@Z (public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)) imported
1>irrBullet.lib(softbody.obj) : warning LNK4049: locally defined symbol ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ (public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::~basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(void)) imported
1>irrBullet.lib(softbody.obj) : warning LNK4049: locally defined symbol ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@PBD@Z (public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(char const *)) imported
1>irrBullet.lib(bulletworld.obj) : warning LNK4099: PDB 'vc90.pdb' was not found with 'irrBullet.lib(bulletworld.obj)' or at 'C:\Users\Pedro\Documents\Visual Studio 2010\Projects\ExploreGame\Release\vc90.pdb'; linking object as if no debug info
1>irrBullet.lib(collisioncallbackinformation.obj) : warning LNK4099: PDB 'vc90.pdb' was not found with 'irrBullet.lib(collisioncallbackinformation.obj)' or at 'C:\Users\Pedro\Documents\Visual Studio 2010\Projects\ExploreGame\Release\vc90.pdb'; linking object as if no debug info
1>irrBullet.lib(collisionobject.obj) : warning LNK4099: PDB 'vc90.pdb' was not found with 'irrBullet.lib(collisionobject.obj)' or at 'C:\Users\Pedro\Documents\Visual Studio 2010\Projects\ExploreGame\Release\vc90.pdb'; linking object as if no debug info
1>irrBullet.lib(collisionshape.obj) : warning LNK4099: PDB 'vc90.pdb' was not found with 'irrBullet.lib(collisionshape.obj)' or at 'C:\Users\Pedro\Documents\Visual Studio 2010\Projects\ExploreGame\Release\vc90.pdb'; linking object as if no debug info
1>irrBullet.lib(irrbullet.obj) : warning LNK4099: PDB 'vc90.pdb' was not found with 'irrBullet.lib(irrbullet.obj)' or at 'C:\Users\Pedro\Documents\Visual Studio 2010\Projects\ExploreGame\Release\vc90.pdb'; linking object as if no debug info
1>irrBullet.lib(irrbulletcommon.obj) : warning LNK4099: PDB 'vc90.pdb' was not found with 'irrBullet.lib(irrbulletcommon.obj)' or at 'C:\Users\Pedro\Documents\Visual Studio 2010\Projects\ExploreGame\Release\vc90.pdb'; linking object as if no debug info
1>irrBullet.lib(liquidbody.obj) : warning LNK4099: PDB 'vc90.pdb' was not found with 'irrBullet.lib(liquidbody.obj)' or at 'C:\Users\Pedro\Documents\Visual Studio 2010\Projects\ExploreGame\Release\vc90.pdb'; linking object as if no debug info
1>irrBullet.lib(motionstate.obj) : warning LNK4099: PDB 'vc90.pdb' was not found with 'irrBullet.lib(motionstate.obj)' or at 'C:\Users\Pedro\Documents\Visual Studio 2010\Projects\ExploreGame\Release\vc90.pdb'; linking object as if no debug info
1>irrBullet.lib(physicsdebug.obj) : warning LNK4099: PDB 'vc90.pdb' was not found with 'irrBullet.lib(physicsdebug.obj)' or at 'C:\Users\Pedro\Documents\Visual Studio 2010\Projects\ExploreGame\Release\vc90.pdb'; linking object as if no debug info
1>irrBullet.lib(raycastvehicle.obj) : warning LNK4099: PDB 'vc90.pdb' was not found with 'irrBullet.lib(raycastvehicle.obj)' or at 'C:\Users\Pedro\Documents\Visual Studio 2010\Projects\ExploreGame\Release\vc90.pdb'; linking object as if no debug info
1>irrBullet.lib(rigidbody.obj) : warning LNK4099: PDB 'vc90.pdb' was not found with 'irrBullet.lib(rigidbody.obj)' or at 'C:\Users\Pedro\Documents\Visual Studio 2010\Projects\ExploreGame\Release\vc90.pdb'; linking object as if no debug info
1>irrBullet.lib(softbody.obj) : warning LNK4099: PDB 'vc90.pdb' was not found with 'irrBullet.lib(softbody.obj)' or at 'C:\Users\Pedro\Documents\Visual Studio 2010\Projects\ExploreGame\Release\vc90.pdb'; linking object as if no debug info
Thanks for reading, hope someone can help!

Re: irrBullet 0.1.8 - Bullet physics wrapper

Posted: Wed Jul 10, 2013 1:08 pm
by easy163
Hi all, create a terrain with a ITerrainSceneNode* how to use irrbullet give terrain hardness whatever items would fall on him? May from a height map to create a mesh continue to add physics using IBvhTriangleMeshShape*? But how?

Sorry for bad English, I'm from Russia :)

Re: irrBullet 0.1.8 - Bullet physics wrapper

Posted: Thu Jul 11, 2013 11:08 pm
by GameDude
The site and links appear to be down.

Re: irrBullet 0.1.8 - Bullet physics wrapper

Posted: Fri Jul 12, 2013 1:11 am
by Cube_
um... My recommendation is not to use a wrapper, you don't know how the wrapper works and it makes troubleshooting harder.

Bullet is *easy* to integrate, it took me about 10 minutes to get bullet to play nice with Irrlicht

Re: irrBullet 0.1.8 - Bullet physics wrapper

Posted: Tue Oct 22, 2013 6:21 pm
by Christi258
Is irrBullet 0.1.8 compatible with Irrlicht 1.8 or not?

Re: irrBullet 0.1.8 - Bullet physics wrapper

Posted: Tue Oct 29, 2013 8:16 am
by Christi258
Hello?
It's sad.
I would say this is one of the less comments concerning specific Irrbullet.
And no one answers. ;)

Re: irrBullet 0.1.8 - Bullet physics wrapper

Posted: Sun Nov 17, 2013 11:42 am
by serengeor
Christi258 wrote:Hello?
It's sad.
I would say this is one of the less comments concerning specific Irrbullet.
And no one answers. ;)
Well, you can just try it. I'm pretty sure irrlicht hasn't changed that much.

Re: irrBullet 0.1.8 - Bullet physics wrapper

Posted: Tue May 06, 2014 2:52 pm
by jorgerosa
[TUTORIAL] Compiling irrBullet (Creating a "irrBullet.dll")

MS Windows 7: http://en.wikipedia.org/wiki/poop_happens (I´m an happy MS Windows user... or not...)
Code::Blocks 13.12: http://www.codeblocks.org/downloads/26
Irrlicht 1.8.1: http://irrlicht.sourceforge.net/downloads
Bullet 2.82: https://code.google.com/p/bullet/downloads/list
irrBullet 0.1.8: http://sourceforge.net/projects/irrbullet
(I´m always trying to get everything updated!)



1) Create a new project, select Dinamyc Library (DLL), name it as "irrBullet", then remove all the created default files...

2) Add all files recursively, from:

(...)\irrlicht-1.8.1\include (The Irrlicht library!)
(...)\bullet-2.82-r2704\src (The Bullet Physics library!)
(...)\irrBullet-0.1.8\source (The irrBullet (Bullet Physics to Irrlicht Wrapper) library!)

Then...

3) Completly remove from the project: (All these folders and all included files)

(...)\bullet-2.82-r2704\src\BulletMultiThreaded (Not needed!)
(...)\bullet-2.82-r2704\src\MiniCL (Not needed!)
(...)\irrBullet-0.1.8\source\DeprecatedCancelled (Not needed!)

All done! Now let´s compile all this...




4) Errors that will emerge: (Only because irrBullet needs to be updated to "match" the lattest Bullet Physic library´s changes)

:arrow: 1st ERROR: (...)\irrBullet-0.1.8\source\collisioncallbackinformation.cpp:30:113: error: static_cast from type 'const btCollisionObject*' to type 'btCollisionObject*' casts away qualifiers

Code: Select all

// REPLACE THIS:
static_cast<SCollisionObjectIdentification*>(static_cast<btCollisionObject*>(contactManifold->getBody0())->getUserPointer());
 
// BY THIS: (Fix type: Removing Static cast - Result: 100% OK)
static_cast<SCollisionObjectIdentification*>((contactManifold->getBody0())->getUserPointer());
(Save all files (!!)... and compile it again...)


:arrow: 2nd ERROR: (...)\irrBullet-0.1.8\source\collisioncallbackinformation.cpp|30|error: static_cast from type 'const btCollisionObject*' to type 'btCollisionObject*' casts away qualifiers

Code: Select all

// REPLACE THIS: 
static_cast<SCollisionObjectIdentification*>(static_cast<btCollisionObject*>(contactManifold->getBody1())->getUserPointer());
 
// BY THIS: (Fix type: Removing Static cast - Result: 100% OK)
static_cast<SCollisionObjectIdentification*>((contactManifold->getBody1())->getUserPointer());
(Save all files (!!)... and compile it again...)


:arrow: 3rd ERROR: (...)\irrBullet-0.1.8\source\kinematiccharactercontroller.cpp|30|error: no matching function for call to 'btKinematicCharacterController::reset()'

Code: Select all

// REPLACE THIS:
Character->reset();
 
// BY THIS: (Fix type: I´ve disabled it - Result: Needs a correct fix!.. Works by now...)
// Character->reset();
(Save all files (!!)... and compile it again...)


:arrow: 4th ERROR: (...)\irrBullet-0.1.8\source\raycastvehicle.cpp|184|error: invalid conversion from 'const btRigidBody*' to 'btRigidBody*'

Code: Select all

// REPLACE THIS:
btRigidBody* body = btRigidBody::upcast(rayCallback.m_collisionObject);
 
// BY THIS: (Fix type: Adding Constant cast - Result: 100% OK)
btRigidBody* body = const_cast<btRigidBody*>(btRigidBody::upcast(rayCallback.m_collisionObject)); 
(Save all files (!!)... and compile it again...)


:arrow: 5th ERROR: (...)\irrBullet-0.1.8\source\rigidbody.cpp|239|error: 'class btRigidBody' has no member named 'internalApplyImpulse'

Code: Select all

// REPLACE THIS:
void IRigidBody::internalApplyImpulse(const vector3df& linearComponent,
    const vector3df &angularComponent, f32 impulseMagnitude, ERBTransformSpace linTransformSpace, ERBTransformSpace angTransformSpace)
{
    getPointer()->internalApplyImpulse((linTransformSpace==ERBTS_WORLD) ? irrlichtToBulletVector(linearComponent) :
        btVector3(getPointer()->getWorldTransform().getBasis()*irrlichtToBulletVector(linearComponent)),
        (angTransformSpace==ERBTS_WORLD) ? irrlichtToBulletVector(angularComponent) :
        btVector3(getPointer()->getWorldTransform().getBasis()*irrlichtToBulletVector(angularComponent)),
        btScalar(impulseMagnitude));
}
 
// BY THIS: (Fix type: I´ve changed it to the new Bullet class, where only 2 arguments are needed - Result: Needs a correct fix!... Works by now...)
void IRigidBody::internalApplyImpulse(const vector3df& linearComponent,
    const vector3df &angularComponent, f32 impulseMagnitude, ERBTransformSpace linTransformSpace, ERBTransformSpace angTransformSpace)
{
    getPointer()->applyImpulse((linTransformSpace==ERBTS_WORLD) ? irrlichtToBulletVector(linearComponent) :
        btVector3(getPointer()->getWorldTransform().getBasis()*irrlichtToBulletVector(linearComponent)),
        (angTransformSpace==ERBTS_WORLD) ? irrlichtToBulletVector(angularComponent) :
        btVector3(getPointer()->getWorldTransform().getBasis()*irrlichtToBulletVector(angularComponent)));
}
 
(Save all files (!!)... and compile it again...)


All done!
You should have now something like "irrBullet.dll" on your project´s bin folder (depends the name that you gave to this Code::Blocks project, your custom paths, etc, etc, etc)
Close this project.

Now, create your new "irrlicht" project:
Add links to:
(...)\irrlicht-1.8.1\include
(...)\irrBullet-0.1.8\source
Irrlicht.dll (and copy/paste it to where your "game.exe" is generated too, usually in the "bin" folder)
irrBullet.dll (and copy/paste it to where your "game.exe" is generated too, usually in the "bin" folder)

This "tutorial" was made as a starting point for lost souls, but since the author itself is an lost soul, edits, suggestions, ideas and irrBullet updates would be GREAT HELP!
I kept it as basic and as simple as I could, so we all could follow... Thanks! :roll:

Re: irrBullet 0.1.8 - Bullet physics wrapper

Posted: Wed May 07, 2014 4:41 pm
by thanhle
Great stuff.
I hope soft physics works.

Regards
Thanh

Re: irrBullet 0.1.8 - Bullet physics wrapper

Posted: Fri Jun 06, 2014 3:31 pm
by emadof85
i want to use irrbullet with irrlicht wrapper in c# not in c++
how ?
is there any dll ??
sample code ?

Re: irrBullet 0.1.8 - Bullet physics wrapper

Posted: Thu Jun 12, 2014 2:28 pm
by thanhle
The wrapper tends to be slow.
I get extreem lags when using just only 90 boxes.
All demo still works with 1.8.1.

Re: irrBullet 0.1.8 - Bullet physics wrapper

Posted: Sun Jun 22, 2014 10:14 am
by Keziolio
On linux does not work!

I downloaded irrBullet, opened the codeblock project, fixed some issues to make it working (adding libraries and search directories), it works, it compiles with no errors, and it makes the "libirrBullet.a" file in the linux/Release directory

BUT, it's supposed to create also the bullet libraries (i think), (libbulletdynamics.a, libbulletsoftbody.a liblinearmath.a, libbulletcollision.a ), but it don't!

Why? It doesn't show any errors, how can i compile these libraries?

The makefile does not work.

Re: irrBullet 0.1.8 - Bullet physics wrapper

Posted: Mon Jun 23, 2014 3:08 pm
by thanhle
Sorry I'm using visual studio. I don't have any experience in codeblock.

I hope you follows jorgerosa post to compile irrBullet as he described the method using codeblock.

Goodluck.

Re: irrBullet 0.1.8 - Bullet physics wrapper

Posted: Tue Jul 01, 2014 9:57 am
by Christi258
I get for every include one error. For example from file (...)\bullet-2.82-r2704\src\BulletCollision\BroadphaseCollision\btAxisSweep3.h
#include "LinearMath/btVector3.h"
If I chane it to #include "../../LinearMath/btVector3.h" it works. But i don't want to change every include. What am I doing wrong?

Re: irrBullet 0.1.8 - Bullet physics wrapper

Posted: Mon Jan 05, 2015 10:58 am
by jorgerosa
In case would this could be useful for anyone else... (Im using MSWindows v.7 + Code::Blocks v.13.12)

How I´ve achived irrlicht v.1.8 + bullet v.3 + irrbullet v.0.1.8 to work together:

1) (BULLET DIRECTORY) Copy everything from "bullet3-master\src" to (IRRBULLET DIRECTORY) "irrBullet-0.1.8\source\Bullet"
(Create that "Bullet" directory there, it doesnt exists)

2) In my project i link to:
"..\MYLIBRARIES\irrBullet-0.1.8\source"
"..\MYLIBRARIES\irrBullet-0.1.8\source\Bullet"
"..\MYLIBRARIES\irrBullet-0.1.8\lib"
(Note that I dont need to link to BULLET lib itself at any time, I only need to link to IRRBULLET)

3) When compiling if it display errors caused by "GetTickCount64()", rename them in that BULLET files to "GetTickCount()", and save them.
4) When compiling if it display errors caused by "Bullet3OpenCL" content files, just remove that directory. (Located at "irrBullet-0.1.8\source\Bullet\Bullet3OpenCL")
5) When compiling if if display errors from IRRBULLET files, do as in my previous post.

After all this, your app should compile fine and become alive!
(Of course some physics stuff may be broken, bust most probably you will never needed that too)
(Better solutions would be welcome, anyways this one is how I´ve done it... And its working!... By now...)