Skip to content

Commit 1a8b54b

Browse files
committed
initialize viewMat to fix spurious errors when setting view before init()
1 parent a8ebdd9 commit 1a8b54b

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

include/polyscope/context.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ struct Context {
8888
double nearClipRatio = view::defaultNearClipRatio;
8989
double farClipRatio = view::defaultFarClipRatio;
9090
std::array<float, 4> bgColor{{1.0, 1.0, 1.0, 0.0}};
91-
glm::mat4x4 viewMat;
91+
glm::mat4x4 viewMat{std::numeric_limits<float>::quiet_NaN()};
9292
double fov = view::defaultFov;
9393
ProjectionMode projectionMode = ProjectionMode::Perspective;
9494
glm::vec3 viewCenter;

include/polyscope/view.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ void updateFlight();
177177
// It is set to invalid initially, but we call ensureViewValid() before any renders.
178178
// This ensures we never try to render with an invalid view, but also allows the user to
179179
// set custom views if they wish, without them getting overwritten.
180+
bool viewIsValid();
180181
void invalidateView();
181182
void ensureViewValid();
182183

0 commit comments

Comments
 (0)