TargetController#
- class MechJeb.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.
-
can_align:
boolean# Whether the vessel can align with the target, which it can with a docking port. Throws an exception if there is no target.
- Attribute:
Read-only, cannot be set
-
distance:
number# The distance to the target, in meters. Throws an exception if there is no target.
- Attribute:
Read-only, cannot be set
-
docking_axis:
Tuple# The world space docking axis of the target. Throws an exception if there is no target.
- Attribute:
Read-only, cannot be set
-
normal_target_exists:
boolean# Whether there is a target that is a vessel, a body or a direction target.
- Attribute:
Read-only, cannot be set
-
position:
Tuple# The world space position of the target. Throws an exception if there is no target.
- Attribute:
Read-only, cannot be set
-
position_target_exists:
boolean# Whether there is a target that is a position or a vessel.
- Attribute:
Read-only, cannot be set
-
relative_position:
Tuple# The world space position of the vessel relative to the target. Throws an exception if there is no target.
- Attribute:
Read-only, cannot be set
-
relative_velocity:
Tuple# The world space velocity of the vessel relative to the target, in \(\mathrm{m/s}\). Throws an exception if there is no target.
- Attribute:
Read-only, cannot be set
-
set_direction_target(name:
string)# Set the target to a direction.
- Parameters:
name – The name of the target.
Note
Set the direction with
MechJeb.TargetController:update_direction_target().
-
target_orbit:
SpaceCenter.Orbit# The orbit of the target. Throws an exception if there is no target, or the target has no orbit.
- Attribute:
Read-only, cannot be set
-
update_direction_target(direction:
Tuple)# Set the direction of the direction target.
- Parameters:
direction – The world space direction.
-
can_align: