Drawing

public class Drawing

Provides functionality for drawing objects in the flight scene.

Line addLine(org.javatuples.Triplet<Double, Double, Double> start, org.javatuples.Triplet<Double, Double, Double> end, SpaceCenter.ReferenceFrame referenceFrame, boolean visible)

Draw a line in the scene.

Parameters:
  • start (org.javatuples.Triplet) – Position of the start of the line.

  • end (org.javatuples.Triplet) – Position of the end of the line.

  • referenceFrame (SpaceCenter.ReferenceFrame) – Reference frame that the positions are in.

  • visible (boolean) – Whether the line is visible.

Game Scenes:

Flight

Line addDirection(org.javatuples.Triplet<Double, Double, Double> direction, SpaceCenter.ReferenceFrame referenceFrame, float length, boolean visible)

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

Parameters:
  • direction (org.javatuples.Triplet) – Direction to draw the line in.

  • referenceFrame (SpaceCenter.ReferenceFrame) – Reference frame that the direction is in and defines the start position.

  • length (float) – The length of the line.

  • visible (boolean) – Whether the line is visible.

Game Scenes:

Flight

Line addDirectionFromCom(org.javatuples.Triplet<Double, Double, Double> direction, SpaceCenter.ReferenceFrame referenceFrame, float length, boolean visible)

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

Parameters:
  • direction (org.javatuples.Triplet) – Direction to draw the line in.

  • referenceFrame (SpaceCenter.ReferenceFrame) – Reference frame that the direction is in.

  • length (float) – The length of the line.

  • visible (boolean) – Whether the line is visible.

Game Scenes:

Flight

Polygon addPolygon(java.util.List<org.javatuples.Triplet<Double, Double, Double>> vertices, SpaceCenter.ReferenceFrame referenceFrame, boolean visible)

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

Parameters:
  • vertices (java.util.List) – Vertices of the polygon.

  • referenceFrame (SpaceCenter.ReferenceFrame) – Reference frame that the vertices are in.

  • visible (boolean) – Whether the polygon is visible.

Game Scenes:

Flight

Text addText(String text, SpaceCenter.ReferenceFrame referenceFrame, org.javatuples.Triplet<Double, Double, Double> position, org.javatuples.Quartet<Double, Double, Double, Double> rotation, boolean visible)

Draw text in the scene.

Parameters:
  • text (String) – The string to draw.

  • referenceFrame (SpaceCenter.ReferenceFrame) – Reference frame that the text position is in.

  • position (org.javatuples.Triplet) – Position of the text.

  • rotation (org.javatuples.Quartet) – Rotation of the text, as a quaternion.

  • visible (boolean) – Whether the text is visible.

Game Scenes:

Flight

void clear(boolean clientOnly)

Remove all objects being drawn.

Parameters:
  • clientOnly (boolean) – If true, only remove objects created by the calling client.

Game Scenes:

Flight