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:

Re: irrBullet 0.1.71 - Bullet physics wrapper

Post by cobra »

Hi everyone. I want to apologize for the lack of author support and updates to irrBullet. I haven't had time to help with problems or work on irrBullet and I'm not sure when I will have time.

I did have some time to check up on things, however, and I decided to let everyone know that irrBullet has not been abandoned. To show my appreciation to all of the irrBullet users, I made this small flag chart with 45 of the most popular user countries of 2011. Flag size represents the user mass of a country.

Image


- Josiah
Josiah Hartzell
Image
Ravi08
Posts: 249
Joined: Thu Jul 17, 2008 12:25 pm

Re: irrBullet 0.1.71 - Bullet physics wrapper

Post by Ravi08 »

Hi, I was wondering if anyone could help me. I think I have problem with rigidbody/animated node.

I have an animated node which when hit falls down, now what happens is when hit the node animates and goes down but I dont think the rigidbody updates beacuse if I fire where the node started ie standing up, the bullet still collides with something.

Code for the animated node and rigidbody:

Code: Select all

IAnimatedMeshSceneNode* targetNode = (IAnimatedMeshSceneNode*)(device->getSceneManager()->getSceneNodeFromName("target"));
targetNode ->setCurrentFrame(0);
targetNode ->setAnimationSpeed(0);
 
ICollisionShape *targetShape = new IGImpactMeshShape(targetNode , device->getSceneManager()->getMesh("../../media/target.b3d"), 0);
IRigidBody *targetBody = world->addRigidBody(targetShape,COL_WORLD_OBJECT,worldObjectCollidesWith);
targetBody ->getAttributes()->addBool("target", true);
Code for when the target is hit:

Code: Select all

obj1->getAttributes()->setAttribute("target", false);
targetNode ->setFrameLoop(1,31);
targetNode ->setAnimationSpeed(10);
targetNode ->setLoopMode(false);
Sorry if this has been asked before, I couldn't find anything and thanks.
"Hey Baby Wobbling Wobbling"
-Russell Peters
Granyte
Posts: 850
Joined: Tue Jan 25, 2011 11:07 pm
Contact:

Re: irrBullet 0.1.71 - Bullet physics wrapper

Post by Granyte »

right now i have an odd issue with irrbullet a strange windows apear in the middle of my screen and i can't interact with my program i'll post screen shot and code implying irrbullet
cobra
Posts: 371
Joined: Fri Jan 23, 2009 2:56 am
Location: United States
Contact:

Re: irrBullet 0.1.71 - Bullet physics wrapper

Post by cobra »

Granyte:
Is it Irrlicht's color-select dialog? What version of Irrlicht are you using? I've had this happen to me before but updating Irrlicht stopped the problem. I think 1.7 caused it.

Ravi08:
The rigidbody does not automatically scale with the bounding box of a scene node. You'll have to figure out a way to do that yourself because it's too specific to your game.
Josiah Hartzell
Image
Granyte
Posts: 850
Joined: Tue Jan 25, 2011 11:07 pm
Contact:

Re: irrBullet 0.1.71 - Bullet physics wrapper

Post by Granyte »

i was using irrlicht 1.8.0 svn


i switched to usong bullet directly because i need colision with the terrain mesh but i'm now facing newer issues
polylux
Posts: 267
Joined: Thu Aug 27, 2009 12:39 pm
Location: EU

irrBullet and ITerrainSceneNode

Post by polylux »

Hey everyone.

I played with irrBullet quite a while ago and now it's time to fully integrate it into my project.
Similar to quite some users I'm facing a problem with adding my terrain scene node to the physics simulation. The scene node is correctly added to the sim world but other objects still pass through it.

Here's my approach:
From the terrain scene node's nature, it's not possible to get its standard IMesh but a mesh buffer from an arbitrary LOD. Hence I extended ITriangleMeshShape's functionality to also accept IMeshBuffers as a parameter as ITMS basically works on the mesh buffers of IMesh.

Code: Select all

void IBvhTriangleMeshShape::createShape(IMeshBuffer *meshBuffer)
{
    btBvhTriangleMeshShape* bvhShape =  new btBvhTriangleMeshShape(getTriangleMeshFromBuffer(meshBuffer), false, true);
    shape = bvhShape;
 
    calculateLocalInertia(getMass(), vector3df(0.0f,0.0f,0.0f));
}
On my side of the action, I use the following code to add terrain to the physics simulation:

Code: Select all

void OFLPhysics::addTerrain(scene::ITerrainSceneNode* terrain)
{
    OFLPhysics* inst = getInstance();
    scene::CDynamicMeshBuffer buf(irr::video::EVT_STANDARD,irr::video::EIT_16BIT);
    terrain->getMeshBufferForLOD(buf, 0);
    ICollisionShape* terrShape = new IBvhTriangleMeshShape(terrain, &buf, 0.f);
    terrShape->setMargin(.5f);
    IRigidBody* terrBody = inst->bWorld->addRigidBody(terrShape);
    terrBody->setCollisionFlags(ECF_STATIC_OBJECT);
}
Obviously, it fills a MeshBuffer object with data for a given LOD step which is then used to create bullet's representation of it.
Note that debugging shows the correct (similar) values as for verts- and triangle count.
Hence the questions are:
- Am I doing smth wrong?
- Am I missing smth?

