Drawing

class Drawing : public krpc::Service

Provides functionality for drawing objects in the flight scene.

Drawing(krpc::Client *client)

Construct an instance of this service.

Line add_line(std::tuple<double, double, double> start, std::tuple<double, double, double> end, SpaceCenter::ReferenceFrame reference_frame, bool visible = true)

Draw a line in the scene.

Parameters:
  • start – Position of the start of the line.

  • end – Position of the end of the line.

  • reference_frame – Reference frame that the positions are in.

  • visible – Whether the line is visible.

Game Scenes:

Flight

Line add_direction(std::tuple<double, double, double> direction, SpaceCenter::ReferenceFrame reference_frame, float length = 10.0, bool visible = true)

Draw a direction vector in the scene, starting from the origin of the given reference frame.

Parameters:
  • direction – Direction to draw the line in.

  • reference_frame – Reference frame that the direction is in and defines the start position.

  • length – The length of the line.

  • visible – Whether the line is visible.

Game Scenes:

Flight

Line add_direction_from_com(std::tuple<double, double, double> direction, SpaceCenter::ReferenceFrame reference_frame, float length = 10.0, bool visible = true)

Draw a direction vector in the scene, from the center of mass of the active vessel.

Parameters:
  • direction – Direction to draw the line in.

  • reference_frame – Reference frame that the direction is in.

  • length – The length of the line.

  • visible – Whether the line is visible.

Game Scenes:

Flight

Polygon add_polygon(std::vector<std::tuple<double, double, double>> vertices, SpaceCenter::ReferenceFrame reference_frame, bool visible = true)

Draw a polygon in the scene, defined by a list of vertices.

Parameters:
  • vertices – Vertices of the polygon.

  • reference_frame – Reference frame that the vertices are in.

  • visible – Whether the polygon is visible.

Game Scenes:

Flight

Text add_text(std::string text, SpaceCenter::ReferenceFrame reference_frame, std::tuple<double, double, double> position, std::tuple<double, double, double, double> rotation, bool visible = true)

Draw text in the scene.

Parameters:
  • text – The string to draw.

  • reference_frame – Reference frame that the text position is in.

  • position – Position of the text.

  • rotation – Rotation of the text, as a quaternion.

  • visible – Whether the text is visible.

Game Scenes:

Flight

void clear(bool client_only = false)

Remove all objects being drawn.

Parameters:
  • client_only – If true, only remove objects created by the calling client.

Game Scenes:

Flight