Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

either the delta handed to show handler is wrong, or mis-documented #274

Open
wchristian opened this issue Mar 13, 2015 · 0 comments
Open

Comments

@wchristian
Copy link
Contributor

The documentation on the topic says:

The first argument passed is the time, in seconds, since the previous call.

However, the code handling that looks like the following. Notable there is that between delta_time being determined, 1 or more runs of the move handler are done, which can take up considerable time. So either delta_time should be calculated specifically for the show handler, or the documentation amended to explain this better.

                my $new_time   = Time::HiRes::time;
                my $delta_time = $new_time - $_current_time{ $ref };
                next if $delta_time < $min_t;
                $_current_time{ $ref} = $new_time;
                my $delta_copy = $delta_time;

                while ( $delta_copy > $dt ) {
                        $self->_move( $ref, 1, $t ); #a full move
                        $delta_copy -= $dt;
                        $t += $dt;
                }
                my $step = $delta_copy / $dt;
                $self->_move( $ref, $step, $t ); #a partial move
                $t += $dt * $step;

                $self->_show( $ref, $delta_time );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant