[FIX] Fix matrix view_transform
This commit is contained in:
@@ -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_forward = (a_to - a_from).normalize();
|
||||||
Tuple the_up_normalized = an_up.normalize();
|
Tuple the_up_normalized = an_up.normalize();
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ namespace Raytracer
|
|||||||
static Matrix rotation_y(double a_radians);
|
static Matrix rotation_y(double a_radians);
|
||||||
static Matrix rotation_z(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 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:
|
private:
|
||||||
bool validate_dimensions(const std::initializer_list<std::initializer_list<double>> &a_values) const;
|
bool validate_dimensions(const std::initializer_list<std::initializer_list<double>> &a_values) const;
|
||||||
|
|||||||
Reference in New Issue
Block a user