Dijelite putem


Camera Configuration

Camera Configuration

Overview

This document describes the camera extensibility features of ESP. The camera system is highly customizable and extensible, enabling add-on providers to create interesting and useful views. There is a distinction between the view system and the camera system. The view system manages the 3D windowing system by tracking the active window, processing keyboard and mouse input and providing methods for opening new windows, selecting windows, etc. The camera system defines what appears in each view window.

See Also

Table of Contents

  • Overview
  • Camera Configuration File Format
  • Camera Definitions
  • Dynamic Head Movement
  • Examples

Camera Configuration File Format

Default camera definitions are data driven based on text configuration files. These files contain one or more sections—one for each camera definition. Each section contains parameter definitions for the camera.

Global Cameras

The simulation loads a set of global camera definitions from CAMERAS.CFG located in the user’s application data folder (%APPDATA%\Microsoft\ESP). This file is copied from the ESP root folder the first time a new user launches ESP or whenever the file cannot be found in the application data folder (if it was deleted or moved).

Aircraft Cameras

Aircraft can have cameras that are unique to them. For example, an airliner with complicated landing gear might define a “belly camera” that provides a close up view of the gear extension/retraction process. Aircraft cameras are defined in the AIRCRAFT.CFG (or SIM.CFG) file for the aircraft using the same format. Refer to the Aircraft Configuration Files documentation.

Each time a user loads an aircraft the existing aircraft cameras are removed from the camera system and any cameras defined for the selected aircraft are added.

Flight/Mission Cameras

You can also define cameras that specific to a flight or mission. As with aircraft cameras these are defined in the .FLT file using the same definition format. When a user loads a flight or mission any existing flight-specific cameras are removed and new ones are added. Refer to the Mission Creationdocumentation.

Camera Definitions

[cameradefinition.n]

This section describes the parameters that make up camera definitions. Almost all parameters are optional with reasonable defaults (shown in bold, or given if numeric), only Title and Guid are required.

title String Camera title; appears in the upper-right corner of the view window when changing cameras. Cockpit( Title = Cockpit )
Virtual Cockpit( Title = Virtual Cockpit )
Spot( Title = Spot )
Locked Spot( Title = Locked Spot )
FlyBy( Title = FlyBy )
Top-Down( Title = Top-Down )
Nearest Tower( Title = Nearest Tower )
Facilities Tower( Title = Facilities Tower )
Facilities Runway( Title = Facilities Runway )
AI Planes( Title = AI Planes )
Multiplayer Planes( Title = Multiplayer Planes )
Object Placement( Title = Object Placement )
guid GUID Camera definition’s unique identifier. This GUID must be unique. Cockpit( Guid = {B1386D92-4782-4682-A137-738E25D1BAB5} )
Virtual Cockpit( Guid = {C95EAB58-9E4A-4E2A-A34C-D8D9D948F078} )
Spot( Guid = {BCA3FDD1-FB83-4BBA-8407-4922A7F0D00C} )
Locked Spot( Guid = {BCA3FDD1-FB83-4BBA-8407-4922A7F0D00D} )
FlyBy( Guid = {6B79DD49-9B4A-439D-BF40-ACBF157B0BA0} )
Top-Down( Guid = {A2849229-938A-448f-8AC6-01EF2291C171} )
Nearest Tower( Guid = {60BC0819-BD04-4AF6-8954-8FC8AA3545FF} )
Facilities Tower( Guid = {AA8C80C0-9EE2-4284-A1C2-B20CD3F5F3D9} )
Facilities Runway( Guid = {607C4520-CA6F-4135-AE10-8BF28838068F} )
AI Planes( Guid = {75A8357E-AB58-4294-9416-90C73FAFDD90} )
Multiplayer Planes( Guid = {2559BCED-9F13-4bc0-88C8-3996B9311681} )
Object Placement( Guid = {4D6E0979-AAC8-499F-AADB-F36877C4E8AA} )
description string Camera description. This is not used by the system, but can be used to provide a descriptive string in the configuration file. Cockpit( Description = This is the description of the cockpit view )
Virtual Cockpit( Description = This is the description of the virtual cockpit view. )
Spot( Description = This is the description of the spot view. )
FlyBy( Description = This is the description of the fly by view. )
Top-Down( Description = This is the description of the map or top down view. )
Nearest Tower( Description = This is the description of the tower view. )
Facilities Runway( Description = This is the description of the runway view. )
AI Planes( Description = This is the description of the AI aircraft view. )
Multiplayer Planes( Description = This is the description of the Multiplayer other aircraft view. )
Object Placement( Description = This is the description of the object placement view )
origin list Cockpit
Virtual Cockpit
Center
Pilot
Tower
Fixed
WorldObject
Every camera definition must have an origin that defines the object or point on which the camera is oriented:

