I have a function in my simple camera class called ''translate camera. It takes a matrix and multiplies the position vector by the appropriate matrix.
void CCamera::TranslateCamera(const matrix4f& m)
{
position *= m;
}
simple huh? Unfortunately, this doesn''t compile, reporting the following error:
d:\software\microsoft visual studio 6\msdev98\myprojects\game\game\cvector.h(319) : error C2676: binary ''['' : ''const class matrix4'' does not define this operator or a conversion to a type acceptable to the predefined operator
D:\Software\Microsoft Visual Studio 6\MSDev98\MyProjects\game\game\ccamera.cpp(53) : see reference to function template instantiation ''class vector3 &__thiscall vector3::operator *=(const class matrix4)'' being compiled
d:\software\microsoft visual studio 6\msdev98\myprojects\game\game\cvector.h(321) : error C2676: binary ''['' : ''const class matrix4'' does not define this operator or a conversion to a type acceptable to the predefined operator
D:\Software\Microsoft Visual Studio 6\MSDev98\MyProjects\game\game\ccamera.cpp(53) : see reference to function template instantiation ''class vector3 &__thiscall vector3::operator *=(const class matrix4)'' being compiled
However, this does compile, and works perfectly:
void CCamera::TranslateCamera(const matrix4f& m)
{
m;
position *= m;
}
WTF is going on here?