.. default-domain:: cs .. highlight:: csharp .. namespace:: KRPC.Client.Services.MechJeb TargetController ================ .. 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. .. property:: bool CanAlign { get; } 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 .. property:: float Distance { get; } The distance to the target, in meters. Throws an exception if there is no target. :Game Scenes: Flight .. property:: System.Tuple DockingAxis { get; } The world space docking axis of the target. Throws an exception if there is no target. :Game Scenes: Flight .. property:: bool NormalTargetExists { get; } Whether there is a target that is a vessel, a body or a direction target. :Game Scenes: Flight .. property:: System.Tuple Position { get; } The world space position of the target. Throws an exception if there is no target. :Game Scenes: Flight .. property:: bool PositionTargetExists { get; } Whether there is a target that is a position or a vessel. :Game Scenes: Flight .. property:: System.Tuple RelativePosition { get; } The world space position of the vessel relative to the target. Throws an exception if there is no target. :Game Scenes: Flight .. property:: System.Tuple RelativeVelocity { get; } 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 .. function:: void SetDirectionTarget(string name) Set the target to a direction. :parameters: * **name** -- The name of the target. :Game Scenes: Flight .. note:: Set the direction with :meth:`TargetController.UpdateDirectionTarget`. .. property:: SpaceCenter.Orbit TargetOrbit { get; } The orbit of the target. Throws an exception if there is no target, or the target has no orbit. :Game Scenes: Flight .. function:: void UpdateDirectionTarget(System.Tuple direction) Set the direction of the direction target. :parameters: * **direction** -- The world space direction. :Game Scenes: Flight