irrBullet 0.1.8 - Bullet physics wrapper

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki

Re: irrBullet 0.1.8 - Bullet physics wrapper

Postby Lithumist » Fri Jun 07, 2013 3:40 pm

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:
cpp 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:
cpp 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!
Lithumist
 
Posts: 4
Joined: Fri Aug 28, 2009 2:38 pm

Re: irrBullet 0.1.8 - Bullet physics wrapper

Postby easy163 » Wed Jul 10, 2013 1:08 pm

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 :)
easy163
 
Posts: 24
Joined: Wed Jul 10, 2013 12:50 pm

Re: irrBullet 0.1.8 - Bullet physics wrapper

Postby GameDude » Thu Jul 11, 2013 11:08 pm

The site and links appear to be down.
GameDude
 
Posts: 488
Joined: Thu May 24, 2007 12:24 am

Re: irrBullet 0.1.8 - Bullet physics wrapper

Postby Cube_ » Fri Jul 12, 2013 1:11 am

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
"this is not the bottleneck you are looking for"
User avatar
Cube_
 
Posts: 1011
Joined: Mon Oct 24, 2011 10:03 pm
Location: 0x45 61 72 74 68 2c 20 69 6e 20 74 68 65 20 73 6f 6c 20 73 79 73 74 65 6d

Re: irrBullet 0.1.8 - Bullet physics wrapper

Postby Christi258 » Tue Oct 22, 2013 6:21 pm

Is irrBullet 0.1.8 compatible with Irrlicht 1.8 or not?
Christi258
 
Posts: 62
Joined: Wed Feb 06, 2013 12:11 pm

Re: irrBullet 0.1.8 - Bullet physics wrapper

Postby Christi258 » Tue Oct 29, 2013 8:16 am

Hello?
It's sad.
I would say this is one of the less comments concerning specific Irrbullet.
And no one answers. ;)
Christi258
 
Posts: 62
Joined: Wed Feb 06, 2013 12:11 pm

Re: irrBullet 0.1.8 - Bullet physics wrapper

Postby serengeor » Sun Nov 17, 2013 11:42 am

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.
Working on game: Marrbles (Currently stopped).
User avatar
serengeor
 
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Re: irrBullet 0.1.8 - Bullet physics wrapper

Postby jorgerosa » Tue May 06, 2014 2:52 pm

[TUTORIAL] Compiling irrBullet (Creating a "irrBullet.dll")

MS Windows 7: http://en.wikipedia.org/wiki/Shit_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
cpp 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
cpp 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()'
cpp 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*'
cpp 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'
cpp 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:
Last edited by jorgerosa on Wed May 07, 2014 11:47 pm, edited 2 times in total.
User avatar
jorgerosa
Competition winner
 
Posts: 104
Joined: Wed Jun 30, 2010 8:44 am
Location: Portugal

Re: irrBullet 0.1.8 - Bullet physics wrapper

Postby thanhle » Wed May 07, 2014 4:41 pm

Great stuff.
I hope soft physics works.

Regards
Thanh
thanhle
 
Posts: 324
Joined: Wed Jun 12, 2013 8:09 am

Re: irrBullet 0.1.8 - Bullet physics wrapper

Postby emadof85 » Fri Jun 06, 2014 3:31 pm

i want to use irrbullet with irrlicht wrapper in c# not in c++
how ?
is there any dll ??
sample code ?
emadof85
 
Posts: 31
Joined: Sun May 25, 2014 6:10 pm

Re: irrBullet 0.1.8 - Bullet physics wrapper

Postby thanhle » Thu Jun 12, 2014 2:28 pm

The wrapper tends to be slow.
I get extreem lags when using just only 90 boxes.
All demo still works with 1.8.1.
thanhle
 
Posts: 324
Joined: Wed Jun 12, 2013 8:09 am

Re: irrBullet 0.1.8 - Bullet physics wrapper

Postby Keziolio » Sun Jun 22, 2014 10:14 am

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.
User avatar
Keziolio
 
Posts: 9
Joined: Sat Aug 10, 2013 12:09 pm

Re: irrBullet 0.1.8 - Bullet physics wrapper

Postby thanhle » Mon Jun 23, 2014 3:08 pm

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.
thanhle
 
Posts: 324
Joined: Wed Jun 12, 2013 8:09 am

Re: irrBullet 0.1.8 - Bullet physics wrapper

Postby Christi258 » Tue Jul 01, 2014 9:57 am

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?
Christi258
 
Posts: 62
Joined: Wed Feb 06, 2013 12:11 pm

Re: irrBullet 0.1.8 - Bullet physics wrapper

Postby jorgerosa » Mon Jan 05, 2015 10:58 am

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...)
User avatar
jorgerosa
Competition winner
 
Posts: 104
Joined: Wed Jun 30, 2010 8:44 am
Location: Portugal

PreviousNext

Return to Project Announcements

Who is online

Users browsing this forum: No registered users and 1 guest

cron