Vec4<T> operator * (const Vec4<T> &v) const{
Vec4<T> rv;
return Vec4f(
data[0]*v.x + data[1]*v.y + data[2]*v.z + data[3]*v.w,
data[4]*v.x + data[5]*v.y + data[6]*v.z + data[7]*v.w,
data[8]*v.x + data[9]*v.y + data[10]*v.z + data[11]*v.w,
data[12]*v.x + data[13]*v.y + data[14]*v.z + data[15]*v.w);
}
I imagine rv was previously being returned then the person writing it changed their mind. I'm not sure if it's worth modifying.
Yeah, I'd say it was once something like:
Vec4<T> operator * (const Vec4<T> &v) const{
Vec4<T> rv = Vec4f(
data[0]*v.x + data[1]*v.y + data[2]*v.z + data[3]*v.w,
data[4]*v.x + data[5]*v.y + data[6]*v.z + data[7]*v.w,
data[8]*v.x + data[9]*v.y + data[10]*v.z + data[11]*v.w,
data[12]*v.x + data[13]*v.y + data[14]*v.z + data[15]*v.w);
// output for debug...
return rv;
}
In any case, as they aren't actually used, those operators could probably be removed... If you need to do any matrix multiplication, you should do it through OpenGL anyway, to make the most of whatever hardware is available.