• Cockpit – Camera is locked at fixed position in the 2D cockpit. Forward views include 2D instrument panel. Oblique view angle show virtual cockpit interior.
• Virtual Cockpit – Camera is mounted at the eye point defined in the aircraft’s CFG file.
• Center – External (spot plane) camera that points at the center of the aircraft’s visual model.
• Pilot – External (spot plane) camera that points at the pilot position inside the aircraft’s visual model.
• Tower – External camera mounted at a control tower defined via the facilities (BGLCOMP) database.
• Fixed – External camera at a fixed position. Fixed camera definitions must include FixedLatitude, FixedLongitude and FixedAltitude values.
• WorldObject – Used by SimConnect clients. Not available through CFG settings.

Note that this does not affect the View menu that the camera title appears in, the menu is set by the category parameter.
Cockpit( Origin = Cockpit )
Virtual Cockpit( Origin = Virtual Cockpit )
Spot( Origin = Center )
Nearest Tower( Origin = Tower )
Facilities Tower( Origin = Fixed )
showpanel bool Yes/No Determines whether the 2D instrument panel is shown. Cockpit( ShowPanel = Yes )
Object Placement( ShowPanel = No )
snappbhadjust list None
Ordinal
Swivel
Orthogonal
These settings control how camera movement is handled when the camera system receives a view pan or “snap to” command.

• None – Commands are ignored (position remains fixed).
• Ordinal – Camera moves to the next ordinal compass position in the direction of the command.
• Swivel – Camera moves incrementally in the direction of the command.
• Orthogonal – Camera rotates in the direction of the command (used in top-down view).
Cockpit( SnapPbhAdjust = Ordinal )
Virtual Cockpit( SnapPbhAdjust = Swivel )
Top-Down( SnapPbhAdjust = Orthogonal )
Facilities Tower( SnapPbhAdjust = None )
panpbhadjust list None
Ordinal
Swivel
Orthogonal
Same range of options as snappbhadjust. Cockpit( PanPbhAdjust = Ordinal )
Virtual Cockpit( PanPbhAdjust = Swivel )
Top-Down( PanPbhAdjust = Orthogonal )
Facilities Tower( PanPbhAdjust = None )
snappbhreturn bool True/False If true, camera position returns to its initial position when the snap movement command key is released. Cockpit( SnapPbhReturn = True )
Virtual Cockpit( SnapPbhReturn = False )
panpbhreturn bool True/False If true, camera position returns to its initial position when the pan movement command key is released. Cockpit( PanPbhReturn = True )
Virtual Cockpit( PanPbhReturn = False )
track list None
FlyBy
Track
TrackBank
FlatChase
FlatChaseLocked
External cameras have the ability to track a user or AI object. The Track parameter controls this behavior:

• None – No tracking behavior. User has manual control over the camera.
• FlyBy – Fly-by mode; the camera is positioned away from the user aircraft (at a location given by ChaseDistance, ChaseAltitude and ChaseHeading values) and tracks the aircraft for ChaseTime seconds before computing a new position.
• Track – Camera tracks the object while maintaining its position.
• TrackBank – Camera tracks the object while maintaining its position.
• FlatChase – Camera moves with the object, maintaining a fixed distance from it. Camera movements are dampened.
• FlatChaseLocked – Camera moves with the object, maintaining a fixed distance from it. Camera movements are rigid.
Cockpit( Track = None )
Spot( Track = FlatChase )
Locked Spot( Track = FlatChaseLocked )
FlyBy( Track = FlyBy )
Nearest Tower( Track = Track )
Facilities Runway( Track = TrackBank )
AI Planes( Track = Flat Chase )
showaxis list Yes
No
FrontOnly
Determines whether the axis indicator is shown. Cockpit( ShowAxis = FrontOnly )
Virtual Cockpit( ShowAxis = YES )
Spot( ShowAxis = No )
Top-Down( ShowAxis = Yes )
allowzoom bool Yes/No Controls whether the camera responds to zoom commands. Cockpit( AllowZoom = TRUE )
Spot( AllowZoom = Yes )
Object Placement( AllowZoom = FALSE )
initialzoom float 0.0 to 512.0
Default: 1.0
Sets the initial zoom. Cockpit( InitialZoom = 1.0 )
FlyBy( InitialZoom = 10.0 )
Top-Down( InitialZoom = 256 )
Nearest Tower( InitialZoom = 8.0 )
smoothzoomtime float 0.0 to 30.0
Default: 5.0
The zoom time in seconds. By default, zooming in and out is “smoothed” by changing between old and new zoom levels over a small time period (5 seconds). This setting enables you to control this effect on a per-camera basis. Cockpit( SmoothZoomTime = 2.0 )
showweather bool Yes/No Determines whether weather visuals are shown. Cockpit( ShowWeather = Yes )
Top-Down( ShowWeather = No )
InitialXyz XYZ (see notes) -500.0 to 500.0 (for each of the three)
Defaults: 0.0
Camera XYZ position offset from the default location in meters. See C172Cameras example.
InitialPbh XYZ (see notes) -90 to 90.0 (pitch)
-180 to 180.0 (bank and heading)
Defaults: 0.0
Camera pitch, bank and heading orientation offset from the default in degrees. Note that positive pitches give a downward view. Positive headings are to the right. See C172Cameras example.
xyzAdjust bool True/False Controls whether the camera responds to position change commands. Cockpit( XyzAdjust = TRUE )
Spot( XyzAdjust = FALSE )
xyzRate float Default: 0.25 The desired speed of the camera in meters per second. The direction of movement is determined by the camera control keys that are pressed.  
xyzAccelleratorTime float Default: 5.0 The time in seconds it will take for the camera to reach the speed set by xyzRate. A value of 0 will disable acceleration. Note that xyzAdjust must be set to True for this feature to be enabled.  
AllowPbhAdjust bool Yes/No Controls whether the camera responds to pitch, bank and heading change commands. No examples.
showlensflare bool True/False Determines whether lens flare effect can be shown (based on user setting). Cockpit( ShowLensFlare=FALSE )
Spot( ShowLensFlare=TRUE )
category list Aircraft
AirTraffic
Cockpit
Custom
Outside
Multiplayer
Runway
Scenery
Tower
Every camera definition must include a category that defines how the camera is exposed in the user interface. Categories define the view cycling behavior (S and A keys) as well as the menu structure. Some categories (AirTraffic, Runway, Multiplayer and Tower) can also be instance-based, meaning new cameras are created automatically based on the object type. Cockpit( Category = Cockpit )
Spot( Category = Outside )
Nearest Tower( Category = Tower )
Facilities Runway( Category = Runway )
AI Planes( Category = AirTraffic )
Multiplayer Planes( Category = MultiPlayer )
momentumeffect bool Yes/No Controls whether the camera exhibits momentum effect. This is determined by the settings in the Dynamic Head Movement section. Virtual Cockpit( MomentumEffect = Yes )
zoompanscalar float 0.0 to 100.0
Default: 0.0
One side effect of zooming in on an object is that it becomes difficult to make fine camera panning adjustments because the absolute movement of the camera around its position remains constant. The ZoomPanScalar setting compensates for this by adjusting panning movements by the given factor in relation to zoom level. Movement is scaled by dividing the ZoomPanScalar value by the zoom level. For example, with a ZoomPanScalar setting of 1, camera panning is reduced by half at 2x zoom (1 / 2). A setting of 2, on the other hand, accelerates panning to twice the normal rate at 1x zoom (2   / 1) and is exactly the normal rate at 2x zoom (2 / 2). Virtual Cockpit( ZoomPanScalar = 1.0 )
pitchpanrate float 0.0 to 100.0
Default: 10.0
Controls the rate at which pitch is changed in degrees per second. Virtual Cockpit( PitchPanRate=20 )
See PanRateTest example.
headingpanrate float 0.0 to 100.0
Default: 30.0
Controls the rate at which heading is changed in degrees per second. Virtual Cockpit( HeadingPanRate=60 )
See PanRateTest example.
panacceleratortime float 0.0 to 30.0
Default: 5.0
Pan acceleration time in seconds. When panning the camera, an acceleration/deceleration effect is added over a period of time. The larger this value is the longer it takes for the pan movement to reach its full rate (as controlled by PitchPanRate and HeadingPanRate), thus yielding smoother panning movement. Lower numbers yield more abrupt panning. No examples.
hotkeyselect integer 1 to 10
No default.
Links the camera to one of the 10 pre-defined key events for activating cameras; see the Control Assignments dialog. Virtual Cockpit( HotKeySelect=1 )
Spot( HotKeySelect=2 )
Nearest Tower( HotKeySelect=3 )
transition bool Yes/No When switching between camera views a “smooth” transition is obtained by moving the camera in real time from its old location to the new one. Note that this behavior is only applied if the Transition settings for both cameras are set to yes. If either or both are set to No then the view switch is instantaneous. Spot( Transition = Yes )
Top-Down( Transition = No )
clipmode string Normal
Minimum
Spot
Tower
This setting is used to control how the clip planes are computed. Clip planes are used to set the minimum and maximum distances for rendering in a 3D graphics program. The relative location of these planes determines how precise the graphics engine can maintain the Z-order of objects. A discussion of clip plane management is beyond the scope of this document. However, the concept is relevant to the camera system because it determines whether the camera favors near or far objects in the view:
• Normal – The near clip plane is scaled along with the zoom level. Useful for most views.
• Minimum – Clamps the near clip plane at its absolute minimum value (1 meter). Useful for cameras where the camera is placed close to object geometry (e.g., aircraft cameras).
• Spot – Favors distant objects by scaling the near clip plane with altitude and distance. Useful when the camera is positioned a reasonable distance away from the target object (e.g., spot view).
• Tower – Favors near objects by scaling the near clip plane by one-half the zoom level and clamping the far plane based on visibility settings with an absolute limit of 20km. Useful when objects at the limits of visibility aren’t important.
Spot( ClipMode = Spot )
FlyBy( ClipMode = Tower )
chasedistance float 0.0 to 3000.0
Default: 0.0
Initial distance in meters of the camera from the target object in external views. FlyBy( ChaseDistance = 500 )
chaseheading float -180.0 to 180.0
Default: 0.0
Initial angular offset in degrees of the camera relative to the target object in external views. FlyBy( ChaseHeading = 15 )
chasealtitude float -1000.0 to 3000.0
Default: 0.0
Initial altitude in feet of the camera relative to the target object in external views. FlyBy( ChaseAltitude = 10 )
chasetime float 0.0 to 200.0
Default: 0.0
Length of time in seconds an aircraft is kept in Fly-By view before a new position is computed. FlyBy( ChaseTime = 20 )
instancedbased Bool Yes/No If Yes, a new instance of the camera is created for each instance of the object referenced by the TargetCategory setting. Facilities Tower( InstancedBased = Yes )
cyclehideradius float 0.0 to 100.0
Default: 0.0
For instance based cameras, sets the distance (in nautical miles) beyond which the camera is skipped in the cycling order. Facilities Tower( CycleHideRadius = 7 )
targetcategory list None
AI Planes
Fixed
Determines which object class, when a new instance is created, triggers the creation of a new InstanceBased camera. Facilities Runway( TargetCategory = Fixed )
AI Planes( TargetCategory = AI Planes )
cyclehidden bool Yes/No If Yes, the camera is hidden from view cycling—it does not appear when cycling through views using the keyboard. Facilities Runway( CycleHidden=Yes )
FixedLatitude latitude -90.0 to 90.0
Latitude values can be expressed in decimal (-90 to +90) or hemispheric (N90 to S90) notation.
Default: 0.0
For Fixed camera types, the latitude of the cameras position. See FixedCameraTest.
FixedLongitude longitude -180.0 to 180.0
 