All the other stuff collides as it should so I'm quite sure the sim is correctly set up.

Help greatly appreciated, ;)
p.
beer->setMotivationCallback(this);
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Re: irrBullet 0.1.71 - Bullet physics wrapper

Post by serengeor »

@polylux: are you trying to collide multiple IBvhTriangleMesh shapes? If so, that's the problem.
Working on game: Marrbles (Currently stopped).
polylux
Posts: 267
Joined: Thu Aug 27, 2009 12:39 pm
Location: EU

Re: irrBullet 0.1.71 - Bullet physics wrapper

Post by polylux »

serengeor wrote:@polylux: are you trying to collide multiple IBvhTriangleMesh shapes? If so, that's the problem.
Thanks serengeor,
no, currently I only collide a cube with my terrain - so just one IBTM for the moment. Also, the terrain seems to be correctly handled as it starts to drift downwards as i assign mass to it.
Just to avoid problems in the future, what do you mean by 'collide multiple IBTMs'? Mean if there is more than one IBTM present or IBTMs that collide with each other?

p.
beer->setMotivationCallback(this);
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Re: irrBullet 0.1.71 - Bullet physics wrapper

Post by serengeor »

Well it seams they are only intended to be for static usage (static level geometry) and nothing else. For example if you would drop one IBvhTriangleMeshShape onto another one it would simply just go trough it. So I think that applying mass to it would't be a good idea.
Working on game: Marrbles (Currently stopped).
polylux
Posts: 267
Joined: Thu Aug 27, 2009 12:39 pm
Location: EU

Re: irrBullet 0.1.71 - Bullet physics wrapper

Post by polylux »

serengeor wrote:Well it seams they are only intended to be for static usage (static level geometry) and nothing else. For example if you would drop one IBvhTriangleMeshShape onto another one it would simply just go trough it. So I think that applying mass to it would't be a good idea.
thanks! never intended to anyways.
but still the problem remains. is there probably some mesh size constraint from bullet?
beer->setMotivationCallback(this);
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Re: irrBullet 0.1.71 - Bullet physics wrapper

Post by serengeor »

polylux wrote:is there probably some mesh size constraint from bullet?
I don't know if I understand you correctly, but here's a link where I think you could read up on that: http://www.bulletphysics.org/mediawiki- ... _The_World
Working on game: Marrbles (Currently stopped).
polylux
Posts: 267
Joined: Thu Aug 27, 2009 12:39 pm
Location: EU

Re: irrBullet 0.1.71 - Bullet physics wrapper

Post by polylux »

Thanks again serengeor,

I am pretty sure it's no tunneling problem as the cube is sufficiently big (edge len: 3 units), falls down slowly and collides nicely with all other objects. Might need to debug further with the debug draw funcs. Will report back then.

p.
beer->setMotivationCallback(this);
polylux
Posts: 267
Joined: Thu Aug 27, 2009 12:39 pm
Location: EU

Re: irrBullet 0.1.71 - Bullet physics wrapper

Post by polylux »

Well, seemingly it's the wrong way to create a triangle collision mesh from your terrain as with a sufficiently sized terrain the simulation pretty fast slows down to a slide show. Bullet offers the btHeightfieldTerrainShape (Link) for such things. I am currently very tempted to extend irrBullet's functionality by this - as long as no one else has done it already.
If so, just tell me please.

p.
beer->setMotivationCallback(this);
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Re: irrBullet 0.1.71 - Bullet physics wrapper

Post by serengeor »

polylux wrote:Well, seemingly it's the wrong way to create a triangle collision mesh from your terrain as with a sufficiently sized terrain the simulation pretty fast slows down to a slide show. Bullet offers the btHeightfieldTerrainShape (Link) for such things. I am currently very tempted to extend irrBullet's functionality by this - as long as no one else has done it already.
If so, just tell me please.

p.
How big was your terrain (how much vertices)?
Working on game: Marrbles (Currently stopped).
polylux
Posts: 267
Joined: Thu Aug 27, 2009 12:39 pm
Location: EU

Re: irrBullet 0.1.71 - Bullet physics wrapper

Post by polylux »

serengeor wrote:
polylux wrote:Well, seemingly it's the wrong way to create a triangle collision mesh from your terrain as with a sufficiently sized terrain the simulation pretty fast slows down to a slide show. Bullet offers the btHeightfieldTerrainShape (Link) for such things. I am currently very tempted to extend irrBullet's functionality by this - as long as no one else has done it already.
If so, just tell me please.

p.
How big was your terrain (how much vertices)?
roughly 350k of verteces at LOD 0
beer->setMotivationCallback(this);
Post Reply