A bit of cleanup
This commit is contained in:
@@ -39,9 +39,6 @@ public:
|
|||||||
this->z * b, this->w * b); };
|
this->z * b, this->w * b); };
|
||||||
Tuple operator/(const double &b) const { return Tuple(this->x / b, this->y / b,
|
Tuple operator/(const double &b) const { return Tuple(this->x / b, this->y / b,
|
||||||
this->z / b, this->w / b); };
|
this->z / b, this->w / b); };
|
||||||
|
|
||||||
void fixPoint();
|
|
||||||
void fixVector();
|
|
||||||
bool isRepresentable();
|
bool isRepresentable();
|
||||||
|
|
||||||
void set(double nX, double nY, double nZ) { this->x = nX; this->y = nY; this->z = nZ; };
|
void set(double nX, double nY, double nZ) { this->x = nX; this->y = nY; this->z = nZ; };
|
||||||
|
|||||||
@@ -45,24 +45,6 @@ Tuple Tuple::reflect(const Tuple &normal)
|
|||||||
return *this - normal * 2 * this->dot(normal);
|
return *this - normal * 2 * this->dot(normal);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Tuple::fixPoint()
|
|
||||||
{
|
|
||||||
if (isnan(this->x) || isnan(this->y) || isnan(this->z))
|
|
||||||
{
|
|
||||||
/* w is probably broken, so fix it */
|
|
||||||
this->w = 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void Tuple::fixVector()
|
|
||||||
{
|
|
||||||
if (isnan(this->x) || isnan(this->y) || isnan(this->z))
|
|
||||||
{
|
|
||||||
/* w is probably broken, so fix it */
|
|
||||||
this->w = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Tuple::isRepresentable()
|
bool Tuple::isRepresentable()
|
||||||
{
|
{
|
||||||
return !(isnan(this->x) || isnan(this->y) || isnan(this->z) ||
|
return !(isnan(this->x) || isnan(this->y) || isnan(this->z) ||
|
||||||
|
|||||||
Reference in New Issue
Block a user