From 82a43d9191f2250145fddc219b4083667c33f2a5 Mon Sep 17 00:00:00 2001 From: Mikulas Florek Date: Sat, 28 Dec 2024 18:05:38 +0100 Subject: [PATCH] camera - ortho zoom property --- src/ofbx.cpp | 6 ++++++ src/ofbx.h | 1 + 2 files changed, 7 insertions(+) diff --git a/src/ofbx.cpp b/src/ofbx.cpp index ededc23..b94a44f 100644 --- a/src/ofbx.cpp +++ b/src/ofbx.cpp @@ -1855,6 +1855,7 @@ struct CameraImpl : public Camera double nearPlane = 0.1; double farPlane = 1000.0; + double orthoZoom = 1.f; bool autoComputeClipPanes = true; GateFit gateFit = GateFit::HORIZONTAL; @@ -1879,6 +1880,7 @@ struct CameraImpl : public Camera double getNearPlane() const override { return nearPlane; } double getFarPlane() const override { return farPlane; } + double getOrthoZoom() const override { return orthoZoom; } bool doesAutoComputeClipPanes() const override { return autoComputeClipPanes; } GateFit getGateFit() const override { return gateFit; } @@ -2522,6 +2524,10 @@ struct OptionalError parseCamera(Scene& scene, const Element& element, { camera->farPlane = prop->getProperty(4)->getValue().toDouble(); } + else if (prop->first_property->value == "OrthoZoom" || prop->first_property->value == "CameraOrthoZoom") + { + camera->orthoZoom = prop->getProperty(4)->getValue().toDouble(); + } } prop = prop->sibling; } diff --git a/src/ofbx.h b/src/ofbx.h index 4717fc3..73183f4 100644 --- a/src/ofbx.h +++ b/src/ofbx.h @@ -394,6 +394,7 @@ struct Camera : Object virtual double getNearPlane() const = 0; virtual double getFarPlane() const = 0; + virtual double getOrthoZoom() const = 0; virtual bool doesAutoComputeClipPanes() const = 0; virtual GateFit getGateFit() const = 0;