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.
- 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.
- double 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.
- double 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.
- 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.
- Burn addBurn(double ut, double prograde, double normal, double radial)#
Plan a burn, and add it to the vehicle’s burn plan.
- Parameters:
ut (
double) – Universal time of the burn, in seconds.prograde (
double) – Change in velocity in the prograde direction, in meters per second.normal (
double) – Change in velocity along the orbit normal, in meters per second.radial (
double) – 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().