GarageGames / Torque2D

MIT Licensed Open Source version of Torque 2D game engine from GarageGames
MIT License
1.67k stars 1.56k forks source link

Updated MoveTo #287

Closed greenfire27 closed 8 years ago

greenfire27 commented 8 years ago

This causes MoveTo to function based on position rather than time. This corrects problems with objects teleporting when they don't reach their position before they are supposed to. This was most commonly happening because of the speed cap imposed by box2D. The new method works the same as before with the re-introduction of the margin as the optional last parameter. The new function is also more taxing on the engine although it is unlikely that any loss in frame rate will be seen unless hundreds of objects are being moved at the same time.