Applying applyLinearImpulse in reverse

I’m playing around with body:applyLinearImpulse with an object that has applied fixed to say drag and drop from top of screen with normal gravity and then reverse the movement. Got the reverse working on an onenterframe game loop having stored the movements and then looping back in reverse over the table array but when I try applying the impulse I can’t retain the angle.

If I try applying a positive impulse again the reverse body it seems to go in the opposite direction.

Does anyone know if the physics world retains the objects movement and me manual altering the physics is screwing the impulse?

If not any tips to handle such as action.

J [import]uid: 103970 topic_id: 26893 reply_id: 326893[/import]

Err… having a hard time following your scenario(and assume I’m not alone but could be wrong). It might help if you gave an example at a higher level, like player does this and this is what is supposed to happen.

Does anyone know if the physics world retains the objects movement and me manual altering the physics is screwing the impulse?

The physics world keeps track of the current applied force which is what sets objects into motion(IE movement). Keep in mind that with friction/gravity that the applied force degrades on your object until it presumably stops/gets to zero.

This means if you apply a (5, 5) force you really can’t just apply a (-5, -5) to ‘reverse’ it. I guess you would have to to (-5-currentForceX, -5-currentForceY). Is this what you wanted to do? [import]uid: 147305 topic_id: 26893 reply_id: 109154[/import]

Sorry I will try and be a bit clearer

Imagine a scenario of an apple falling from a tree. In that case gravity and force in the main is affecting the y axis. The apple falls from the tree to the ground let coronasdk / box2d handle the movement.

Onenterframe I would have stored all apples movements such as y, x and rotation so in theory I can iterate through the stored / plotted coordinates do apple goes back on tree.

If I were to apply an impulse at the end to give an effect of it being pushed past it’s origin an impulse on the y sends it back to the ground and not as expected into the air.

Is the manual manipulation throwing out the implied physics on the object? [import]uid: 103970 topic_id: 26893 reply_id: 109171[/import]

Invert your Y value on the applyForce. [import]uid: 8271 topic_id: 26893 reply_id: 109180[/import]