public void OnFrameRender(Device device, double totalTime, float elapsedTime) { if (playing && startTime != -1) { if (!Framework.Instance.CurrentCamera.Reflected) { Vector3 p1; Vector3 p2; Vector3 p3; Vector3 p4 = new Vector3(0, 0.005f, 0); Program.Instance.Heightmap.GetPoints(airplaneModel.Position.X, airplaneModel.Position.Z, out p1, out p2, out p3); airplaneModel.OnRenderShadow(device, p1 + p4, p2 + p4, p3 + p4, new Vector3(0, -1, 0)); ripples.OnFrameRender(device, totalTime, elapsedTime); } airplaneModel.OnFrameRender(device, totalTime, elapsedTime); smoke.OnFrameRender(device, totalTime, elapsedTime); } }
/// <summary> /// Handles the FrameRender. /// </summary> /// <param name="device"></param> /// <param name="totalTime"></param> /// <param name="elapsedTime"></param> public void OnFrameRender(Device device, double totalTime, float elapsedTime) { if (!Framework.Instance.CurrentCamera.Reflected) { // Render the shadow (if not reflecting) Vector3 p1; Vector3 p2; Vector3 p3; Vector3 p4 = new Vector3(0, 0.005f, 0); heightmap.GetPoints(airplane.Position.X, airplane.Position.Z, out p1, out p2, out p3); airplane.OnRenderShadow(device, p1 + p4, p2 + p4, p3 + p4, new Vector3(0, -1, 0)); ripples.OnFrameRender(device, totalTime, elapsedTime); } //debugObject.OnFrameRender(device, totalTime, elapsedTime); if (iFlightModel.CableEnabled) { towLine.OnFrameRender(device, totalTime, elapsedTime); } //windVector.OnFrameRender(device, totalTime, elapsedTime); if (Framework.Instance.CurrentCamera.CameraModeName.Equals("cockpit")) { airplane.Visible = false; } else { airplane.Visible = true; } airplane.OnFrameRender(device, totalTime, elapsedTime); if (towing != null) { towing.OnFrameRender(device, totalTime, elapsedTime); } smoke.OnFrameRender(device, totalTime, elapsedTime); //normalObject.OnFrameRender(device, totalTime, elapsedTime); }