Templated the Lerp color operator to allow use with double...
This commit is contained in:
parent
eb642099f1
commit
01ab3c4e68
|
@ -104,8 +104,8 @@ public:
|
|||
return Color4( (*this)[0]+p.V()[0], (*this)[1]+p.V()[1], (*this)[2]+p.V()[2], (*this)[3]+p.V()[3] );
|
||||
}
|
||||
|
||||
|
||||
inline void lerp(const Color4 &c0, const Color4 &c1, const float x)
|
||||
template <class ScalarInterpType>
|
||||
inline void lerp(const Color4 &c0, const Color4 &c1, const ScalarInterpType x)
|
||||
{
|
||||
assert(x>=0);
|
||||
assert(x<=1);
|
||||
|
@ -116,7 +116,8 @@ public:
|
|||
(*this)[3]=(T)(c1.V()[3]*x + c0.V()[3]*(1.0f-x));
|
||||
}
|
||||
|
||||
inline void lerp(const Color4 &c0, const Color4 &c1, const Color4 &c2, const Point3f &ip)
|
||||
template <class ScalarInterpType>
|
||||
inline void lerp(const Color4 &c0, const Color4 &c1, const Color4 &c2, const Point3<ScalarInterpType> &ip)
|
||||
{
|
||||
assert(fabs(ip[0]+ip[1]+ip[2]-1)<0.00001);
|
||||
|
||||
|
|
Loading…
Reference in New Issue