Jump to content

  • Log In with Google      Sign In   
  • Create Account


the incredible smoker

Member Since 26 Nov 2013
Offline Last Active Yesterday, 10:34 AM

#5119857 float unlimited increasing rotation or use a if

Posted by the incredible smoker on 29 December 2013 - 10:43 AM

Thanks Waterlimon and Alvaro about the presision, i did not notice that yet, to be honest i have no clue whats the underlaying idea about float, i was just asking to be sure.

With this information i now know i need the "if", the "if" is faster then any function like fmod i,m sure.

 

Maybe you all dont worry much about CPU intensivity as i do, i like many things in screen, not just 1 circlesaw, maybe you all have a i7 instead of a celeron ?

By example : your better off with a "if" instead of a "min()" or "max()" in terms of CPU usage, i avoid everything to be honest.

 

greetings and thanks again




#5119838 float unlimited increasing rotation or use a if

Posted by the incredible smoker on 29 December 2013 - 09:41 AM

I,m sorry i have no clue what you mean.

It also seems very CPU intensive, using a function like fmod ? ( i dont know what its for )

Normally i dont use functions like : sin() , cos() etc, fmod() looks something like that, very cpu intensive.

Note : i usually avoid divide to.

 

I,m asking to go with or without the if, and why ?

 

greetings




#5119825 float unlimited increasing rotation or use a if

Posted by the incredible smoker on 29 December 2013 - 08:27 AM

Hi all, i have a question :

suppose i am making a wheel rotating :

 

float rot = 0.0f;

 

// in loop

rot += fElapsedtime;

 

it works fine like this, but the number gets unlimited bigger and bigger.

 

Now what is better for CPU performance?, using a if that limits the rotation ? :

 

 

// in loop

rot += fElapsedtime;

if( rot > Pi )rot -= Pi;

 

What is the better choise and why ?

thanks in advance




#5117099 What are good ways to implement a "game playback" feature?

Posted by the incredible smoker on 15 December 2013 - 09:50 AM

I played Tiger Woods one day, and the replay missed the put,

maybe they all accept the risk of having a re-play instead of a replay ?, not that i had to try again here in Tiger Woods, i still won the game,

some games let you play again after the replay goes wrong, by using all the same variables from the game i guess.

The weirdness, i rather have no replay at all in my own games.




#5113222 Amsterdam programmer salaries?

Posted by the incredible smoker on 30 November 2013 - 03:44 AM

Amsterdam is a good place for inspiration.






PARTNERS