Add progress bars and argument parsing
This commit is contained in:
parent
742ef283e4
commit
a45ae025d6
7 changed files with 4897 additions and 29 deletions
7
vec3.hpp
7
vec3.hpp
|
|
@ -92,6 +92,11 @@ typedef vec3 color;
|
|||
|
||||
/* More overloads */
|
||||
|
||||
inline bool operator==(const vec3 &u, const vec3 &v)
|
||||
{
|
||||
return u.x == v.x && u.y == v.y && u.z == v.z;
|
||||
}
|
||||
|
||||
// Straightforward vector sum
|
||||
inline vec3 operator+(const vec3 &u, const vec3 &v)
|
||||
{
|
||||
|
|
@ -191,7 +196,7 @@ vec3 reflect(const vec3& v, const vec3 n)
|
|||
return v - 2*dot(v,n)*n;
|
||||
}
|
||||
|
||||
vec3 refract (const vec3& uv, const vec3& n, float etai_over_etat)
|
||||
vec3 refract(const vec3& uv, const vec3& n, float etai_over_etat)
|
||||
{
|
||||
float cos_theta = fmin(dot(-uv, n), 1.0);
|
||||
vec3 r_out_perp = etai_over_etat * (uv + cos_theta*n);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue