Drawing#

public class Drawing#

Draws lines, shapes and text in the scene, each placed in a reference frame.

Note

The objects are drawn every frame until removed, and are removed when the client that added them disconnects. Lines are drawn at the game’s fixed gizmo width.

static Line addLine(Connection connection, org.javatuples.Triplet<Double, Double, Double> start, org.javatuples.Triplet<Double, Double, Double> end, ReferenceFrame referenceFrame, boolean visible)#

Draw a line between two positions.

Parameters:
  • start (org.javatuples.Triplet) – The position of the start of the line, in meters.

  • end (org.javatuples.Triplet) – The position of the end of the line, in meters.

  • referenceFrame (ReferenceFrame) – The reference frame of the positions.

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

static Line addDirection(Connection connection, org.javatuples.Triplet<Double, Double, Double> direction, ReferenceFrame referenceFrame, float length, boolean visible)#

Draw a line from the origin of a reference frame in a direction.

Parameters:
  • direction (org.javatuples.Triplet) – The direction of the line.

  • referenceFrame (ReferenceFrame) – The reference frame of the direction.

  • length (float) – The length of the line, in meters.

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

static Polyline addPolyline(Connection connection, java.util.List<org.javatuples.Triplet<Double, Double, Double>> vertices, ReferenceFrame referenceFrame, boolean closed, boolean visible)#

Draw a line through a list of positions.

Parameters:
  • vertices (java.util.List) – The positions the line passes through, in meters.

  • referenceFrame (ReferenceFrame) – The reference frame of the positions.

  • closed (boolean) – Whether the line joins the last position back to the first.

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

static Circle addCircle(Connection connection, org.javatuples.Triplet<Double, Double, Double> center, org.javatuples.Triplet<Double, Double, Double> normal, float radius, ReferenceFrame referenceFrame, boolean visible)#

Draw a circle.

Parameters:
  • center (org.javatuples.Triplet) – The position of the center of the circle, in meters.

  • normal (org.javatuples.Triplet) – The direction normal to the plane of the circle.

  • radius (float) – The radius of the circle, in meters.

  • referenceFrame (ReferenceFrame) – The reference frame of the position and direction.

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

static Arc addArc(Connection connection, org.javatuples.Triplet<Double, Double, Double> center, org.javatuples.Triplet<Double, Double, Double> normal, org.javatuples.Triplet<Double, Double, Double> startDirection, float angle, float radius, ReferenceFrame referenceFrame, boolean visible)#

Draw an arc of a circle.

Parameters:
  • center (org.javatuples.Triplet) – The position of the center of the arc’s circle, in meters.

  • normal (org.javatuples.Triplet) – The direction normal to the plane of the arc.

  • startDirection (org.javatuples.Triplet) – The direction from the center to the start of the arc.

  • angle (float) – The angle the arc turns through, counterclockwise about the normal, in radians.

  • radius (float) – The radius of the arc, in meters.

  • referenceFrame (ReferenceFrame) – The reference frame of the position and directions.

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

static Box addBox(Connection connection, org.javatuples.Triplet<Double, Double, Double> center, org.javatuples.Triplet<Double, Double, Double> size, org.javatuples.Quartet<Double, Double, Double, Double> rotation, ReferenceFrame referenceFrame, boolean visible)#

Draw the edges of a box.

Parameters:
  • center (org.javatuples.Triplet) – The position of the center of the box, in meters.

  • size (org.javatuples.Triplet) – The lengths of the box’s edges along its x, y and z axes, in meters.

  • rotation (org.javatuples.Quartet) – The rotation of the box’s axes, as a quaternion of the form (x, y, z, w).

  • referenceFrame (ReferenceFrame) – The reference frame of the position and rotation.

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

static Sphere addSphere(Connection connection, org.javatuples.Triplet<Double, Double, Double> center, float radius, ReferenceFrame referenceFrame, boolean visible)#

Draw a solid sphere.

Parameters:
  • center (org.javatuples.Triplet) – The position of the center of the sphere, in meters.

  • radius (float) – The radius of the sphere, in meters.

  • referenceFrame (ReferenceFrame) – The reference frame of the position.

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

