Add operator*= to colors
This commit is contained in:
parent
51c79b9b76
commit
c6c11ca95a
2 changed files with 14 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue