Jump to content
  • Advertisement
Sign in to follow this  
eskimo456

casting array types

This topic is 2873 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
Advertisement
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*.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!