Skip to content

Commit

Permalink
camera - ortho zoom property
Browse files Browse the repository at this point in the history
  • Loading branch information
nem0 committed Dec 28, 2024
1 parent 777268c commit 82a43d9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/ofbx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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; }
Expand Down Expand Up @@ -2522,6 +2524,10 @@ struct OptionalError<Object*> 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;
}
Expand Down
1 change: 1 addition & 0 deletions src/ofbx.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 82a43d9

Please sign in to comment.