Flight Simulator using Bullet

Show what you made with Bullet Physics SDK: Games, Demos, Integrations with a graphics engine, modeler or any other application
Post Reply
DannyChapman
Posts: 84
Joined: Sun Jan 07, 2007 4:29 pm
Location: Oxford, England
Contact:

Flight Simulator using Bullet

Post by DannyChapman »

A few days ago I released my Android (and iOS soon) app which is a free flight simulator for radio-control planes:

https://play.google.com/store/apps/deta ... se.picasim

All the flight dynamics is home grown, but it uses Bullet for the rigid body simulation - so far it's worked very well. I was a bit worried I'd get problems with the heightfield collision, since I use a dynamic LOD for the terrain (with geomorphing - quite cool to watch but a bit old fashioned I know!) - so was very happy to find the DiamondSubdivision option.

I expect to push Bullet a bit harder in the future when I add support for undercarriages etc. In the meantime, many thanks to Erwin et al for the lib (saved me from using my own JigLib :) ).

- Danny
mepster
Posts: 5
Joined: Fri Dec 17, 2010 12:26 am

Re: Flight Simulator using Bullet

Post by mepster »

Great simulator. Source code (just of the flight dynamics / Bullet integration part) would be very useful to people! :-) Think about it anyway...
DannyChapman
Posts: 84
Joined: Sun Jan 07, 2007 4:29 pm
Location: Oxford, England
Contact:

Re: Flight Simulator using Bullet

Post by DannyChapman »

Thanks. I'm quite happy to share the aerodynamics/simulation code with anyone (actually, it's really just a tidied up version of the aero code in my earlier Slope Soaring Simulator which is completely open source). Just email!

I'm not sure about the whole codebase though... I'm about to add online leaderboard support etc and am not inclined to spend lots of precious dev time making a open source system which can't be hacked...
DannyChapman
Posts: 84
Joined: Sun Jan 07, 2007 4:29 pm
Location: Oxford, England
Contact:

Re: Flight Simulator using Bullet

Post by DannyChapman »

As an update to this, it's now available on iOS as well as Android - more info and links to iTunes/Google Play here:

http://www.rowlhouse.co.uk/PicaSim

Thanks Bullet :)
cvieira
Posts: 3
Joined: Thu Sep 26, 2013 2:35 pm

Re: Flight Simulator using Bullet

Post by cvieira »

Hi @DannyChapman, great game you have there :)

I'm working on a flight sim too, and i want to integrate with bullet... but i wonder if you explain how do you make this integration... so, you have a flight dynamic model that calculates pitch, roll and yaw for you taking into account several forces that are acting in the aircraft. This way you can render the plane correctly on screen.

But how do you manage the collisions that are managed by bullet and not by your flight dynamic model? When aircraft hit the ground (bullet body) you apply forces to your aircraft in flight dynamic model, so that he can calculate the new forces that applies to the aircraft? If that so, how do you know the magnitude of those forces, so this can be as realistic as possible... the problem here, is between the coordination between the bullet aircraft body, and the aircraft body in the flight dynamic model... how are you handling this?

Any help would be appreciated!

Many thanks!

Regards,
DannyChapman
Posts: 84
Joined: Sun Jan 07, 2007 4:29 pm
Location: Oxford, England
Contact:

Re: Flight Simulator using Bullet

Post by DannyChapman »

My flight dynamics code just calculates forces and torques that are applied to the rigid body that represents the plane. Bullet handles integrating these forces, and of course applying impulses etc to handle collisions.
cvieira
Posts: 3
Joined: Thu Sep 26, 2013 2:35 pm

Re: Flight Simulator using Bullet

Post by cvieira »

Hi @DannyChapmanm thanks for your reply!

Ok i see your strategy... that makes the integration easier in fact and it's very clever indeed... i was trying to make using the jsbim flight dynamics, but the integration with bullet to handle collision is somewhat tricky... the problem is how and what forces and magnitude to apply to the flight dynamic model in the case of collision.

May i wonder if you can give me the location of you open source project - Slope Soaring Simulator - , that you referred in another post?

Thanks + Regards,
DannyChapman
Posts: 84
Joined: Sun Jan 07, 2007 4:29 pm
Location: Oxford, England
Contact:

Re: Flight Simulator using Bullet

Post by DannyChapman »

cvieira wrote:the problem is how and what forces and magnitude to apply to the flight dynamic model in the case of collision.
Surely when you write "problem" you mean "fun"?!

You can get SSS here: http://www.rowlhouse.co.uk/sss/sss-2.19.3-skybox.zip - that includes all the source code.

I changed quite a few things and fixed a few bugs (I think!) in the aero code for my current project, but the basic idea is the same - to represent the plane using a number of aerofoils, each of which acts independently of the others (although you can add in interactions later). It works pretty nicely - the Phase 6 in PicaSim flies almost exactly like my real plane (or rather - like my real plane would if it hadn't been broken and repaired quite so often :) ). It's also how most of the current crop of flight sims work, I believe, and is very good for getting emergent behaviour. JSBSim will support this, but it's not that big a task to do it yourself (if you're that way inclined).

Actually I see the JSBSim docs provide a few clues - for example you need to know the CL/CD response around the full range of angles of attack. Page 23 of http://jsbsim.sourceforge.net/JSBSimReferenceManual.pdf has a graph. My current system allows the CL/CD curves to be authored by hand for when the aerofoil is "flying" (i.e. not stalled), and then it blends to a procedurally determined response in the stalled regime - since all stalled wings will act very similarly.

Cheers - Danny
cvieira
Posts: 3
Joined: Thu Sep 26, 2013 2:35 pm

Re: Flight Simulator using Bullet

Post by cvieira »

DannyChapman wrote:
cvieira wrote:the problem is how and what forces and magnitude to apply to the flight dynamic model in the case of collision.
Surely when you write "problem" you mean "fun"?!
Hi, i think i really meant "fun" :)

Thanks make available the source of your project! I hope to learn some more about flight dynamics with your approach.

In fact i have made some progress using jsbsim during the week and it's quite nice. I have a plane flying using the flight dynamics provided by jsbsim. The problem is that it just handles the collision with ground. With some work it's possible to model a more complex terrain, and now the "height" of the terrain right beneath the plane (ground altitude). But in my game i will need to put objects in the scene. And if the plane collide with them i want to see the plane acting like it's hitting something of course. That's why i want to use bullet to the physics part. But, in case of a collision, i need to pass the acting forces to fbsim FDM, so that the plane takes a different behavior that affects it's flight.

For example, imagine a wall. If hit the wall (collision detected by bullet), i need to inform fbsim, by applying some forces to the plane (in certain x, y, z), so that fbsim can calculates forces and moments accordingly, so that the rendered plane can be correctly aligned in the world (FDM - Bullet world - Rendering).

I guess i have to explore a little better jsbsim so that i can achieve such integration. If i can't handle it perfectly i have to move to other solution :)

You seem to know jsbsim, so if you have some clue about this, it would be good if you can share it :)

Many thanks again! Regards,
Post Reply