Git Product home page Git Product logo

relocate-engine's People

Contributors

ashe avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

relocate-engine's Issues

Tweening rotation causes infinite angles

Issue

When the following code is uncommented and used instead of the replacement code, t->rotation changes even though body->GetAngle() does not. When using warpTo and thus setting the body as out of sync, this being called multiple times due to the mouse being held down causes an exponential increase. When this is then set back into the b2Bodys rotation inside the sync function as infinity, the body disappears (presumably because it's spinning too fast to render).

The resetting is not the problem, the problem lies in the fact that when tweened, t->rotation is yielding values which change over time by a significant amount even when the body is stationary.

https://github.com/Ashe/inProgress/blob/0a137be125e8d35b8935f405ebc4cfa827da726d/src/PhysicsSystem.cpp#L149

What we know

When rotating a box 90 degrees (~1.57 radians), t->rotation would start at 180 degrees and tick downwards (or upwards if it was rotated to -90 degrees). When it crossed the value in body->GetAngle(), it would reset back to 180 degrees. Put simply, t->rotation changes an entire 90 degrees before restarting the cycle.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.