{"action":"created","issue":{"url":"https://api.github.com/repos/deltaluca/nape/issues/104","repository_url":"https://api.github.com/repos/deltaluca/nape","labels_url":"https://api.github.com/repos/deltaluca/nape/issues/104/labels{/name}","comments_url":"https://api.github.com/repos/deltaluca/nape/issues/104/comments","events_url":"https://api.github.com/repos/deltaluca/nape/issues/104/events","html_url":"https://github.com/deltaluca/nape/issues/104","id":149438446,"number":104,"title":"Callbacks are delayed by a frame","user":{"login":"JoeCreates","id":2540732,"avatar_url":"https://avatars.githubusercontent.com/u/2540732?v=3","gravatar_id":"","url":"https://api.github.com/users/JoeCreates","html_url":"https://github.com/JoeCreates","followers_url":"https://api.github.com/users/JoeCreates/followers","following_url":"https://api.github.com/users/JoeCreates/following{/other_user}","gists_url":"https://api.github.com/users/JoeCreates/gists{/gist_id}","starred_url":"https://api.github.com/users/JoeCreates/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JoeCreates/subscriptions","organizations_url":"https://api.github.com/users/JoeCreates/orgs","repos_url":"https://api.github.com/users/JoeCreates/repos","events_url":"https://api.github.com/users/JoeCreates/events{/privacy}","received_events_url":"https://api.github.com/users/JoeCreates/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":14,"created_at":"2016-04-19T12:01:13Z","updated_at":"2016-04-22T19:28:39Z","closed_at":null,"body":"I'm trying to implement a platformer in haxeflixel with nape, and the idea was to use InteractionCallbacks to determine if the player is standing on the ground. Unfortunately it seems that the callbacks are always called a single frame after the interaction event actually happens.\r\n\r\nFor example, if the player lands on the ground, it stops, but the callback doesn't happen until a frame later. If the player jumps, same thing. I have no way to see with the callbacks that the player is no longer on the ground even though the bodies are separated.\r\n\r\n[This demo](https://gist.github.com/JoeCreates/655ac5ae741435579b44630fdd22a2f8) (using haxeflixel for the debug interface accessed with the '@' key) shows a simple test case illustrating the issue. Open the log panel with the icon at the top right which shows a message for each time one of the callbacks is called. Pause the game, hold up on your keyboard, then press the forward button to go one frame at a time. You will see the bodies separated or colliding always one frame ahead of the callback message.\r\n\r\nNote that this works with regular traces, too. It's not that the log is delayed.\r\n"},"comment":{"url":"https://api.github.com/repos/deltaluca/nape/issues/comments/213562056","html_url":"https://github.com/deltaluca/nape/issues/104#issuecomment-213562056","issue_url":"https://api.github.com/repos/deltaluca/nape/issues/104","id":213562056,"user":{"login":"JoeCreates","id":2540732,"avatar_url":"https://avatars.githubusercontent.com/u/2540732?v=3","gravatar_id":"","url":"https://api.github.com/users/JoeCreates","html_url":"https://github.com/JoeCreates","followers_url":"https://api.github.com/users/JoeCreates/followers","following_url":"https://api.github.com/users/JoeCreates/following{/other_user}","gists_url":"https://api.github.com/users/JoeCreates/gists{/gist_id}","starred_url":"https://api.github.com/users/JoeCreates/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JoeCreates/subscriptions","organizations_url":"https://api.github.com/users/JoeCreates/orgs","repos_url":"https://api.github.com/users/JoeCreates/repos","events_url":"https://api.github.com/users/JoeCreates/events{/privacy}","received_events_url":"https://api.github.com/users/JoeCreates/received_events","type":"User","site_admin":false},"created_at":"2016-04-22T19:28:39Z","updated_at":"2016-04-22T19:28:39Z","body":"I'm not suggesting collisions should be redone. What is the case in which redoing the collisions would be required?\r\n\r\nI can think of a case where these is potentially an issue: a ball lands on the ground. The collision happens (end of step), the user moves it to somewhere there is no collisions, then at the start of step the ball's velocity changes due to the bounce.\r\n\r\nIn this case, with the collisions at the end of step, the user would have accurate information with regard to the existence of the collision, but they would not yet have information about the ball's velocity in response to the collision. With the current implementation, the user has immediate access to information about the new velocity, but not access to the fact that the collision happened.\r\n\r\nIs this the kind of issue?"}}