private FlightLoopTime TurnTheWheel(TimeSpan elapsedTimeSinceLastCall, TimeSpan elapsedTimeSinceLastFlightLoop, int counter) { m_api.Log.Log($"GraphicsTestPlugin: Entering TurnTheWheel flightloop"); var(x, y, z) = m_api.Graphics.WorldToLocal(47.437644, 19.259498, 0); var res = m_probe.ProbeTerrainXYZ((float)x, 0, (float)z); m_api.Log.Log($"Probed terrain, got result {res.LocationY} with code {res.Result}"); var(lat, lon, alt) = m_api.Graphics.LocalToWorld(res.LocationX, res.LocationY, res.LocationZ); int height = 0; foreach (var instance in m_testTugInstances) { instance.SetPosition(new XPDrawInfo((float)res.LocationX, (float)res.LocationY + (10 * height++), (float)res.LocationZ, (float)0, (float)0, (float)0), new float[] { m_tireAngle }); } m_tireAngle++; if (m_tireAngle > 45) { m_tireAngle -= 90; } m_api.Log.Log($"GraphicsTestPlugin: Leaving TurnTheWheel flightloop"); return(FlightLoopTime.FromCycles(1)); }
private int DrawingHook(XPLMDrawingPhase inPhase, int inIsBefore) { m_api.Log.Log("GraphicsTestPlugin: Entering drawing hook"); var(x, y, z) = m_api.Graphics.WorldToLocal(47.439444, 19.261944, 0); var res = m_probe.ProbeTerrainXYZ((float)x, 0, (float)z); m_api.Log.Log($"Probed terrain, got result {res.LocationY} with code {res.Result}"); var(lat, lon, alt) = m_api.Graphics.LocalToWorld(res.LocationX, res.LocationY, res.LocationZ); testTug.Draw(0, 0, new XPLMDrawInfo_t[] { new XPLMDrawInfo_t(res.LocationX, res.LocationY, res.LocationZ, 0.0f, 0.0f, 0.0f) }); return(1); }