Volumes Of Fun http://www.volumesoffun.com/phpBB3/ |
|
Comparing Vector3DInt32 fails? http://www.volumesoffun.com/phpBB3/viewtopic.php?f=2&t=403 |
Page 1 of 1 |
Author: | drwbns [ Sat Jun 09, 2012 2:26 am ] |
Post subject: | Comparing Vector3DInt32 fails? |
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? |
Author: | David Williams [ Sat Jun 09, 2012 6:53 am ] |
Post subject: | Re: Comparing Vector3DInt32 fails? |
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? |
Page 1 of 1 | All times are UTC |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |