Page 3 of 31

Posted: Thu Jul 01, 2010 1:19 am
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.

irrBullet + load .irr scene in action

Posted: Thu Jul 01, 2010 12:03 pm
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

Posted: Thu Jul 01, 2010 5:58 pm
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

Posted: Sat Jul 10, 2010 4:43 am
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

Posted: Sun Jul 11, 2010 12:13 am
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();
};

Posted: Tue Jul 13, 2010 1:39 pm
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?

Posted: Wed Jul 14, 2010 3:25 am
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.

Posted: Wed Jul 21, 2010 2:58 pm
by serengeor
In hello world sample i pressed "R" about ~50 times and memory leaked up to 25,000K~

Posted: Wed Jul 28, 2010 5:43 pm
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?

Posted: Wed Jul 28, 2010 6:18 pm
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.

Posted: Fri Jul 30, 2010 7:38 am
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();
}

Posted: Fri Jul 30, 2010 11:11 pm
by cobra
That couldn't be it. My wrapper does this internally; you can check.

Posted: Sat Jul 31, 2010 8:13 am
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.

Crash/Assert in irrBullet

Posted: Mon Aug 02, 2010 3:57 pm
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);

Posted: Fri Aug 06, 2010 10:11 pm
by cobra
What operating system and compiler are you using?