how to create rigid bodies in irrlicht?

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
suresh kumar
Posts: 13
Joined: Fri Mar 11, 2011 7:06 am

how to create rigid bodies in irrlicht?

Post by suresh kumar »

hi all,
I'm new to irrlicht.can anybody tell me how to create rigid body in irrlicht? with or without third party physics lib? Preferably without any third party physics lib.if with, it would be great to have newton.

Thanks
The Journey is more important than the destination...
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Post by serengeor »

irrlicht can only handle collisions I think, you'll have to use third party lib, such as the one you mentioned, tough I found newton hard to integrate. you could look here for simple bullet physics implementation:http://irrlicht.sourceforge.net/phpBB2/ ... ght=bullet
Or you could search for newton wrapper in the forums and try to upgrade it for newest newton version.
Working on game: Marrbles (Currently stopped).
suresh kumar
Posts: 13
Joined: Fri Mar 11, 2011 7:06 am

Post by suresh kumar »

my work involves very simple stuff like cubes and spheres thats it. so which one is better, as in easy to learn and implement.i worked on box 2d extensively.
The Journey is more important than the destination...
ChaiRuiPeng
Posts: 363
Joined: Thu Dec 16, 2010 8:50 pm
Location: Somewhere in the clouds.. drinking pink lemonade and sunshine..

Post by ChaiRuiPeng »

suresh kumar wrote:my work involves very simple stuff like cubes and spheres thats it. so which one is better, as in easy to learn and implement.i worked on box 2d extensively.
well i think bullet is failry easy to use and set up.
it might be too big though for what you need...

may i ask which platform intendt to build on?
suresh kumar
Posts: 13
Joined: Fri Mar 11, 2011 7:06 am

Post by suresh kumar »

mobile... will it matters?
The Journey is more important than the destination...
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Post by serengeor »

suresh kumar wrote:mobile... will it matters?
It does, you have a lot more limited resources on mobile. Also the speeds of mobile devices are a lot slower, so you will have to optimise physics and irrlicht a lot I think to get good results.
And yes, you should totally try bullet and make a mini wrapper for it, as you don't need much features as I see.
Also you could try searching for some simpler physics library, tough I don't really know any that would be easy to set up.
Working on game: Marrbles (Currently stopped).
suresh kumar
Posts: 13
Joined: Fri Mar 11, 2011 7:06 am

Post by suresh kumar »

do you think bullet do well than newton in this scenario i mean the platform.
The Journey is more important than the destination...
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Post by serengeor »

suresh kumar wrote:do you think bullet do well than newton in this scenario i mean the platform.
I don't really know, you should probably try both with minimal samples and see which gives you better results. For me bullet is just amazing by its ease of use.
Working on game: Marrbles (Currently stopped).
suresh kumar
Posts: 13
Joined: Fri Mar 11, 2011 7:06 am

rotation around a point

Post by suresh kumar »

Hi all,
How to rotate an object around an arbitrary point? i have a cube it should do somersault on press of button.

Thanks all helps are highly appreciated
The Journey is more important than the destination...
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Re: rotation around a point

Post by serengeor »

suresh kumar wrote:Hi all,
How to rotate an object around an arbitrary point? i have a cube it should do somersault on press of button.

Thanks all helps are highly appreciated
Are you using physics library? there is more than one way to do this.
Working on game: Marrbles (Currently stopped).
suresh kumar
Posts: 13
Joined: Fri Mar 11, 2011 7:06 am

Post by suresh kumar »

ya i got it working...but anyway i'm not using any physics lib...one more thing where can i find doc regarding vector and matrix classes in irrlicht...
The Journey is more important than the destination...
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Post by serengeor »

suresh kumar wrote:ya i got it working...but anyway i'm not using any physics lib...one more thing where can i find doc regarding vector and matrix classes in irrlicht...
Erm, the only doc irrlicht has is doxygen API, look at the main page for it.
Working on game: Marrbles (Currently stopped).
suresh kumar
Posts: 13
Joined: Fri Mar 11, 2011 7:06 am

Post by suresh kumar »

can anyone tell me how to find whether two boxes collide each other in irrlicht.Any inbuilt function?
The Journey is more important than the destination...
suresh kumar
Posts: 13
Joined: Fri Mar 11, 2011 7:06 am

Post by suresh kumar »

i used like this
if(pNode->getTransformedBoundingBox().intersectsWithBox(pCube->getTransformedBoundingBox()))
pDebug->debug("TRUE");
else
pDebug->debug("FALSE");

it is always returning false except the first frame
donno what the heck is going on....
help me out
The Journey is more important than the destination...
shadowslair
Posts: 758
Joined: Mon Mar 31, 2008 3:32 pm
Location: Bulgaria

Post by shadowslair »

suresh kumar wrote:i used like this
if(pNode->getTransformedBoundingBox().intersectsWithBox(pCube->getTransformedBoundingBox()))
pDebug->debug("TRUE");
else
pDebug->debug("FALSE");
This code only performs an aabb-aabb (axis-aligned bounding boxes, both in world space) intersection test, which is either true or false for non transformed (non rotated) bboxes. For a collision response you need collision info, then you use it to apply some impulses for the physics simulation. Unfortunately I highly doubt you`re gonna be able to achive this using the build-in functions, and creating a robust rigid boxes physics simulation from scratch is a bit of pain, especially stacking etc.
suresh kumar wrote:it is always returning false except the first frame
donno what the heck is going on....
help me out
Then you probably need to update the collision data for each frame. Recently we`re out of crystal spheres, so please help us help you. If you need an exact answer, you need to post some code. Everything else is just guesses...
"Although we walk on the ground and step in the mud... our dreams and endeavors reach the immense skies..."
Post Reply