diff --git a/lib/pods/SDLx/Controller/Interface.pod b/lib/pods/SDLx/Controller/Interface.pod index fbea0ee9..b32c26fe 100644 --- a/lib/pods/SDLx/Controller/Interface.pod +++ b/lib/pods/SDLx/Controller/Interface.pod @@ -49,22 +49,68 @@ Core, Extension =head2 set_acceleration +Allows you to set the acceleration callback for defining the inferface's behaviour in terms of x,y and rotation. + + $interface->set_acceleration ( + sub { + my ($time, $current_state) = @_; + + return ( $acc_x, $acc_y, $torque ); + } + ); + +These accelerations are arbitary and can be set to any frame of reference. Your render callback will handle how to +interpert it. + +The callback will recieve the time and the current state as a C. + =head2 attach +Attaches the interface to a controller with a render callback + + $interface->attach( $controller, $render, @params ); + +Where $render is a callback that recieves the interpolated C. + + my $render = sub { + my ($state) = shift; my @params = @_; + #draw the current $state. + }; + +The @params are any extra parameters you would like to pass to the $render callback. + =head2 current + my $current_state = $interface->current(); + +Returns the current state of the interface as a C. + =head2 previous + my $previous_state = $interface->previous(); + +Returns the previous state of the interface as a C. + =head1 OTHER METHODS +Don't use these unless you really really want to. + =head2 acceleration +Call the acceleration callback once. + =head2 interpolate +Interpolate the current state + =head2 evaluate +Evaluate the new currrent and previous state. + =head2 update +Update the states by integrating with time. + =head1 AUTHORS See L.