diff --git a/raytracing/src/matrix.cpp b/raytracing/src/matrix.cpp index 1cf946a..9690e13 100644 --- a/raytracing/src/matrix.cpp +++ b/raytracing/src/matrix.cpp @@ -397,7 +397,7 @@ Matrix Matrix::shearing(double a_xy, double a_xz, double a_yx, double a_yz, doub /* ------------------------------------------------------------------------- */ -Matrix Matrix::view_transform(Tuple a_from, Tuple a_to, Tuple an_up) +Matrix Matrix::view_transform(const Tuple &a_from, const Tuple &a_to, const Tuple &an_up) { Tuple the_forward = (a_to - a_from).normalize(); Tuple the_up_normalized = an_up.normalize(); diff --git a/raytracing/src/matrix.h b/raytracing/src/matrix.h index 71bb8ce..5f7c924 100644 --- a/raytracing/src/matrix.h +++ b/raytracing/src/matrix.h @@ -77,7 +77,7 @@ namespace Raytracer static Matrix rotation_y(double a_radians); static Matrix rotation_z(double a_radians); static Matrix shearing(double a_xy, double a_xz, double a_yx, double a_yz, double a_zx, double a_zy); - static Matrix view_transform(Tuple a_from, Tuple a_to, Tuple an_up); + static Matrix view_transform(const Tuple &a_from, const Tuple &a_to, const Tuple &an_up); private: bool validate_dimensions(const std::initializer_list> &a_values) const;