irrBullet 0.1.8 - Bullet physics wrapper

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
cobra
Posts: 371
Joined: Fri Jan 23, 2009 2:56 am
Location: United States
Contact:

Post by cobra »

Sorry about the extra post, but I wanted all irrBullet users to know that I forgot to tell everybody that I've figured out why simulation was so slow before. (I fixed this a few months ago).

It was the convex-convex multi-point iteration, which I created the irrBullet world with.

I removed this and it's much faster.


I might make a struct for creation of the irrBullet world so that the developer has more control over the simulation techniques.

Also, I've been working on irrBullet AngelScript bindings for my own game. Once I clean them up, I'll be including them with the irrBullet library. With these I will be including the Irrlicht bindings found in irrExt (if I remember correctly) since the bindings rely on this for the irrlicht data types.
Josiah Hartzell
Image
silver.slade
Posts: 17
Joined: Fri Jan 29, 2010 8:54 am
Contact:

irrBullet + load .irr scene in action

Post by silver.slade »

Thanks for your wrapper: it's simple and clean.
Nice work.

Here you can find a little video of my experiment about irrBullet and Irrlicht.

The example code, loads an .irr scene, creates a collision management and uses irrBullet to manage the collisions with the cubes.

So, go on with it !!!

:D
silver.slade
cobra
Posts: 371
Joined: Fri Jan 23, 2009 2:56 am
Location: United States
Contact:

Post by cobra »

Hi silver.slade.

Thanks for your support, and thanks very much for the video! It's cool to see others using it.

Perhaps I could include this in the irrBullet examples? People have been asking how to use it with the .irr format, and I've not had the time to do this.

I'll be working more on it soon, and there should be lots more cool stuff coming up! Keep checking in.

Thanks.


Also: I've decided not to create an interface for constraints in irrBullet. I've already done them in my own game, and it's not difficult at all to get them working (especially using the helper functions that I include with irrBullet)! I will, however, include a constraints example.

- Josiah
Josiah Hartzell
Image
zeph
Posts: 2
Joined: Thu Jul 08, 2010 12:12 pm

Post by zeph »

Hello cobra,

I can't compile irrBullet 0.1.6 with the latest Codeblock 10.05 because of these errors:
..\..\include\collisionshape.h|76|error: extra qualification 'ICollisionShape::' on member 'getMargin'|
..\..\include\collisionobject.h|41|error: extra qualification 'SCollisionObjectIdentification::' on member 'SCollisionObjectIdentification'|
..\..\include\rigidbody.h|196|error: extra qualification 'IRigidBody::' on member 'isInWorld'|

I think the new CB now use newer g++ version and treat it as error.
http://womble.decadent.org.uk/c++/syntax-errors.html
d3jake
Posts: 198
Joined: Sat Mar 22, 2008 7:49 pm
Location: United States of America

Post by d3jake »

I had the same problem when compiling this. I don't know if you've resolved the problem or not, but all you have to do is delete the specified bit of bit that is listed in the error. The extra qualification would happen like this:

Code: Select all

class Classical
{
     public:
        Classical();
        void Classical::otherFunction();
};
The Open Descent Foundation is always looking for programmers! http://www.odf-online.org
"I'll find out if what I deleted was vital here shortly..." -d3jake
Kordman916
Posts: 23
Joined: Sat Apr 03, 2010 3:44 am

Post by Kordman916 »

Cobra

I think this wrapper is very nice but I only have 1 question.

Does it have a character controller? If not, can you tell me of a physics engine that works with Irrlicht that has one?
cobra
Posts: 371
Joined: Fri Jan 23, 2009 2:56 am
Location: United States
Contact:

Post by cobra »

Thanks for the feedback. :)

It does not yet have a character controller.
You can use all of irrBullet's features and still use the Bullet character controller, however.

irrBullet exposes all underlaying Bullet pointers and provides helper functions to make it even easier to use unimplemented features.

