twn_draw.c: add warning for erroneous fov parameters
This commit is contained in:
		@@ -414,6 +414,9 @@ void render(void) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void draw_camera(Vec3 position, float fov, Vec3 up, Vec3 direction) {
 | 
					void draw_camera(Vec3 position, float fov, Vec3 up, Vec3 direction) {
 | 
				
			||||||
 | 
					    if (fabsf(0.0f - fov) < 0.00001f || fov > (M_PIf / 2))
 | 
				
			||||||
 | 
					        log_warn("Invalid fov given (%f)", (double)fov);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Camera const camera = {
 | 
					    Camera const camera = {
 | 
				
			||||||
        .fov = fov,
 | 
					        .fov = fov,
 | 
				
			||||||
        .pos = position,
 | 
					        .pos = position,
 | 
				
			||||||
@@ -428,6 +431,9 @@ void draw_camera(Vec3 position, float fov, Vec3 up, Vec3 direction) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
/* TODO: https://stackoverflow.com/questions/62493770/how-to-add-roll-in-camera-class */
 | 
					/* TODO: https://stackoverflow.com/questions/62493770/how-to-add-roll-in-camera-class */
 | 
				
			||||||
DrawCameraFromPrincipalAxesResult draw_camera_from_principal_axes(Vec3 position, float fov, float roll, float pitch, float yaw) {
 | 
					DrawCameraFromPrincipalAxesResult draw_camera_from_principal_axes(Vec3 position, float fov, float roll, float pitch, float yaw) {
 | 
				
			||||||
 | 
					    if (fabsf(0.0f - fov) < 0.00001f || fov > (M_PIf / 2))
 | 
				
			||||||
 | 
					        log_warn("Invalid fov given (%f)", (double)fov);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    (void)roll;
 | 
					    (void)roll;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    float yawc, yaws, pitchc, pitchs;
 | 
					    float yawc, yaws, pitchc, pitchs;
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user