__________________________
I've never really practiced operator overloading, but im getting an error as a result of my ignorance. thought mabey someone would know how to fix the problem.
From the error message it looks like it knows what function to use. Im not sure why it doesnt qualify?
any ideas?,
thx,
-stellar
___ error ____
MyCamera.cpp: In member function 'void MyCamera::LookAt(MyScePspFVector3, MyScePspFVector3, MyScePspFVector3)':
MyCamera.cpp:45: error: no match for 'operator-' in 'target - pos'
MyLinearMathUtils.h:20: note: candidates are: ScePspFVector3 MyScePspFVector3::operator-(ScePspFVector3)
____ code____
Code: Select all
ScePspFVector3 MyScePspFVector3::operator - ( ScePspFVector3 param )
{
MyScePspFVector3 result (
this->vector.x - param.x,
this->vector.y - param.y,
this->vector.z - param.z
);
return result.vector;
}
Code: Select all
void MyCamera::LookAt(
MyScePspFVector3 &pos,
MyScePspFVector3 &target,
MyScePspFVector3 &up
)
{
MyScePspFVector3 temp = ( target - pos ); <-- error happens here
}
:: EDIT - FIXED ::
as you can see, target and pos are not of ScePspFVector3 type.