forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

fixed : error using operator overload :(

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
Stellar



Joined: 12 Dec 2005
Posts: 48

PostPosted: Fri Jan 20, 2006 9:21 am    Post subject: fixed : error using operator overload :( Reply with quote

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.

_________________
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group