Camera#

Camera

Controls the game’s camera. Obtained by calling GET /space-center/camera.

A Camera object is passed and returned as its identifier, a number. A path that acts on an object takes it as (id).

GET /space-center/camera/(id)/mode#

The current mode of the camera.

Note

Setting the mode to "iva" throws an exception if the active vessel has no crew, or none of its crew can be viewed in an interior.

Parameters:
  • id – The identifier of the Camera object.

Response JSON Object:
  • value (SpaceCenter.CameraMode)

PUT /space-center/camera/(id)/mode#

The current mode of the camera.

Note

Setting the mode to "iva" throws an exception if the active vessel has no crew, or none of its crew can be viewed in an interior.

Parameters:
  • id – The identifier of the Camera object.

Request JSON Object:
  • value (SpaceCenter.CameraMode) – The new value.

POST /space-center/camera/(id)/next-camera#

Switch to the next available camera. In flight, this moves to the next flight camera mode. In IVA, it moves the view to the next crew member in the active vessel.

Parameters:
  • id – The identifier of the Camera object.

POST /space-center/camera/(id)/previous-camera#

Switch to the previous available camera. In flight, this moves to the previous flight camera mode. In IVA, it moves the view to the previous crew member in the active vessel.

Parameters:
  • id – The identifier of the Camera object.

GET /space-center/camera/(id)/pitch#

The pitch of the camera, in degrees. A value between GET /space-center/camera/(id)/min-pitch and GET /space-center/camera/(id)/max-pitch

Parameters:
  • id – The identifier of the Camera object.

Response JSON Object:
  • value (float)

PUT /space-center/camera/(id)/pitch#

The pitch of the camera, in degrees. A value between GET /space-center/camera/(id)/min-pitch and GET /space-center/camera/(id)/max-pitch

Parameters:
  • id – The identifier of the Camera object.

Request JSON Object:
  • value (float) – The new value.

GET /space-center/camera/(id)/heading#

The heading of the camera, in degrees.

Parameters:
  • id – The identifier of the Camera object.

Response JSON Object:
  • value (float)

PUT /space-center/camera/(id)/heading#

The heading of the camera, in degrees.

Parameters:
  • id – The identifier of the Camera object.

Request JSON Object:
  • value (float) – The new value.

GET /space-center/camera/(id)/distance#

The distance from the camera to the subject, in meters. A value between GET /space-center/camera/(id)/min-distance and GET /space-center/camera/(id)/max-distance.

Parameters:
  • id – The identifier of the Camera object.

Response JSON Object:
  • value (float)

PUT /space-center/camera/(id)/distance#

The distance from the camera to the subject, in meters. A value between GET /space-center/camera/(id)/min-distance and GET /space-center/camera/(id)/max-distance.

Parameters:
  • id – The identifier of the Camera object.

Request JSON Object:
  • value (float) – The new value.

GET /space-center/camera/(id)/fov#

The Field of View of the camera, in degrees. A value between GET /space-center/camera/(id)/min-fov and GET /space-center/camera/(id)/max-fov.

Parameters:
  • id – The identifier of the Camera object.

Response JSON Object:
  • value (float)

PUT /space-center/camera/(id)/fov#

The Field of View of the camera, in degrees. A value between GET /space-center/camera/(id)/min-fov and GET /space-center/camera/(id)/max-fov.

Parameters:
  • id – The identifier of the Camera object.

Request JSON Object:
  • value (float) – The new value.

GET /space-center/camera/(id)/min-pitch#

The minimum pitch of the camera.

Parameters:
  • id – The identifier of the Camera object.

Response JSON Object:
  • value (float)

GET /space-center/camera/(id)/max-pitch#

The maximum pitch of the camera.

Parameters:
  • id – The identifier of the Camera object.

Response JSON Object:
  • value (float)

GET /space-center/camera/(id)/min-distance#

Minimum distance from the camera to the subject, in meters.

Parameters:
  • id – The identifier of the Camera object.

Response JSON Object:
  • value (float)

GET /space-center/camera/(id)/max-distance#

Maximum distance from the camera to the subject, in meters.

Parameters:
  • id – The identifier of the Camera object.

Response JSON Object:
  • value (float)

GET /space-center/camera/(id)/min-fov#

The minimum field of view the camera in degrees.

Parameters:
  • id – The identifier of the Camera object.

