Add operator*= to colors

This commit is contained in:
Eryn Wells 2013-09-11 08:56:53 -07:00
parent 51c79b9b76
commit c6c11ca95a
2 changed files with 14 additions and 2 deletions

View file

@ -198,7 +198,8 @@ Ray::Ray(Vector3 o, Vector3 d)
* Compute and return the point given by parameterizing this Ray by time t.
*/
Vector3
Ray::parameterize(float t)
Ray::parameterize(const float t)
const
{
return origin + t * direction;
}
@ -241,3 +242,13 @@ Color::operator=(const Color &c)
alpha = c.alpha;
return *this;
}
Color &
Color::operator*=(const float f)
{
red *= f;
green *= f;
blue *= f;
return *this;
}