.. default-domain:: java .. highlight:: java .. package:: krpc.client.services.MechJeb TargetController ================ .. type:: public class TargetController The target controller, which holds MechJeb's target. .. note:: Positions and directions are in world space, the coordinate system of the game's physics. .. method:: boolean getCanAlign() Whether the vessel can align with the target, which it can with a docking port. Throws an exception if there is no target. :Game Scenes: Flight .. method:: float getDistance() The distance to the target, in meters. Throws an exception if there is no target. :Game Scenes: Flight .. method:: org.javatuples.Triplet getDockingAxis() The world space docking axis of the target. Throws an exception if there is no target. :Game Scenes: Flight .. method:: boolean getNormalTargetExists() Whether there is a target that is a vessel, a body or a direction target. :Game Scenes: Flight .. method:: org.javatuples.Triplet getPosition() The world space position of the target. Throws an exception if there is no target. :Game Scenes: Flight .. method:: boolean getPositionTargetExists() Whether there is a target that is a position or a vessel. :Game Scenes: Flight .. method:: org.javatuples.Triplet getRelativePosition() The world space position of the vessel relative to the target. Throws an exception if there is no target. :Game Scenes: Flight .. method:: org.javatuples.Triplet getRelativeVelocity() The world space velocity of the vessel relative to the target, in :math:`\mathrm{m/s}`. Throws an exception if there is no target. :Game Scenes: Flight .. method:: void setDirectionTarget(String name) Set the target to a direction. :param String name: The name of the target. :Game Scenes: Flight .. note:: Set the direction with :meth:`TargetController.updateDirectionTarget(org.javatuples.Triplet)`. .. method:: SpaceCenter.Orbit getTargetOrbit() The orbit of the target. Throws an exception if there is no target, or the target has no orbit. :Game Scenes: Flight .. method:: void updateDirectionTarget(org.javatuples.Triplet direction) Set the direction of the direction target. :param org.javatuples.Triplet direction: The world space direction. :Game Scenes: Flight