SimConnect_CameraSet

The SimConnect_CameraSet function is used to set the properties of the camera. This function can only be used when the add-on camera has been acquired.

 

Syntax
HRESULT SimConnect_CameraSet(
    HANDLE hSimConnect,
    SIMCONNECT_DATA_CAMERA CameraData,
    DWORD DataMask
    );

 

Parameters
Parameter Description Type
hSimConnect Handle to a SimConnect object. Integer
CameraData This is a SIMCONNECT_DATA_CAMERA struct containing the member parameters you wish to set. The parameters should correspond to the DataMask used. Struct
DataMask This is a bitmask that can be created using the SIMCONNECT_CAMERA_DATA_MASK enum members, and defines which parts of the CameraData struct should be used for the camera. Integer

 

Return Values

The function returns an HRESULT. Possible values include, but are not limited to, those in the following table.

Return value Description
S_OK The function succeeded.
E_FAIL The function failed.

 

Example

Set camera data:

SIMCONNECT_DATA_CAMERA data;
data.Referential = SIMCONNECT_POSITION_REFERENTIAL_AIRCRAFT;       
data.Pos.z =-10.0;
data.Pos.x = 0;
data.Pos.y = 4.0;
data.Pbh.Pitch = 0;
data.Pbh.Bank = 0;
data.Pbh.Heading = 0;
data.Fov = 0.80;
SimConnect_CameraSet(hSimConnect, data, SIMCONNECT_CAMERA_DATA_MASK_ALL_ROTATION);

 

Remarks

Note that if the add-on camera has not been acquired previously, then a SIMCONNECT_EXCEPTION_CAMERA_API exception will be sent (see SIMCONNECT_EXCEPTION for more information).

 

0/255