add common header
This commit is contained in:
		
							parent
							
								
									9d9419f9bd
								
							
						
					
					
						commit
						3d670c83ed
					
				
							
								
								
									
										29
									
								
								src/rtweekend.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										29
									
								
								src/rtweekend.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,29 @@
 | 
				
			|||||||
 | 
					#pragma once
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include <cmath>
 | 
				
			||||||
 | 
					#include <cstdlib>
 | 
				
			||||||
 | 
					#include <limits>
 | 
				
			||||||
 | 
					#include <memory>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// usings
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					using std::shared_ptr;
 | 
				
			||||||
 | 
					using std::make_shared;
 | 
				
			||||||
 | 
					using std::sqrt;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// constants
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const double infinity = std::numeric_limits<double>::infinity();
 | 
				
			||||||
 | 
					const double pi = 3.1415926535897932385;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// utility functions
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					inline double degrees_to_radians(double degrees)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    return degrees * pi / 180;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// common headers
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include "ray.h"
 | 
				
			||||||
 | 
					#include "vec3.h"
 | 
				
			||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user