Drawing#

Provides functionality for drawing objects in the flight scene, the map view, the editor and the tracking station.

Example#

The following example draws a line from the center of mass of the active vessel, along the direction it points. The server removes a client’s drawings when the client disconnects, so the example waits 10 seconds before it exits:

#include <chrono>
#include <krpc.hpp>
#include <krpc/services/drawing.hpp>
#include <krpc/services/space_center.hpp>
#include <thread>
#include <tuple>

int main() {
  auto conn = krpc::connect("Drawing Example");
  krpc::services::SpaceCenter space_center(conn);
  krpc::services::Drawing drawing(conn);
  auto vessel = space_center.active_vessel().value();
  drawing.add_direction_from_com(std::make_tuple(0, 1, 0),
                                 vessel.reference_frame());
  std::this_thread::sleep_for(std::chrono::seconds(10));
}