static Text addText(Connection connection, String text, org.javatuples.Triplet<Double, Double, Double> position, ReferenceFrame referenceFrame, float size, boolean visible)#

Draw text over the scene, centered on a position.

Parameters:
  • text (String) – The text.

  • position (org.javatuples.Triplet) – The position of the center of the text, in meters.

  • referenceFrame (ReferenceFrame) – The reference frame of the position.

  • size (float) – The height of the font, in pixels.

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

static void clear(Connection connection, boolean clientOnly)#

Remove the drawing objects.

Parameters:
  • clientOnly (boolean) – Whether to remove only the objects added by the calling client.

public class Line#

A line. Created using Drawing.addLine(org.javatuples.Triplet<Double,Double,Double>, org.javatuples.Triplet<Double,Double,Double>, ReferenceFrame, boolean) or Drawing.addDirection(org.javatuples.Triplet<Double,Double,Double>, ReferenceFrame, float, boolean).

org.javatuples.Triplet<Double, Double, Double> getStart()#
void setStart(org.javatuples.Triplet<Double, Double, Double> value)#

The start position of the line, in meters.

org.javatuples.Triplet<Double, Double, Double> getEnd()#
void setEnd(org.javatuples.Triplet<Double, Double, Double> value)#

The end position of the line, in meters.

ReferenceFrame getReferenceFrame()#
void setReferenceFrame(ReferenceFrame value)#

The reference frame for the positions and directions of the object.

boolean getVisible()#
void setVisible(boolean value)#

Whether the object is visible.

StdLib.ColorRGB getColor()#
void setColor(StdLib.ColorRGB value)#

The color of the object, as an RGB triple with components from 0 to 1.

void remove()#

Remove the object.

public class Polyline#

A line through a list of points. Created using Drawing.addPolyline(java.util.List<org.javatuples.Triplet<Double,Double,Double>>, ReferenceFrame, boolean, boolean).

java.util.List<org.javatuples.Triplet<Double, Double, Double>> getVertices()#
void setVertices(java.util.List<org.javatuples.Triplet<Double, Double, Double>> value)#

The points the line passes through, in meters.

boolean getClosed()#
void setClosed(boolean value)#

Whether the line joins the last point back to the first.

ReferenceFrame getReferenceFrame()#
void setReferenceFrame(ReferenceFrame value)#

The reference frame for the positions and directions of the object.

boolean getVisible()#
void setVisible(boolean value)#

Whether the object is visible.

StdLib.ColorRGB getColor()#
void setColor(StdLib.ColorRGB value)#

The color of the object, as an RGB triple with components from 0 to 1.

void remove()#

Remove the object.

public class Circle#

A circle. Created using Drawing.addCircle(org.javatuples.Triplet<Double,Double,Double>, org.javatuples.Triplet<Double,Double,Double>, float, ReferenceFrame, boolean).

org.javatuples.Triplet<Double, Double, Double> getCenter()#
void setCenter(org.javatuples.Triplet<Double, Double, Double> value)#

The position of the center of the circle, in meters.

org.javatuples.Triplet<Double, Double, Double> getNormal()#
void setNormal(org.javatuples.Triplet<Double, Double, Double> value)#

The direction normal to the plane of the circle, as a unit vector.

float getRadius()#
void setRadius(float value)#

The radius of the circle, in meters.

ReferenceFrame getReferenceFrame()#
void setReferenceFrame(ReferenceFrame value)#

The reference frame for the positions and directions of the object.

boolean getVisible()#
void setVisible(boolean value)#

Whether the object is visible.

StdLib.ColorRGB getColor()#
void setColor(StdLib.ColorRGB value)#

The color of the object, as an RGB triple with components from 0 to 1.

void remove()#

Remove the object.

public class Arc#

An arc of a circle. Created using Drawing.addArc(org.javatuples.Triplet<Double,Double,Double>, org.javatuples.Triplet<Double,Double,Double>, org.javatuples.Triplet<Double,Double,Double>, float, float, ReferenceFrame, boolean).

org.javatuples.Triplet<Double, Double, Double> getCenter()#
void setCenter(org.javatuples.Triplet<Double, Double, Double> value)#

The position of the center of the arc’s circle, in meters.