I'm not sure what other physics wrappers have the character controllers.
Josiah Hartzell
Image
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Post by serengeor »

In hello world sample i pressed "R" about ~50 times and memory leaked up to 25,000K~
Working on game: Marrbles (Currently stopped).
cobra
Posts: 371
Joined: Fri Jan 23, 2009 2:56 am
Location: United States
Contact:

Post by cobra »

Thanks for the report! I'll check this out.

Here is the code supposedly causing a memory leak:

Code: Select all

if(event.KeyInput.Key == KEY_KEY_R && event.KeyInput.PressedDown == false)
            {
                // The removal feature is still pretty rough. If you'd like to help, please feel
                // free to submit some patches.
                // This function is basically just here as a place holder to test
                // upcoming removal fixes.
                for(u32 i=0; i < (world->getPointer()->getNumCollisionObjects() - 1); i++)
                {
                    ICollisionObject *obj = 0;
                    obj = world->getCollisionObject(i);
                    if(obj != 0 && obj->getObjectType() == ECOT_RIGID_BODY)
                    {
                        printf("RIGID BODY: %i\n", i);

                        world->removeCollisionObject(obj);
                    }
                }
                createGround();
                createBoxes();
                return true;
            }
I'll have to look through it more when I have time, unless you can find it.
You're positive that it's a leak?
Josiah Hartzell
Image
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Post by serengeor »

Yes I'm pretty sure thats the leak you have to delete motion states and collision Shapes (I'm assuming that they are ?dynamically'? allocated with new)
So you should use get methods to get and delete them.
Working on game: Marrbles (Currently stopped).
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Post by serengeor »

Here's a code that I used in my project

Code: Select all

void Physics::ClearObjects() {

	for(irr::core::list<btRigidBody *>::Iterator Iterator = Objects.begin(); Iterator != Objects.end(); ++Iterator) {
		btRigidBody *Object = *Iterator;

		// Delete irrlicht node
		irr::scene::IMeshSceneNode *Node = static_cast<irr::scene::IMeshSceneNode *>(Object->getUserPointer());
		Node->remove();

		// Remove the object from the world
		World->removeRigidBody(Object);

		// Free memory
		delete Object->getMotionState();
		delete Object->getCollisionShape();
		delete Object;
		Object = 0;
		std::cout<<"Node removed"<<std::endl;
	}
	delete CPhysicsObjectMgr::instance()->trimesh;
	Objects.clear();
}
Working on game: Marrbles (Currently stopped).
cobra
Posts: 371
Joined: Fri Jan 23, 2009 2:56 am
Location: United States
Contact:

Post by cobra »

That couldn't be it. My wrapper does this internally; you can check.
Josiah Hartzell
Image
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Post by serengeor »

I see now, well you must have forgot something really small :?
You could try to use Visual leak detector tough I couldn't get it to work for me like it should.
Working on game: Marrbles (Currently stopped).
Mani2010
Posts: 107
Joined: Sat Jan 16, 2010 4:35 pm
Location: London,UK
Contact:

Crash/Assert in irrBullet

Post by Mani2010 »

I get an assert in the following function that then stops the program i.e. cannot continue.

Code: Select all

void	btTriangleMeshShape::calculateLocalInertia(btScalar mass,btVector3& inertia) const
{
	(void)mass;
	//moving concave objects not supported
	btAssert(0);
	inertia.setValue(btScalar(0.),btScalar(0.),btScalar(0.));
}

...this is the line that causes it, this is straight from the comments example of how to setup an example so it should work...any help would be welcomed.

ICollisionShape *shape = new IBvhTriangleMeshShape(Node, g_pApp->GetSceneManager()->getMesh("terrainMain.b3d"), 0.0);
cobra
Posts: 371
Joined: Fri Jan 23, 2009 2:56 am
Location: United States
Contact:

Post by cobra »

What operating system and compiler are you using?
Josiah Hartzell
Image
Post Reply