Longitude values can be expressed in decimal (-180 to +180) or hemispheric (W180 to E180) notation.
 
Default: 0.0
For Fixed camera types, the longitude of the cameras position. See FixedCameraTest.
FixedAltitude float -500.0 to 30,000,000.0
 
Default: 0.0
For Fixed camera types, the altitude of the cameras position in meters. See FixedCameraTest.
Notes:
  • “XYZ” value types denote a set of three numeric values expressed as a comma-separated string in the configuration file (for example: InitialPbh=0, 10, -40). Each value can be positive or negative and there must be a space between each comma and the following value.
  • Yes and No are interchangeable with True and False for boolean entries.

Dynamic Head Movement

The ESP camera system can compute acceleration parameters to simulate head movement. The effect is controlled by settings in the ESP.cfg file, which can be found in the C:\Documents and Settings\<alias>\Application Data\Microsoft\ESP folder (for Windows XP), or the C:\Users\<user name>\AppData\Roaming\Microsoft\ESP folder (for Windows Vista). The simulation uses these settings to compute how much camera acceleration (pitch, roll, side-to-side, and fore-to-aft) is generated in relation to aircraft accelerations. The table below describes each setting. Note that negative numbers move the camera in the opposite direction to the acceleration.

[dynamicheadmovement]

