irrBullet 0.1.8 - Bullet physics wrapper

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
Post Reply
ent1ty
Competition winner
Posts: 1106
Joined: Sun Nov 08, 2009 11:09 am

Post by ent1ty »

You didn't link libs in the right order, did you.
irrRenderer 1.0
Height2Normal v. 2.1 - convert height maps to normal maps

Step back! I have a void pointer, and I'm not afraid to use it!
Virion
Competition winner
Posts: 2148
Joined: Mon Dec 18, 2006 5:04 am

Post by Virion »

ent1ty wrote:You didn't link libs in the right order, did you.
alright solved. thanks.
cobra
Posts: 371
Joined: Fri Jan 23, 2009 2:56 am
Location: United States
Contact:

Post by cobra »

ent1ty wrote:cobra: thanks for the responses.

However, i am now facing a greater problem. If i e.g. push a barrel, and it falls on ground(it's laing on the floor), after some time it gets back into standing position. It appears as if the most of the weight is concentrated in the bottom of the barrel. For example golf carts in GTA: Vice City did this. When you crashed with them and the car landed on it's back, it would get on it's wheels after some time, because the roof of the cart was very light compared to chassis. Hope you understand what i mean. I have no idea what could the problem be.

It sounds to me like your mesh's center of gravity is at the bottom of it. In a mesh editor, move it to the center of the barrel. You'll have to re-position the barrels in the scene so they don't stick in the ground, assuming you placed them on it.


Also, I've been working a lot on softbodies, and irrBullet now has a nice softbody demo for the next release including ropes, clothes pinned and let go, softbody spheres, and aerodynamic clothes. It looks extremely nice.

Keep waiting for the next release!
Josiah Hartzell
Image
Virion
Competition winner
Posts: 2148
Joined: Mon Dec 18, 2006 5:04 am

Post by Virion »

is it possible to set the center of mass with code?
cobra
Posts: 371
Joined: Fri Jan 23, 2009 2:56 am
Location: United States
Contact:

Post by cobra »

Virion:
It is, but I forgot the function to do it. It is best if the center of gravity is changed in the mesh directly, though.



Anyway, updates on irrBullet 0.1.7 softbodies:


Get ready to add realism and interaction to your games as never before seen in the Irrlicht community!

Hundreds of softbodies, all simulated efficiently in real time.

Image
Image
Image
Image
Image


All previews:
http://www.skyreignsoftware.net16.net/I ... tBody1.png
http://www.skyreignsoftware.net16.net/I ... tBody2.png
http://www.skyreignsoftware.net16.net/I ... tBody3.png
http://www.skyreignsoftware.net16.net/I ... yAero1.png
http://www.skyreignsoftware.net16.net/I ... yAero2.png
http://www.skyreignsoftware.net16.net/I ... yAero3.png
http://www.skyreignsoftware.net16.net/I ... yAero4.png
http://www.skyreignsoftware.net16.net/I ... yAero5.png


Thanks for looking. Keep checking in for updates.
Josiah Hartzell
Image
ent1ty
Competition winner
Posts: 1106
Joined: Sun Nov 08, 2009 11:09 am

Post by ent1ty »

cobra wrote:It sounds to me like your mesh's center of gravity is at the bottom of it. In a mesh editor, move it to the center of the barrel. You'll have to re-position the barrels in the scene so they don't stick in the ground, assuming you placed them on it.
I thought it would be automatically taken from the center of the aabb?
All right, it's just 2 models that are making trouble, so i will fix them in mesh editor.
irrRenderer 1.0
Height2Normal v. 2.1 - convert height maps to normal maps

Step back! I have a void pointer, and I'm not afraid to use it!
Virion
Competition winner
Posts: 2148
Joined: Mon Dec 18, 2006 5:04 am

Post by Virion »

new demo looks cool. would love to watch it in motion though. :D excellent.
cobra
Posts: 371
Joined: Fri Jan 23, 2009 2:56 am
Location: United States
Contact:

Post by cobra »

Thanks, Virion.

I'll get a video of it when I am satisfied completely.

Also, here's some math about it:

For the top screenshot (16 large clothes, only 10 visible):
(10*10)(16) = 100 vertices for each cloth; 1,600 vertices
(3*3)(89) = 9 vertices for each paper; 738 vertices

2,338 softbody vertices beind simulated, taking anywhere from 2-4 milliseconds per frame to run the simulation and render (plus other mainloop code).
Josiah Hartzell
Image
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Post by serengeor »

Is It still leaking memory, or have you fixed it?
Working on game: Marrbles (Currently stopped).
cobra
Posts: 371
Joined: Fri Jan 23, 2009 2:56 am
Location: United States
Contact:

Post by cobra »

Serengoer:

There were never any memory leaks in irrBullet itself (maybe in the first version).

Just that one demo that had old code in it that caused a leak. That's with the demo's old code, not irrBullet's code. I've also removed that old code from the demo. :)