Response JSON Object:
  • value (float)

GET /space-center/camera/(id)/max-fov#

The maximum field of view the camera in degrees.

Parameters:
  • id – The identifier of the Camera object.

Response JSON Object:
  • value (float)

GET /space-center/camera/(id)/default-distance#

Default distance from the camera to the subject, in meters.

Parameters:
  • id – The identifier of the Camera object.

Response JSON Object:
  • value (float)

GET /space-center/camera/(id)/default-fov#

The default field of view the camera in degrees.

Parameters:
  • id – The identifier of the Camera object.

Response JSON Object:
  • value (float)

GET /space-center/camera/(id)/focussed-body#

In map mode, the celestial body that the camera is focussed on. Returns null if the camera is not focussed on a celestial body. Throws KRPC.InvalidOperationException if the camera is not in map mode.

Parameters:
  • id – The identifier of the Camera object.

Response JSON Object:
  • value (SpaceCenter.CelestialBody?)

PUT /space-center/camera/(id)/focussed-body#

In map mode, the celestial body that the camera is focussed on. Returns null if the camera is not focussed on a celestial body. Throws KRPC.InvalidOperationException if the camera is not in map mode.

Parameters:
  • id – The identifier of the Camera object.

Request JSON Object:
  • value (SpaceCenter.CelestialBody?) – The new value.

GET /space-center/camera/(id)/focussed-vessel#

In map mode, the vessel that the camera is focussed on. Returns null if the camera is not focussed on a vessel. Throws KRPC.InvalidOperationException if the camera is not in map mode.

Parameters:
  • id – The identifier of the Camera object.

Response JSON Object:
  • value (SpaceCenter.Vessel?)

PUT /space-center/camera/(id)/focussed-vessel#

In map mode, the vessel that the camera is focussed on. Returns null if the camera is not focussed on a vessel. Throws KRPC.InvalidOperationException if the camera is not in map mode.

Parameters:
  • id – The identifier of the Camera object.

Request JSON Object:
  • value (SpaceCenter.Vessel?) – The new value.

GET /space-center/camera/(id)/focussed-node#

In map mode, the maneuver node that the camera is focussed on. Returns null if the camera is not focussed on a maneuver node. Throws KRPC.InvalidOperationException if the camera is not in map mode.

Parameters:
  • id – The identifier of the Camera object.

Response JSON Object:
  • value (SpaceCenter.Node?)

PUT /space-center/camera/(id)/focussed-node#

In map mode, the maneuver node that the camera is focussed on. Returns null if the camera is not focussed on a maneuver node. Throws KRPC.InvalidOperationException if the camera is not in map mode.

Parameters:
  • id – The identifier of the Camera object.

Request JSON Object:
  • value (SpaceCenter.Node?) – The new value.

GET /space-center/camera/(id)/focussed-crew-member#

In IVA mode, the crew member whose view the camera is showing. Returns null if no crew member is in view. Throws KRPC.InvalidOperationException if the camera is not in IVA mode. Setting this moves the view to the given crew member, switching the camera to IVA mode if it is not already. The crew member must be in the active vessel, and in a part whose interior the game has placed them in.

Parameters:
  • id – The identifier of the Camera object.

Response JSON Object:
  • value (SpaceCenter.CrewMember?)

PUT /space-center/camera/(id)/focussed-crew-member#

In IVA mode, the crew member whose view the camera is showing. Returns null if no crew member is in view. Throws KRPC.InvalidOperationException if the camera is not in IVA mode. Setting this moves the view to the given crew member, switching the camera to IVA mode if it is not already. The crew member must be in the active vessel, and in a part whose interior the game has placed them in.

Parameters:
  • id – The identifier of the Camera object.

Request JSON Object:
  • value (SpaceCenter.CrewMember?) – The new value.

CameraMode

See GET /space-center/camera/(id)/mode.

Passed and returned as the name of one of its values:

"automatic"

The camera is showing the active vessel, in “auto” mode.

"free"

The camera is showing the active vessel, in “free” mode.

"chase"

The camera is showing the active vessel, in “chase” mode.

"locked"

The camera is showing the active vessel, in “locked” mode.

"orbital"

The camera is showing the active vessel, in “orbital” mode.

"iva"

The Intra-Vehicular Activity view is being shown.

"map"

The map view is being shown.