It is currently Sat Aug 22, 2020 4:12 am


All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Comparing Vector3DInt32 fails?
PostPosted: Sat Jun 09, 2012 2:26 am 

Joined: Wed Jan 11, 2012 7:33 pm
Posts: 109
Hello, I'm posting because I'm trying to compare a Vector3DInt32 like so -

Code:
if ( firstClick != Vector3DInt32(0,0,0) &&  secondClick != Vector3DInt32(0,0,0))


but it somehow compares as true even if both firstClick and secondClick variables are 0,0,0. Help?


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Comparing Vector3DInt32 fails?
PostPosted: Sat Jun 09, 2012 6:53 am 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
I just tried the following code snippet:

Code:
Vector3DInt32 firstClick(0,0,0);
Vector3DInt32 secondClick(0,0,0);
if ( firstClick != Vector3DInt32(0,0,0) &&  secondClick != Vector3DInt32(0,0,0))
{
   std::cout << "Inside if" << std::endl;
}
else
{
   std::cout << "Inside else" << std::endl;
}


It prints "Inside else" as expected. How are you deermiing that the behaviour is wrong in your case? Are you seeing if go wrong when stepping through in the debugger, or have you added print statements like above?


Top
Offline Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 4 guests


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 post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Theme created StylerBB.net