I want to use something like a normal int() function. Can't seem to get it to work.
I have a float vector and want to make it an int to check for this:
if ( int(cDir.z) < 0) do stuff here;
I read about using a u, but not sure how to do that in this case?
Don't need the INT in this case since you can test for 0. Unless your really looking for -1 or less.
I did post a couple of functions in tips and tricks that do the same thing as INT did in IBasic.
http://www.ionicwind.com/forums/index.php?topic=525.0
I test for zero but being a float when I make an adjustment it never seems to hit just 0 exactly and keeps rotating. Getting frustrated, going to work on seomthing else, maybe that will help and I can figure it all out. Thanks anyways.
When working with floating point numbers always use an epsilon value instead of an equality test for zero.
if(abs(a) < .0001)
//close enough to zero
The epsilon range is your choice but in most calculations you will never end up with an exact equality from the FPU.