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.71 - Bullet physics wrapper

Postby Granyte » Tue Jan 17, 2012 7:43 pm

from what i understand bullet use the aabb to filter the more precise collision code and avoid making some per triangle cheq on every shape every time
Granyte
 
Posts: 517
Joined: Tue Jan 25, 2011 11:07 pm

Re: irrBullet 0.1.71 - Bullet physics wrapper

Postby mubashar » Tue Jan 17, 2012 8:20 pm

serengeor wrote:
mubashar wrote:@polylux looks valid to you ?

Didn't he just say that?

wikipedia wrote:In geometry, an axis-aligned object (axis-parallel, axis-oriented) is an object in n-dimensional space whose shape is aligned with the coordinate axes of the space.


I'm pretty sure bullet does not really do any real collision calculations based on AABB. (is that even bullet's AABB?)




http://en.wikipedia.org/wiki/Bounding_volume wrote:In collision detection, when two bounding volumes do not intersect, then the contained objects cannot collide, either.
When it's all over, it's not who you were. It's whether you made a difference
User avatar
mubashar
 
Posts: 63
Joined: Wed Sep 07, 2011 7:20 pm

Re: irrBullet 0.1.71 - Bullet physics wrapper

Postby serengeor » Tue Jan 17, 2012 10:40 pm

mubashar wrote:
serengeor wrote:
mubashar wrote:@polylux looks valid to you ?

Didn't he just say that?

wikipedia wrote:In geometry, an axis-aligned object (axis-parallel, axis-oriented) is an object in n-dimensional space whose shape is aligned with the coordinate axes of the space.


I'm pretty sure bullet does not really do any real collision calculations based on AABB. (is that even bullet's AABB?)




http://en.wikipedia.org/wiki/Bounding_volume wrote:In collision detection, when two bounding volumes do not intersect, then the contained objects cannot collide, either.


That applies to transformed bounding boxes or even up-scaled bounding boxes that can contain the full object. While with AABB the object can sometimes leave it,
Working on game: Marrbles (Currently stopped).
User avatar
serengeor
 
Posts: 1695
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Re: irrBullet 0.1.71 - Bullet physics wrapper

Postby mubashar » Wed Jan 18, 2012 9:41 am

@serengeor can you identify from my post (screenshots) which bounding Box is this ... actually my question is is it possible to transform this when object when scene node transforms... as it is happening in plain bullet demo ... but not in my case using Irrbullet
When it's all over, it's not who you were. It's whether you made a difference
User avatar
mubashar
 
Posts: 63
Joined: Wed Sep 07, 2011 7:20 pm

Re: irrBullet 0.1.71 - Bullet physics wrapper

Postby serengeor » Wed Jan 18, 2012 11:06 am

mubashar wrote:@serengeor can you identify from my post (screenshots) which bounding Box is this ... actually my question is is it possible to transform this when object when scene node transforms... as it is happening in plain bullet demo ... but not in my case using Irrbullet

Scene node?? if you transform scene node instead of bullet body it wont update itself. Unless you're already using irrBullet, in that case it would reset scene node to bullet's body's position. Anyways you shouldn't do that as will make you need to update the body itself to the scene nodes transform. Better transform bullet's bodies and scene nodes will follow them (if you're using irrBullet ofc.).
Working on game: Marrbles (Currently stopped).
User avatar
serengeor
 
Posts: 1695
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Re: irrBullet 0.1.71 - Bullet physics wrapper

Postby polylux » Wed Jan 18, 2012 11:29 am

mubashar wrote:@serengeor can you identify from my post (screenshots) which bounding Box is this ... actually my question is is it possible to transform this when object when scene node transforms... as it is happening in plain bullet demo ... but not in my case using Irrbullet


Wicked. I told you. serengeor told you. The one in the second screenshot is the axis-aligned bounding box. It's the one that encloses your geometry given its bounding axes are parallel to your x, y and z axis in world space. So once the geometry (mesh) is rotated, the AABB will only change in size, not in orientation. The other part of your question is perfectly answered in serengeor's post.
beer->setMotivationCallback(this);
User avatar
polylux
 
Posts: 210
Joined: Thu Aug 27, 2009 12:39 pm
Location: EU, Austria

Re: irrBullet 0.1.71 - Bullet physics wrapper

Postby mubashar » Wed Jan 18, 2012 11:33 am

@serengeor yes i am using Irrbullet Rigidbody as cars Chassi and now my question is now same

