dumbo2007
Crazy about real time sims
Hi,
Here is a little toy to play with (if it works at all) :
http://www.megaupload.com/?d=BBBB0DAF
http://www.filefactory.com/file/cf29836/n/Upload.zip
So I have finished a basic version of an All Terrain Vehicle.
Thanks to CoolHand for the awesome mesh and for conceiving the whole idea.
I put the zip with the addon in the above file upload sites as its quite large...so please bear with the wait time. The download is about 9 MB basically due to a large texture for the rover hull.
Alternately you can also try the file attached with this post which does not include the texture and is about 3.3 MB
Its a zip containing the following :
1. A Physics folder which contains the Viewer.exe executable. It runs all the physics. You need to start it before you start Orbiter. On startup it will wait till you start the ATV scenario (explained next)
2. A folder called ATV inside the Scenarios folder will contain the ATV scenario after you paste it over the Orbiter installation - this is as you would any other addon. This scenario has 3 vessels only - Brighton2(Controlling base), ATV1(this is just the chassis) and ATVShuttle1 (ATV Shuttle)
3. You need to start the above scenario after you start the Viewer. Once the scenario loads, the Viewer detects this and will load the physics world. You will be able to see it in an OpenGL window. So its best to run Orbiter windowed for the moment. You can minimize the OpenGL window. There is also a black console window opened which prints some messages useful for debugging. You can minimize this too if you want.
4. The scenario will load a sample test terrain which is all green colored and you will be looking down at it from high above the Brighton Beach tank. At this point you need to press C to connect to the Viewer. You must ensure that the vessel Brighton2 has focus as the key press must go to it.
5. This will allow Orbiter to connect to the Viewer and you should see the ATV chassis rolling about on the green terrain. You can now change focus to ATV1 which is the chassis and move it about using the arrow keys. Up key is accelerator, DOWN is brake, W is gear up, S is gear down, A is neutral, D is reverse.
6. You can also reset the scene by pressing R
7. Now you may change focus to ATVShuttle1 which will be waiting in one of the landing pads. Press G to attach/detach it to the chassis. Press F1 to go inside the shuttle. Use the keys as in 5 to control the chassis + shuttle combined vessel
8. Possible problems if you are using Vista or Windows 7
If you are not running an administrative account then the Viewer.exe will fail to start. You will get an error in the black console window that says Unable to create shared memory file(5) ....or something similar.
For testing you need to run from an Administrative account or Run As Administrator, the Viewer.exe executable. You also need to start Orbiter as Administrator as it needs to access another program's data.
Alternately you need to assign the Create Global Object privilege to your standard user account. If needed I can explain how to do this later.
I understand that 8 is a security risk and a bit of a hassle, but unfortunately both programs need access to each other's data and thus needs certain elevated privileges.
The access is to shared memory files which have to be made in the global namespace to be accessible to all programs. If this is not an issue then I would like to continue to use shared memory as its makes transfers very convenient. Otherwise I can think of a socket based implementation but that may run into firewall issues(each approach has its tradeoffs).
Another problem may be that the vehicle movement is very slow or jerky. This is possibly due to obsolete OpenGL drivers. I am working to make the application independent of OpenGL, but as of now the OpenGL window is very useful to see and change things in the Physics world simultaneously.
You can play around with the Physics there too.
In the OpenGL window,
F10 is for changing camera, keeping ctrl pressed and moving the mouse with the left button pressed allows changing the view point. Use right button to zoom in and out. You can pick and move objects around and they will move in Orbiter too. I am working on making the interface similar to Orbiter.
This is purely a development release to see if the concept works at all on other computers.
Also , the rovers wheels will leave the Moon's surface at large distances as discussed here :
http://orbiter-forum.com/showthread.php?p=275384#post275384
Am on it !
Code included in OrbiterSDK.zip. clbkGeneric() is heavily used to pass data structures to vessels and other signals. BulletBase::moveAttachedVessels() is what actually applies the physics in Orbiter. Always nice to have some code peer reviewed !
Here is a little toy to play with (if it works at all) :
http://www.megaupload.com/?d=BBBB0DAF
http://www.filefactory.com/file/cf29836/n/Upload.zip
So I have finished a basic version of an All Terrain Vehicle.
Thanks to CoolHand for the awesome mesh and for conceiving the whole idea.
I put the zip with the addon in the above file upload sites as its quite large...so please bear with the wait time. The download is about 9 MB basically due to a large texture for the rover hull.
Alternately you can also try the file attached with this post which does not include the texture and is about 3.3 MB
Its a zip containing the following :
1. A Physics folder which contains the Viewer.exe executable. It runs all the physics. You need to start it before you start Orbiter. On startup it will wait till you start the ATV scenario (explained next)
2. A folder called ATV inside the Scenarios folder will contain the ATV scenario after you paste it over the Orbiter installation - this is as you would any other addon. This scenario has 3 vessels only - Brighton2(Controlling base), ATV1(this is just the chassis) and ATVShuttle1 (ATV Shuttle)
3. You need to start the above scenario after you start the Viewer. Once the scenario loads, the Viewer detects this and will load the physics world. You will be able to see it in an OpenGL window. So its best to run Orbiter windowed for the moment. You can minimize the OpenGL window. There is also a black console window opened which prints some messages useful for debugging. You can minimize this too if you want.
4. The scenario will load a sample test terrain which is all green colored and you will be looking down at it from high above the Brighton Beach tank. At this point you need to press C to connect to the Viewer. You must ensure that the vessel Brighton2 has focus as the key press must go to it.
5. This will allow Orbiter to connect to the Viewer and you should see the ATV chassis rolling about on the green terrain. You can now change focus to ATV1 which is the chassis and move it about using the arrow keys. Up key is accelerator, DOWN is brake, W is gear up, S is gear down, A is neutral, D is reverse.
6. You can also reset the scene by pressing R
7. Now you may change focus to ATVShuttle1 which will be waiting in one of the landing pads. Press G to attach/detach it to the chassis. Press F1 to go inside the shuttle. Use the keys as in 5 to control the chassis + shuttle combined vessel
8. Possible problems if you are using Vista or Windows 7
If you are not running an administrative account then the Viewer.exe will fail to start. You will get an error in the black console window that says Unable to create shared memory file(5) ....or something similar.
For testing you need to run from an Administrative account or Run As Administrator, the Viewer.exe executable. You also need to start Orbiter as Administrator as it needs to access another program's data.
Alternately you need to assign the Create Global Object privilege to your standard user account. If needed I can explain how to do this later.
I understand that 8 is a security risk and a bit of a hassle, but unfortunately both programs need access to each other's data and thus needs certain elevated privileges.
The access is to shared memory files which have to be made in the global namespace to be accessible to all programs. If this is not an issue then I would like to continue to use shared memory as its makes transfers very convenient. Otherwise I can think of a socket based implementation but that may run into firewall issues(each approach has its tradeoffs).
Another problem may be that the vehicle movement is very slow or jerky. This is possibly due to obsolete OpenGL drivers. I am working to make the application independent of OpenGL, but as of now the OpenGL window is very useful to see and change things in the Physics world simultaneously.
You can play around with the Physics there too.
In the OpenGL window,
F10 is for changing camera, keeping ctrl pressed and moving the mouse with the left button pressed allows changing the view point. Use right button to zoom in and out. You can pick and move objects around and they will move in Orbiter too. I am working on making the interface similar to Orbiter.
This is purely a development release to see if the concept works at all on other computers.
Also , the rovers wheels will leave the Moon's surface at large distances as discussed here :
http://orbiter-forum.com/showthread.php?p=275384#post275384
Am on it !
Code included in OrbiterSDK.zip. clbkGeneric() is heavily used to pass data structures to vessels and other signals. BulletBase::moveAttachedVessels() is what actually applies the physics in Orbiter. Always nice to have some code peer reviewed !
Attachments
Last edited: