Irrlicht and physics, where to start?

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.
Post Reply
vincentjl
Posts: 3
Joined: Fri Oct 21, 2011 1:05 pm

Irrlicht and physics, where to start?

Post by vincentjl »

I'm new to both irrlicht and cpp programming, but have gotten quite far programming my first game in it, but now I want to implement realistic physics, rather then my own 2d collision detection hacks.
So I started looking at the newton and tokamak tutorials, but both seem to not compile due to issues with calling functions with too few or too many arguments, so I suspect that the libraries have changed since they where written. Goggling to find proper tutorials seems a tedious exercise in similar problems.

I have yet to get a hold of PhysX to try that out, anyone know a better way to get it then their own website? I've registered and reset the password twice, and it still says "not registered when I try to log on".

Basically I'm asking, where does one start to get a foothold? Right now I'm stuck with nothing working and no good resources on how to start out. Please don't just respond "search" the forum. My main problem is that all the resources I've found through searching end up leading to tutorials that don't compile. If you have links to threads that you know have working code feel free to post them.
Radikalizm
Posts: 1215
Joined: Tue Jan 09, 2007 7:03 pm
Location: Leuven, Belgium

Re: Irrlicht and physics, where to start?

Post by Radikalizm »

If you're not familliar with C++ programming yet, I would recommend not to start off with advanced stuff like physics engines since you'll have a really hard time learning how to use the APIs involved (ie. irrlicht, and your physics library) without knowing how to use the language these APIs are provided in in the first place
Learn the language first, get to the point where you can use it comfortably; after that you can delve into these kinds of topic

To give you some hints on physics libraries, I'm a huge fan of both Bullet and Havok. It seems Bullet gets a lot of love around here since there are multiple irrlicht-oriented wrappers for it available. Personally I'd say Havok is more mature and advanced (and somewhat easier to use), but this comes at the price of having to pay licensing fees if you'd want to release your game commercially, although I believe you can use the free version of Havok commercially for low-cost games
Also, I haven't seen any publicly release Havok wrappers for irrlicht, so you'd have to integrate it by yourself, which is definitely not something for a beginner

If you really want to give it a try now, I'd suggest you look in the project announcements board for some available wrappers
vincentjl
Posts: 3
Joined: Fri Oct 21, 2011 1:05 pm

Re: Irrlicht and physics, where to start?

Post by vincentjl »

I am new to c++, but I would not say that I am unfamiliar with neither the programming language nor the syntax. I've gotten quite far in a short time, and luckily c++ itself is extremely well documented on the web, which sadly doesn't seem the case for the physics engines I've been looking at. If it was necessary I could easily start programming my own physics simulations for the purpose of the collision detection and momentum handling that I need, but this seems like plain overkill when there are engines available that already handle this. Also, I would most likely not have a very computational optimal implementation. Now I thank you for your answer, but you really only gave me "bullet" to go by which isn't much help. Do you know of a good beginners tutorial, do you know of a simple script that shows the usage for simple collision detection, where do you look up functions etc. Really, where do you start when you don't know anything about the library. I don't want to jump into wrappers unless they are extremely mature which doesn't seem like the case for most of the stuff I find around here, I'm looking to learn how the physics engine I end up using operates, adding another layer of abstraction won't help me, especially if that layer is even more sparsely documented then the engine it abstracts.
Where did you start out when you first stared using a physics engine?
Radikalizm
Posts: 1215
Joined: Tue Jan 09, 2007 7:03 pm
Location: Leuven, Belgium

Re: Irrlicht and physics, where to start?

Post by Radikalizm »

vincentjl wrote:I am new to c++, but I would not say that I am unfamiliar with neither the programming language nor the syntax. I've gotten quite far in a short time, and luckily c++ itself is extremely well documented on the web, which sadly doesn't seem the case for the physics engines I've been looking at. If it was necessary I could easily start programming my own physics simulations for the purpose of the collision detection and momentum handling that I need, but this seems like plain overkill when there are engines available that already handle this. Also, I would most likely not have a very computational optimal implementation. Now I thank you for your answer, but you really only gave me "bullet" to go by which isn't much help. Do you know of a good beginners tutorial, do you know of a simple script that shows the usage for simple collision detection, where do you look up functions etc. Really, where do you start when you don't know anything about the library. I don't want to jump into wrappers unless they are extremely mature which doesn't seem like the case for most of the stuff I find around here, I'm looking to learn how the physics engine I end up using operates, adding another layer of abstraction won't help me, especially if that layer is even more sparsely documented then the engine it abstracts.
Where did you start out when you first stared using a physics engine?
You can't expect to be spoonfed in these kinds of things, a simple google search would have brought you to the bullet or havok website which has tutorials and a complete API reference, and last time I checked using google was neither hard nor time-consuming

