Skip to content

Commit 5ac2571

Browse files
committed
Clamp the lab camera's phi component to [0.01, 3.13] to avoid locking issues
1 parent 0178374 commit 5ac2571

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

code/lab/lab.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -145,11 +145,8 @@ void rotate_view(int dx, int dy)
145145

146146
lab_cam_theta += dx / 100.0f;
147147
lab_cam_phi += dy / 100.0f;
148-
149-
if (lab_cam_phi > PI)
150-
lab_cam_phi = 0.0f;
151-
if (lab_cam_phi < 0.0f)
152-
lab_cam_phi = PI;
148+
149+
CLAMP(lab_cam_phi, 0.01f, PI - 0.01f);
153150
}
154151

155152
void labviewer_change_model(char *model_fname, int lod = 0, int sel_index = -1)

0 commit comments

Comments
 (0)