If there were any memory leaks, they'd be so small that only somebody using it for a Model 5150 IBM computer would worry.
Josiah Hartzell
Image
Luben
Posts: 568
Joined: Sun Oct 09, 2005 10:12 am
Location: #irrlicht @freenode

Post by Luben »

cobra wrote: If there were any memory leaks, they'd be so small that only somebody using it for a Model 5150 IBM computer would worry.
Memory leaks are bad bad bad, no matter how small. Everyone should at all times employ zero tolerance policies regarding memory leaks.
cobra
Posts: 371
Joined: Fri Jan 23, 2009 2:56 am
Location: United States
Contact:

Post by cobra »

Yes, of course!

I was just ensuring that any memory leaks that might have existed were minor; not that I disregard memory leaks and allow them. :lol:

Though, I'm quite certain no memory leaks exist in irrBullet.
Josiah Hartzell
Image
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Post by serengeor »

There were never any memory leaks in irrBullet itself (maybe in the first version).

Just that one demo that had old code in it that caused a leak.
Oh Great than! 8)
Working on game: Marrbles (Currently stopped).
ent1ty
Competition winner
Posts: 1106
Joined: Sun Nov 08, 2009 11:09 am

Post by ent1ty »

Uhm... how can i raycast? The docu doesn't say anything about this...
irrRenderer 1.0
Height2Normal v. 2.1 - convert height maps to normal maps

Step back! I have a void pointer, and I'm not afraid to use it!
cobra
Posts: 371
Joined: Fri Jan 23, 2009 2:56 am
Location: United States
Contact:

Post by cobra »

ent1ty:

Right now you'll have to use internal Bullet raycast functions. You can find out how at several resources.

Then, when you get the object that was "hit" by the ray, you can do this:

Code: Select all

ICollisionObject* obj = world->getCollisionObjectByID(static_cast<SCollisionObjectIdentification*>(hitBody->getUserPointer())->ID);
And with the new ICollisionObject, you can begin interacting with it using irrBullet functions.

All Bullet rigid bodies (btRigidBody) created with irrBullet have an SCollisionObjectIdentification pointer stored as the user data.

As shown above, you can retrieve this data and then get the irrBullet pointer with a call to irrBulletWorld::getCollisionObjectByID() or getCollisionObjectByName() and give it SCollisionObjectIdentification::getName(), which returns an irr::core::stringc (irr::core::stringw in irrBullet < 0.1.7).

So, as you can see, using plain Bullet classes in cooperation with irrBullet is very easy with the irrBullet interface!

In irrBullet 0.1.7, soft bodies will also have this identification information, and there will be a raycast interface, so you can avoid this technique.

I am going to greatly improve and expand irrBullet documentation for 0.1.7.

There's just a lot to do for many things of mine, so it might take a while to get 0.1.7 ready for a release, since it's going to be a big release.

Thanks.

- Josiah
Josiah Hartzell
Image
Post Reply