Node::schedule() update frequency

Node::schedule() update frequency

I have a question about certain specifics of schedule() function.

How does it work in terms of calling itself?

If I pass 1/60 for the update interval will it get called at least one time within 1/60?

If it’s being called every 1/60 or any update interval that I pass then what’s the point of the float parameter for the call back?

For example:

node->schedule([](float dt) {
     // what is the point of dt if it's the same as update interval?
}, update_interval, key);




From what I understand, in a complex and not-well optimized case, reaching a consistent 60fps is hard to achieve. The fps will fluctuate around 60fps but not always be there, hence the dt might not always be the same.

Also the dt is to assist the program to dynamically know the values. Using magic numbers is not always recommended, if you change the update frequency dynamically, the value will change later on etc.


closed #3

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.