org.javatuples.Triplet<Double, Double, Double> getNormal()#
void setNormal(org.javatuples.Triplet<Double, Double, Double> value)#

The direction normal to the plane of the arc, as a unit vector.

org.javatuples.Triplet<Double, Double, Double> getStartDirection()#
void setStartDirection(org.javatuples.Triplet<Double, Double, Double> value)#

The direction from the center to the start of the arc, as a unit vector.

Note

The part of the direction along Arc.getNormal() is ignored.

float getAngle()#
void setAngle(float value)#

The angle the arc turns through, counterclockwise about Arc.getNormal(), in radians.

float getRadius()#
void setRadius(float value)#

The radius of the arc, in meters.

ReferenceFrame getReferenceFrame()#
void setReferenceFrame(ReferenceFrame value)#

The reference frame for the positions and directions of the object.

boolean getVisible()#
void setVisible(boolean value)#

Whether the object is visible.

StdLib.ColorRGB getColor()#
void setColor(StdLib.ColorRGB value)#

The color of the object, as an RGB triple with components from 0 to 1.

void remove()#

Remove the object.

public class Box#

The edges of a box. Created using Drawing.addBox(org.javatuples.Triplet<Double,Double,Double>, org.javatuples.Triplet<Double,Double,Double>, org.javatuples.Quartet<Double,Double,Double,Double>, ReferenceFrame, boolean).

org.javatuples.Triplet<Double, Double, Double> getCenter()#
void setCenter(org.javatuples.Triplet<Double, Double, Double> value)#

The position of the center of the box, in meters.

org.javatuples.Triplet<Double, Double, Double> getSize()#
void setSize(org.javatuples.Triplet<Double, Double, Double> value)#

The lengths of the box’s edges along its x, y and z axes, in meters.

org.javatuples.Quartet<Double, Double, Double, Double> getRotation()#
void setRotation(org.javatuples.Quartet<Double, Double, Double, Double> value)#

The rotation of the box’s axes, as a quaternion of the form (x, y, z, w).

ReferenceFrame getReferenceFrame()#
void setReferenceFrame(ReferenceFrame value)#

The reference frame for the positions and directions of the object.

boolean getVisible()#
void setVisible(boolean value)#

Whether the object is visible.

StdLib.ColorRGB getColor()#
void setColor(StdLib.ColorRGB value)#

The color of the object, as an RGB triple with components from 0 to 1.

void remove()#

Remove the object.

public class Sphere#

A solid sphere. Created using Drawing.addSphere(org.javatuples.Triplet<Double,Double,Double>, float, ReferenceFrame, boolean).

org.javatuples.Triplet<Double, Double, Double> getCenter()#
void setCenter(org.javatuples.Triplet<Double, Double, Double> value)#

The position of the center of the sphere, in meters.

float getRadius()#
void setRadius(float value)#

The radius of the sphere, in meters.

ReferenceFrame getReferenceFrame()#
void setReferenceFrame(ReferenceFrame value)#

The reference frame for the positions and directions of the object.

boolean getVisible()#
void setVisible(boolean value)#

Whether the object is visible.

StdLib.ColorRGB getColor()#
void setColor(StdLib.ColorRGB value)#

The color of the object, as an RGB triple with components from 0 to 1.

void remove()#

Remove the object.

public class Text#

Text drawn over the scene, centered on a position. Created using Drawing.addText(String, org.javatuples.Triplet<Double,Double,Double>, ReferenceFrame, float, boolean).

Note

The text is hidden with the game’s UI.

String getContent()#
void setContent(String value)#

The text.

org.javatuples.Triplet<Double, Double, Double> getPosition()#
void setPosition(org.javatuples.Triplet<Double, Double, Double> value)#

The position of the center of the text, in meters.

float getSize()#
void setSize(float value)#

The height of the font, in pixels.

ReferenceFrame getReferenceFrame()#
void setReferenceFrame(ReferenceFrame value)#

The reference frame for the positions and directions of the object.

boolean getVisible()#
void setVisible(boolean value)#

Whether the object is visible.

StdLib.ColorRGB getColor()#
void setColor(StdLib.ColorRGB value)#

The color of the object, as an RGB triple with components from 0 to 1.

void remove()#

Remove the object.