JSBSim simulation with HOTAS in Unity3D #879
Replies: 6 comments 6 replies
-
Okay, so if you're not writing this in C++ and using Are you running JSBSim as a separate process then, as opposed to linking it into your app? And then are you communicating in terms of getting inceptor inputs into JSBSim and state output from JSBSim via a network connection writing and reading properties? Or have you built JSBSim into a DLL and then you're using something like PInvoke from C# to communicate with JSBSim via your wrapper? Now I wouldn't set your inceptor's axis scale to the Lines 189 to 209 in 10ac203 |
Beta Was this translation helpful? Give feedback.
-
Yes, I'm running JSBSim as a separate process and communicating via network connection for reading and writing properties. |
Beta Was this translation helpful? Give feedback.
-
Currently there is no C# wrapper along the lines of the Python wrapper for the core JSBSim classes. Since they're C++ classes as opposed to plain C-functions it means you can't simply use P/Invoke to call them from C#, someone would need to write a proper wrapper, probably easiest as a C++/CLI wrapper. The other option as mentioned by @pd3a is to use a network connection. |
Beta Was this translation helpful? Give feedback.
-
Yes you could add some of your own wrapper functions in C/C++ that are then exported from JSBSim.dll when you build it as a DLL. Now if you make your wrapper functions plain C functions then it makes it trivial to use P/Invoke from C#. But if you want to expose a C++ class based wrapper then you would need to go with the C++/CLI wrapper approach that I mentioned above. |
Beta Was this translation helpful? Give feedback.
-
Impossible to tell without seeing your implementation of P.S Example (use the edit option to see exactly what I typed below): void run(FGFDMExec* fdmExec)
{
fdmExec->run();
} |
Beta Was this translation helpful? Give feedback.
-
Not clear in your examples if an aircraft has been sucessfully loaded before |
Beta Was this translation helpful? Give feedback.
-
I'm developing a flight simulator in Unity3D engine. I want to use JSBSim library to simulate the flight physics. I wrote the wrapper for JSBSim which takes HOTAS inputs through Unity and sends output data (position, velocities, orientation, angular velocities) back to Unity.
The wrapper is working i.e i'm able to get input to jsbsim and output back to unity. In doing so i'm facing the following issues:
I'm aware of existence of copy_to_jsbsim and copy_from_jsbsim but i do not know how to access them in C# for Unity. Help me here please.
Beta Was this translation helpful? Give feedback.
All reactions