If you want to program in C++ and if you want to touch some more advanced topics you'll have to get used to the fact that you're going to have to study APIs and manuals, that there won't always be people or guides holding your hand throughout your development process, and that you'll have to do research to accomplish things

I started out exactly like this, I checked out the available options, I read their manuals, I looked at the APIs, and based on all that information I decided which one was the best for me and which one would be more likely to fit my application's needs
I suggest you do the same
vincentjl
Posts: 3
Joined: Fri Oct 21, 2011 1:05 pm

Re: Irrlicht and physics, where to start?

Post by vincentjl »

Seriously.... I'm not asking to be spoonfed. I am asking an honest simple question of where to start. As stated I have been through quite a few introduction tutorials for Newton and tokamak, which where based around code that couldn't compile. Now you are trying to be helpful and suggest yet another engine, which you find a satisfactory answer, but you don't link to any specific tutorial or even describe the state of the documentation. Even I could have answered some other poor sap trying to start out physics programming "Hey look up Newton", which wouldn't at all be helpful.
Basically I'm asking: "What books did you find most helpful when starting to lean English" and you are answering: look in the library. Not a false statement but it classifies as the least helpful one you could give.

So to be more specific. Have you followed any tutorials, which did you find good, wheres the best place to start? The tutorial on their site naturally doesn't deal with irrlicht, so where is a good place to look for an discussion of the best way to use them together, that sort of thing.
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Irrlicht and physics, where to start?

Post by CuteAlien »

Admittedly I started out by writing my own physics to understand all the troubles you can run into. It is not as trivial as many people think to use a physics engine for collision. The main reason why it is hard is that the movement of the player in most cases is happening outside the physics. Meaning - you rarely use forces to push around your avatar except in very special games and just moving it's positions is actually a a very non-physical thing to do. You also have to be aware that collision-routines are just one aspect of physics engines and usually not the one they care about most (some don't even use their own collision handling but use libraries for collision themselves).

For general information about collision you can find many articles on gamasutra.com, but I have no specific one to recommend right now. I might help looking for articles which discuss how it's done in specific games (I'm pretty sure you find some information for example about collision handling in quake somewhere on the web). And you have to understand what it is supposed to do before you actually use them. Also all physics engines I've seen so far also had concrete examples for typical use-cases (not for Irrlicht, but to show how to use them in general).

Irrlicht specific I would recommend looking at the recent post in the project announcements forum. Several active physic-engine wrappers are discussed there. Right now I see irrBullet, irrBP and irrODE threads being active. I think Bullet and ODE are more often used with Irrlicht than most other physics engine as they have similar licenses to Irrlicht (open source and can be used in any kind of project including in closed source projects) and none of the other physics engines can offer that. Features are secondary unless you really, really need a specific feature which isn't offered by any of the really open engines.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
eagletree
Posts: 28
Joined: Mon Jul 26, 2010 11:55 pm

Re: Irrlicht and physics, where to start?

Post by eagletree »

One starting point for integration of Bullet and Irrlicht is the thread below. If I recall, it's one of the few non-obscured (abstracted) examples on the web and can be tested without the complexity of wrappers. You will need to download bullet physics from bulletphysics.com and his zip file, but everything else is straight irrlicht. You would have to search yourself, but I believe there is a irrlicht / bullet vehicle controller example available elsewhere. Character and vehicle controllers are good starts and most examples will let you see how dynamics works, then collision detection will be more understandable when it comes time. This example was provided by the fellow who developed Bullet.

http://irrlicht.sourceforge.net/forum/v ... =5&t=32593

I've no experience on any other physics engine, so I can't comment.

To your comment on tutorials. You are experiencing the lack of documentation in OSS. Unpaid, busy developers seldom have time to create formal documentation as Computer Science should require. It's something you just have to deal with. For bullet, the only formal documentation I've found was in "Game Coding Complete, Third Edition", by McShaffry. It is useless for irrlicht but valuable for terminology of physics engines and bullet in particular.
Post Reply