Vehicle#
- public class Vehicle#
A vehicle in the current system. Obtained from
getActiveVehicle()orgetVehicles().Note
Docking and undocking replace the vehicles involved, so an object for one of them throws an exception afterwards.
- void destroy()#
Destroy the vehicle, killing its crew, as abandoning the vehicle does. Returns once the vehicle is gone.
Note
If the vehicle is the active vehicle, the game hands control to a nearby vehicle.
- boolean getCanRecover()#
Whether the vehicle can be recovered: at rest on the surface of the home planet.
- void recover()#
Recover the vehicle, ending its crew’s missions, as the game’s recover button does. Returns once the vehicle is gone.
Note
Throws an exception if the vehicle cannot be recovered, see
Vehicle.getCanRecover().
- boolean getOnRails()#
Whether the game moves the vehicle without simulating the forces on it: along its orbit, or held on the surface. True in the freefall, landed, floating and bottomed situations.
- boolean getIsDebris()#
Whether the vehicle is debris, such as a spent stage.
- boolean getHasLaunched()#
Whether the vehicle has launched.
- double getLaunchTime()#
The universal time the vehicle was created, in seconds.
- float getMass()#
The total mass of the vehicle, including propellant, in kilograms.
- float getPropellantMass()#
The mass of the propellant in the vehicle, in kilograms.
- float getThrust()#
The thrust of the engines at their current throttle and the current atmospheric pressure, in Newtons.
- float getAvailableThrust()#
The thrust of the active engines that have propellant, at full throttle and the current atmospheric pressure, in Newtons.
- float getSpecificImpulse()#
The combined specific impulse of the active engines that have propellant, at the current atmospheric pressure, in seconds. Zero when no engine is active.
- float getPeakGLoad()#
The highest smoothed g-load on the vehicle during the last physics step, as a multiple of standard gravity. Zero while the vehicle is
Vehicle.getOnRails().
- float getMaxGLoad()#
The g-load the vehicle can take before it breaks up, as a multiple of standard gravity. Zero while the vehicle is
Vehicle.getOnRails().
- float getPeakDynamicPressure()#
The highest dynamic pressure on the vehicle during the last physics step, in pascals. In the sea, this is the dynamic pressure of the water. Zero while the vehicle is
Vehicle.getOnRails().
- float getMaxDynamicPressure()#
The dynamic pressure the vehicle can take before it breaks up, in pascals. Zero while the vehicle is
Vehicle.getOnRails().
- java.util.List<Part> partsWithName(String name)#
The vehicle’s parts with the given template id. See
Part.getName().- Parameters:
name (
String) – The template id.
- int getCrewCapacity()#
The number of crew seats in the vehicle.
- java.util.List<SolarPanel> getSolarPanels()#
The vehicle’s solar panels.
- java.util.List<PowerConsumer> getPowerConsumers()#
The vehicle’s power consumers.
- float getStoredEnergy()#
The energy stored in the vehicle’s batteries, in joules.
- float getEnergyCapacity()#
The energy the vehicle’s batteries can store, in joules.
- float getNetPower()#
The power produced by the vehicle’s solar panels and generators, less the power its parts use, in watts.
- java.util.List<Deployable> getDeployables()#
The vehicle’s deployable sections.
- java.util.List<MagneticScoop> getMagneticScoops()#
The vehicle’s magnetic scoops.
- java.util.List<DockingPort> getDockingPorts()#
The vehicle’s docking ports.
- java.util.List<Resource> getResources()#
The resources the vehicle holds, one for each substance, totaled over its parts.
- float getDeltaV()#
The change in velocity of all the vehicle’s sequences, in meters per second.
- void setTargetVehicle(Vehicle value)#
The vehicle targeted by this vehicle, or
null. Setting it replaces the target, andnullclears it.
- void setTargetBody(Body value)#
The body targeted by this vehicle, or
null. Setting it replaces the target, andnullclears it.Note
Setting a body that orbits nothing, such as the star, throws an exception.
- void setTargetPart(Part value)#
The part targeted by this vehicle, on the vehicle in
Vehicle.getTargetVehicle(), ornull. Setting it targets the part and its vehicle, andnullclears the target.
- Burn addBurn(double ut, float prograde, float normal, float radial)#
Plan a burn, and add it to the vehicle’s burn plan.
- Parameters:
ut (
double) – Universal time of the burn, in seconds.prograde (
float) – Change in velocity in the prograde direction, in meters per second.normal (
float) – Change in velocity along the orbit normal, in meters per second.radial (
float) – Change in velocity radially outward, in meters per second.
- Returns:
The burn.
Note
Returns once the flight computer has timed the burn, if it is the next one. Throws an exception if the time is in the past, or beyond the vehicle’s predicted trajectory.
- Flight getFlight()#
Flight telemetry for the vehicle, relative to the surface of the body it orbits.
- Game Scenes:
Flight
- ReferenceFrame getReferenceFrame()#
The reference frame fixed to the vehicle, with its origin at the vehicle’s position. The x axis points forward, the y axis to the right and the z axis down, relative to the vehicle’s control point.
- ReferenceFrame getSurfaceReferenceFrame()#
The reference frame with its origin at the vehicle’s position, and axes aligned with the surface below it. The x axis points east, the y axis north and the z axis up. The frame rotates with the body.
- ReferenceFrame getOrbitalReferenceFrame()#
The reference frame with its origin at the vehicle’s position, and axes aligned with its orbit. The x axis points prograde, the y axis along the orbit normal and the z axis radially outward, perpendicular to the x axis.
- org.javatuples.Triplet<Double, Double, Double> position(ReferenceFrame referenceFrame)#
The position of the vehicle, in meters.
- Parameters:
referenceFrame (
ReferenceFrame) – The reference frame of the position.
- org.javatuples.Triplet<Double, Double, Double> velocity(ReferenceFrame referenceFrame)#
The velocity of the vehicle, in meters per second.
- Parameters:
referenceFrame (
ReferenceFrame) – The reference frame of the velocity.
- org.javatuples.Triplet<Double, Double, Double> direction(ReferenceFrame referenceFrame)#
The unit vector in which the vehicle points, the x axis of
Vehicle.getReferenceFrame().- Parameters:
referenceFrame (
ReferenceFrame) – The reference frame of the direction.
- org.javatuples.Quartet<Double, Double, Double, Double> rotation(ReferenceFrame referenceFrame)#
The rotation of
Vehicle.getReferenceFrame()relative to the given frame.- Parameters:
referenceFrame (
ReferenceFrame) – The reference frame of the rotation.
- org.javatuples.Triplet<Double, Double, Double> angularVelocity(ReferenceFrame referenceFrame)#
The angular velocity of the vehicle, in radians per second. The vector points along the axis of rotation, and its length is the rate of rotation.
- Parameters:
referenceFrame (
ReferenceFrame) – The reference frame of the angular velocity.
- public enum Situation#
The situation of a vehicle: its contact with the surface, and whether the game is simulating it with physics or propagating it along its orbit. See
Vehicle.getSituation().
- public class VehicleDesign#
A vehicle design that can be launched: one of the game’s default vehicles, or a vehicle saved by the player in the editor. Obtained from
getVehicleDesigns().Note
The mass and delta-v are those the editor shows for the design.
- String getName()#
The name of the design, as passed to
launchVehicle(String, String).
- boolean getIsDefault()#
Whether the design is one of the game’s default vehicles.
- int getPartCount()#
The number of parts in the design.
- float getMass()#
The total mass of the design, including propellant, in kilograms.
- float getDryMass()#
The mass of the design without propellant, in kilograms.
- float getDeltaV()#
The change in velocity of all the design’s sequences, in meters per second.
Note
Each sequence is computed in the environment chosen for it in the editor, in vacuum or at sea level.