Local Varibles not been correct.
I am writing a voxel engine and I require a function to perform a calculation to work out the centre of a cube. To that end I have this function in my UUBlock Class written in C++.
when I call this method with a know BlockSize and BlockSizeHalf and know my X, Y, Z parameters.
my BlockCenter.X / BlockCenter.Y & BlockCenter.Z or always 0
which is rubbish when I have X = 5, BlockSize = 100 & BlockSizeHalf = 50
in this case BlockCenter.X should be 550.
Can someone please Advise as I am having these issues in serveral places in my code I don't understand why simple Maths isn't working.
Thanks for any advise or pointers.
Follow this question
Once you sign in you will be able to subscribe for any updates here