lonaccelonheadlon float -0.02 Computes the camera’s longitudinal (fore-to-back) change generated by longitudinal acceleration of the aircraft. LonAccelOnHeadLon=-0.020000
lonaccelonheadpitch float -0.01 Computes the camera’s pitch change generated by longitudinal acceleration of the aircraft. LonAccelOnHeadPitch=-0.010000
rollaccelonheadlat float 0.01 Computes the camera’s lateral (side-to-side) change generated by rolling acceleration of the aircraft. RollAccelOnHeadLat=0.010000
yawaccelonheadlat float -0.1 Computes the camera’s lateral (side-to-side) change generated by yawing acceleration of the aircraft. YawAccelOnHeadLat=-0.100000
rollaccelonheadroll float 0.1 Computes the camera’s rolling motion generated by rolling acceleration of the aircraft. RollAccelOnHeadRoll=0.100000
maxheadangle float 5.0 Maximum allowed angular change in degrees. MaxHeadAngle=5.000000
maxheadoffset float 0.3 Maximum allowed lateral change in feet. MaxHeadOffset=0.300000
headmovetimeconstant float 1.0 Acceleration multiplier (higher numbers increase responsiveness). HeadMoveTimeConstant=1.000000

Examples

The SDK includes several example files that you can use to observe how changes to camera configuration settings affect behavior. Copy the .FLT files to the My Documents\ESP Files folder and then load them in ESP.

PanRateTest
This flight defines six cameras that appear in the “Custom” category with different pan rate settings. Pan the view with the joystick hat switch or numeric keypad (with NumLock selected).
If FLT files are associated with the simualtion -- click here to run the flight: PanRateTest.FLT
FixedCameraTest This flight defines four fixed cameras that surround the end of runway 04 at Rochester (New York) International airport. The positions are defined by these settings in the camera definitions of the flight file:
FixedLatitude=N43.103570
FixedLongitude=W77.690494
FixedAltitude=230
These cameras also feature smooth transitions. Select one of the cameras from the Views menu and then press the A key to cycle through each position.
If FLT files are associated with the simualtion -- click here to run the flight: FixedCameraTest.FLT
C172-Cameras-text This file includes definitions that add two additional Virtual Cockpit cameras to the Cessna 172, including rear seat right and rear seat left views. To use these cameras you must first copy the contents of the file into the AIRCRAFT.CFG file located in the Cessna 172 folder. By default this is C:\Program Files\Microsoft ESP\1.0\SimObjects\Airplanes\C172. After you save the file simply load the Cessna 172 in ESP. These new views will be available from the Cockpit category. The views were created by offsetting the default eye point using the InitialXyz and InitialPbh settings. The views are 90 degrees out and 10 degrees down, and give images such as (rear seat right):