Skip to content

Commit

Permalink
Merge pull request assimp#5194 from Gargaj/floatwarn
Browse files Browse the repository at this point in the history
Fix warning-as-error
  • Loading branch information
kimkulling authored Aug 15, 2023
2 parents 556c89b + d779034 commit 3a02de4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions code/AssetLib/FBX/FBXConverter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -443,10 +443,10 @@ void FBXConverter::ConvertCamera(const Camera &cam, const std::string &orig_name
float focal_length_mm = cam.FocalLength();
ASSIMP_LOG_VERBOSE_DEBUG("FBX FOV unspecified. Computing from FilmWidth (", film_width_inches, "inches) and FocalLength (", focal_length_mm, "mm).");
double half_fov_rad = std::atan2(film_width_inches * 25.4 * 0.5, focal_length_mm);
out_camera->mHorizontalFOV = half_fov_rad;
out_camera->mHorizontalFOV = static_cast<float>(half_fov_rad);
} else {
// FBX fov is full-view degrees. We want half-view radians.
out_camera->mHorizontalFOV = AI_DEG_TO_RAD(fov_deg) * 0.5;
out_camera->mHorizontalFOV = AI_DEG_TO_RAD(fov_deg) * 0.5f;
}

out_camera->mClipPlaneNear = cam.NearPlane();
Expand Down

0 comments on commit 3a02de4

Please sign in to comment.