Rotate camera in follow plane view only if space key is pressed

This commits merges the two orbit plane functions together in CTraffic.
The separation was necessary since XSwiftBus needed to be started manually
and until started, the pointer to CTraffic was invalid. Since XSwiftBus
is started automatically, it can be merged into one function again.
This commit also adds the feature to rotate the camera only if the space key
is pressed. This is equal to how FSX/P3D do it. Using the right mouse was
not possible, since X-Plane SDK does not offer that option.

ref T360
This commit is contained in:
Roland Winklmeier
2018-10-16 16:29:32 +02:00
committed by Klaus Basan
parent 46def05670
commit 9bb75a6f2e
4 changed files with 93 additions and 96 deletions

View File

@@ -73,21 +73,15 @@ namespace XSwiftBus
CMenu m_planeViewSubMenu;
CMenuItem planeViewOwnAircraftMenuItem;
DataRef<xplane::data::sim::flightmodel::position::local_x> m_ownAircraftPositionX;
DataRef<xplane::data::sim::flightmodel::position::local_y> m_ownAircraftPositionY;
DataRef<xplane::data::sim::flightmodel::position::local_z> m_ownAircraftPositionZ;
std::thread m_dbusThread;
bool m_isRunning = false;
bool m_shouldStop = false;
void readConfig();
void startServer();
void switchToOwnAircraftView();
static float startServerDeferred(float, float, int, void *refcon);
static float flightLoopCallback(float, float, int, void *refcon);
static int orbitOwnAircraftFunc(XPLMCameraPosition_t *cameraPosition, int isLosingControl, void *refcon);
};
}