• Advertisement
Sign in to follow this  

What float unit should I choose for 1 [m]?

This topic is 1464 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

Hi

What unit should I choose for 1 [m], what value is the best? For example I have a football mesh. In reality the radius of the ball is about 11 cm (0,11m). Here on the screen:

http://imagizer.imageshack.us/v2/800x600q90/855/m2z1.jpg

the radius is 0,70 (I have float variable in which I store 0.70f). So this makes that in my game 0,70 [unit] means 0.11 [m], so 1 [m] is in fact 6,3636 units in my game.

I would like to scale my mesh and choose the scale of the world that 1 [m] = 1 [unit]. Without this there are some issues with physic. So from physic engine and generally logical point of view it would be the best to choose 1[m] as 1[unit], so radius float 0.11f means 0.11 [m]. However You know floats numbers have inacurracies, so is it good to choose 1[m] as 1[unit] or maybe better choice would be 1[m] as 100[unit]??? What is the best scale of the game environment?

Edited by anders211

Share this post


Link to post
Share on other sites
Advertisement

The floating point precision is relative, not absolute, so you have the same relative resolution at any scale. Base your decision on what makes sense for you, but sticking to standard units is a good decision.

Share this post


Link to post
Share on other sites

Just a note - Sticking to standard units is especially good once you get into physics parts, otherwise you might need some multiplications-by-constant to do it correctly (and this can become bloody mess quite soon).

Edited by Vilem Otte

Share this post


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

  • Advertisement