From dd40b0ccee0a21b864b2039f0f1294a4e652fef2 Mon Sep 17 00:00:00 2001 From: sfjohnston Date: Sun, 23 Jul 2023 12:05:01 -0700 Subject: [PATCH] Changed #define FBX_FOV_UNKNOWN to const float kFovUnknown --- code/AssetLib/FBX/FBXConverter.cpp | 2 +- code/AssetLib/FBX/FBXDocument.h | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/code/AssetLib/FBX/FBXConverter.cpp b/code/AssetLib/FBX/FBXConverter.cpp index cca5da596..032089906 100644 --- a/code/AssetLib/FBX/FBXConverter.cpp +++ b/code/AssetLib/FBX/FBXConverter.cpp @@ -438,7 +438,7 @@ void FBXConverter::ConvertCamera(const Camera &cam, const std::string &orig_name float fov_deg = cam.FieldOfView(); // If FOV not specified in file, compute using FilmWidth and FocalLength. - if (fov_deg == FBX_FOV_UNKNOWN) { + if (fov_deg == kFovUnknown) { float film_width_inches = cam.FilmWidth(); 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)."); diff --git a/code/AssetLib/FBX/FBXDocument.h b/code/AssetLib/FBX/FBXDocument.h index 503c94833..3af757a19 100644 --- a/code/AssetLib/FBX/FBXDocument.h +++ b/code/AssetLib/FBX/FBXDocument.h @@ -55,12 +55,13 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #define _AI_CONCAT(a,b) a ## b #define AI_CONCAT(a,b) _AI_CONCAT(a,b) -/* Use an 'illegal' default FOV value to detect if the FBX camera has set the FOV. */ -#define FBX_FOV_UNKNOWN -1.0f namespace Assimp { namespace FBX { +// Use an 'illegal' default FOV value to detect if the FBX camera has set the FOV. +static const float kFovUnknown = -1.0f; + class Parser; class Object; @@ -251,7 +252,7 @@ public: fbx_simple_property(FilmAspectRatio, float, 1.0f) fbx_simple_property(ApertureMode, int, 0) - fbx_simple_property(FieldOfView, float, FBX_FOV_UNKNOWN) + fbx_simple_property(FieldOfView, float, kFovUnknown) fbx_simple_property(FocalLength, float, 1.0f) };