Skip to content

Commit 7bf9586

Browse files
committed
Focal length set to match with original PIPCamera
1 parent 06fb06d commit 7bf9586

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

Unreal/Plugins/AirSim/Source/PIPCamera.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,9 @@ void APIPCamera::setupCameraFromSettings(const APIPCamera::CameraSetting& camera
374374
else
375375
this->SetActorTickEnabled(false);
376376

377+
//set initial focal length
378+
camera_->CurrentFocalLength = 11.9;
379+
377380
int image_count = static_cast<int>(Utils::toNumeric(ImageType::Count));
378381
for (int image_type = -1; image_type < image_count; ++image_type) {
379382
const auto& capture_setting = camera_setting.capture_settings.at(image_type);
@@ -765,10 +768,11 @@ std::string APIPCamera::getCurrentFieldOfView()
765768

766769
void APIPCamera::copyCameraSettingsToAllSceneCapture(UCameraComponent* camera)
767770
{
768-
int image_count = static_cast<int>(Utils::toNumeric(ImageType::Count));
769-
for (image_type >= 0) {
770-
//scene capture components
771-
copyCameraSettingsToSceneCapture(camera_, captures_[image_type]);
771+
int image_count = static_cast<int>(Utils::toNumeric(ImageType::Count));
772+
for (int image_type = image_count - 1; image_type >= 0; image_type--) {
773+
if (image_type >= 0) { //scene capture components
774+
copyCameraSettingsToSceneCapture(camera_, captures_[image_type]);
775+
}
772776
}
773777
}
774778

0 commit comments

Comments
 (0)