@serengeor can you identify from my post (screenshots) which bounding Box is this ... actually my question is is it possible to transform this when object when scene node transforms... as it is happening in plain bullet demo ... but not in my case using Irrbullet
When it's all over, it's not who you were. It's whether you made a difference
User avatar
mubashar
 
Posts: 63
Joined: Wed Sep 07, 2011 7:20 pm

Re: irrBullet 0.1.71 - Bullet physics wrapper

Postby RdR » Wed Jan 18, 2012 6:11 pm

mubashar wrote:@serengeor yes i am using Irrbullet Rigidbody as cars Chassi and now my question is now same

@serengeor can you identify from my post (screenshots) which bounding Box is this ... actually my question is is it possible to transform this when object when scene node transforms... as it is happening in plain bullet demo ... but not in my case using Irrbullet


Take a look in the irrBullet code, which box is drawn.
User avatar
RdR
Competition winner
 
Posts: 259
Joined: Tue Mar 29, 2011 2:58 pm

Re: irrBullet 0.1.71 - Bullet physics wrapper

Postby zerochen » Wed Feb 22, 2012 11:09 pm

hi

first of all nice work:)

i have some questens about it:
1)
in the destruktor of rigidbody and softbody stands
cpp Code: Select all
if(collID)
        delete collID;


i think it must be in the base class (icollisionobject) because it is there declared

2)
i think removeCollisionObject and other remove func are "slow" if you had many objects
because if it found the obj that will be deleted the loop will go on
maybe a break if ob found is missing?

3)
in btTriangleMesh *ITriangleMeshShape::getTriangleMesh(IMesh* const mesh)
at the end stands:

if(pTriMesh)
return pTriMesh;


i think it makes no sense at the end because the var pTriMesh is used before. if it is really necessary put it before the loop
e.g.
if(!pTriMesh)
return nullptr


4)
in IGImpactMeshShape the member var btGImpactMeshShape* gimpactShape is declared
it is not necessary to store it in gimpactShape becauce it is stored by the base class (shape)
that is a just a little bit confusing not a error itself

generell questions:
1)
what was your purpose to use UniqueID and dont let the user to handle it like in irrlicht?
eg
cpp Code: Select all
IGImpactMeshShape(ISceneNode *n, IMesh *collMesh, f32 m, s32 id = -1)


2)
in the collision loop

cpp Code: Select all
       
for(int i=0; i < world->getNumManifolds(); i++)
        {
                ICollisionCallbackInformation *info = world->getCollisionCallback(i);
 
                bool hasCollideAttribute = (info->getBody0()->getAttributes()->existsAttribute("collide")); // <-2.1 is an obj that is non static only gets the colide attribute?
                ICollisionObject* obj = (hasCollideAttribute) ? info->getBody0() : info->getBody1();
 
                ((IRigidBody*)info->getBody0())->applyForce(core::vector3df(0,10000,0), core::vector3df(0,1,0), ERBTS_LOCAL); //<-2.2 is this the right way to bounce the body away from the sec? is a effektor here better?
 
                info->getPointer()->clearManifold();  //<-2.3 is this the right way to clear & delete the info?
                delete info;
        }      
 


thx for your help
chris
zerochen
 
Posts: 196
Joined: Wed Jan 07, 2009 1:17 am
Location: Germany

Re: irrBullet 0.1.71 - Bullet physics wrapper

Postby cobra » Thu Feb 23, 2012 3:35 am

Hi Zerochen,

I greatly appreciate you reporting these findings to me so that I could fix them.

These are quite surprising as they are not things that I would do in a normal state-of-mind, but I've worked a lot on IrrBullet when I was tired, hurrying, or concentrating on deep implementations or big changes so I guess that is probably how they weaseled their ways in there. Also, these oddities are in code that dates back to the start of IrrBullet, so I haven't worked with them in quite some time; in fact, I haven't worked on IrrBullet much in quite some time, either. :)

With that said, all of the things you mentioned have been fixed. Update from the IrrBullet trunk to get the new code.

Now on to your question about UniqueID:

I chose not to let the user handle UniqueID so that it can never be -1 and there can never be any duplicates. It should never be -1 because the IrrBullet system uses UniqueID to identify collision objects.

About the collision loop:

"<-2.1 is an obj that is non static only gets the colide attribute?"
The "collide" attribute was only used in the collision example for special types of objects. It is not added by IrrBullet.

