casting array types

Started by
2 comments, last by eskimo456 13 years, 4 months ago
I have set up a normalisation function and am ready to test it. The problem being that it currently takes in and uses int arrays. In order to be able to do the calculation I have to use a float for the sqrt function in C++;

Is there an easy way to cast from a int array[] to a float array[];


Many thanks
Advertisement
No. You'll need to convert the entire array manually.
Why are you trying to normalize ints anyway?
[size=2]My Projects:
[size=2]Portfolio Map for Android - Free Visual Portfolio Tracker
[size=2]Electron Flux for Android - Free Puzzle/Logic Game
The ints are for the wall positions in space. I figured ints would make it easier to draw the walls and ensure they work out correctly for collision detection with no rounding errors.

In hind site generating walls with floats seems like it may have been a better idea. I will probably just change the variables and necessary argument lists with float. Probably work out quicker and easier plus just as efficient *fingers crossed*.

This topic is closed to new replies.

Advertisement