MT4J set gravity at center of MTComponent -


i want develop application using mt4j. scenario want implement like

  1. multiple balls on screen.
  2. balls can placed using touch.

above points implemented important point have faced 3. gravity @ center of container balls attracted toward center.

please me out how implement center of gravity ? ball attracted towards center.

hope understand want know if don not me please let know share more details.

sure. first thing recommend check out example "physics playground" application comes mt4j. show how assign physical bodies components, , how set physics simulation engine jbox2d. have feeling have done that, wanted sure :)

so, question. shouldn't think problem in terms of gravity rather joints. joints allow 1 component affect physical behavior of component, , that's looking for. try creating invisible, static, non-collide-able component in center of container, , add (and remove) joints component balls moving around screen.

specifically, check out distance joints in box2d manual (http://box2d.org/manual.pdf , section 8.5). want create distance joint has distance of 0, , play around dampening ratio , frequency behavior looking for.

also, if jbox2d giving problems, consider upgrading newest version. might require little debugging in mt4j source code working, can worth have more stable physics engine, more features, , up-to-date documentation corresponds code.


Comments

Popular posts from this blog

php - Submit Form Data without Reloading page -

linux - Rails running on virtual machine in Windows -

php - $params->set Array between square bracket -