"<-2.2 is this the right way to bounce the body away from the sec? is a effektor here better?"
If you want to apply a single instantaneous impulse to something, use applyImpulse() or internalApplyImpulse().

If you want to bounce the object away from where it collided, use something like this:

cpp Code: Select all
SManifoldPoint point = info->getContactPoint(i);
irr::f32 speed = 10.0f;
static_cast<IRigidBody*>(info->getBody0())->internalApplyImpulse(point.getNormalWorldOnB().normalize()*speed, ERBTS_WORLD);


I wrote this code directly in my reply, so it hasn't been tested, but it should work just fine. Note that you must loop through all of the contact points in the collision callback.

Make sure you check that point.getDistance() is equal to 0 to make sure it is an actual physical collision and not just an AABB intersection.

Also, don't use an affector for something like this. Affectors are for behaviors that are meant to persist for an object's lifetime or for special cases where an affector would be useful.


"<-2.3 is this the right way to clear & delete the info?"
Yes, that is the correct way to delete the info. I might end up renaming the function "getCollisionCallback()" to "createCollisionCallback()" so that it's more obvious that the returned pointer must be manually deleted.


I hope that covers all that you need to know. Thank you for using IrrBullet, and thank you for being an important part of its progress (by reporting bugs and oddities).
Josiah Hartzell
Image
cobra
 
Posts: 371
Joined: Fri Jan 23, 2009 2:56 am
Location: United States

Re: irrBullet 0.1.71 - Bullet physics wrapper

Postby RdR » Wed Feb 29, 2012 4:20 pm

I created a small patch to add an extra constructor IBvhTriangleMeshShape.
This is very usefull if you want to create a RigidBody for the TerrainSceneNode.
User avatar
RdR
Competition winner
 
Posts: 259
Joined: Tue Mar 29, 2011 2:58 pm

Re: irrBullet 0.1.71 - Bullet physics wrapper

Postby BenT » Wed Mar 07, 2012 2:26 am

Thank you for irrBullet. It was easy to set up and looks really usefull. This is the first time I have really tried to understand and use it. I can't for the life of me figure out how to create terrain that works with irrbullet. Could you post an example of how to do this given an ITerrainSceneNode?
BenT
 
Posts: 1
Joined: Wed Mar 07, 2012 2:19 am

Re: irrBullet 0.1.71 - Bullet physics wrapper

Postby RdR » Wed Mar 07, 2012 11:31 am

BenT wrote:Thank you for irrBullet. It was easy to set up and looks really usefull. This is the first time I have really tried to understand and use it. I can't for the life of me figure out how to create terrain that works with irrbullet. Could you post an example of how to do this given an ITerrainSceneNode?


Take a look at this post: viewtopic.php?f=6&t=36861&start=330#p260684
User avatar
RdR
Competition winner
 
Posts: 259
Joined: Tue Mar 29, 2011 2:58 pm

Re: irrBullet 0.1.71 - Bullet physics wrapper

Postby ulao » Thu Mar 08, 2012 5:06 am

Hi would you consider/have you considered, making an irredit plug-in?
ulao
 
Posts: 274
Joined: Fri Mar 28, 2008 2:13 am

Re: irrBullet 0.1.71 - Bullet physics wrapper

Postby irrlichtuser18 » Sat Mar 10, 2012 2:42 pm

Hey all,

I am compiling irrBullet 1.7.1 on Ubuntu 11.10. Running a simple make command to compile irrBullet yields the following error: make:
cpp Code: Select all
*** No rule to make target `Bullet/btBulletDynamicsCommon.h', needed by `../source/trianglemeshshape.cpp'.  Stop.


The full log is:

cpp Code: Select all
 
MYUSERNAME@ubuntu:~/Downloads/irrBullet-0.1.71/build$ make
make: Circular ../source/trianglemeshshape.cpp <- ../source/trianglemeshshape.cpp dependency dropped.
make: *** No rule to make target `Bullet/btBulletDynamicsCommon.h', needed by `../source/trianglemeshshape.cpp'.  Stop.
 


Now, I haven't really done anything other than "cd" into the build directory. Judging from the readme, there aren't any external dependencies. If anyone could provide some assistance, it would be greatly appreciated.

Thank you in advance
irrlichtuser18
 
Posts: 3
Joined: Tue Feb 28, 2012 5:46 pm

PreviousNext

Return to Project Announcements

Who is online

Users browsing this forum: No registered users and 1 guest