Stellar

Joined: 12 Dec 2005 Posts: 48
|
Posted: Fri Jan 20, 2006 9:21 am Post subject: fixed : error using operator overload :( |
|
|
EDIT : Nevermind I found it. That was discreet, I was passing the wrong type to the function. anyways, if i could delete threads in these forums, ild be able to remove about half of mine.
__________________________
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: |
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: |
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.
|
_________________
 |
|