jbox2d Body and applyForce function

56 views
Skip to first unread message

André Moraes

unread,
Sep 6, 2011, 10:32:42 AM9/6/11
to PlayN
Hi,

I started to make changes to the showcase source code to adapt it to
my space ship test project.

The function applyForce from the jbox2d.Body class receives two
parameters: a vector force and a point.

The doc says that if the point is not the center of mass from the
object, the given object will receive a torque, I made the point of
application a little to the left side of the mass-center but the
object dont get any torque and just movements according to the force
vector.

Somebody did something similar to that?

Philip Rogers

unread,
Sep 6, 2011, 10:53:53 AM9/6/11
to pl...@googlegroups.com
Hi André,

I haven't run into this specific problem, but you may find an example of torque in the jbox2d testbed examples:

Pablo Ruggia compiled these samples using gwtbox2d into a nice showcase sample here:
http://gwtbox2d.appspot.com (I suspect the Theo Jansen walker may have a torque component)

Philip

André Moraes

unread,
Sep 6, 2011, 12:32:40 PM9/6/11
to pl...@googlegroups.com
Since the PlayN showcase don't have too much physics examples, I used
the samples that you pointed before asking questions here.

The code that update the force/torque of the object is copy/paste from
the ApplyForce.java from gwtbox2d. I think is something related to the
integration with PlayN rendering that I am missing on my code.

Rigth now I don't have the source code to post on pastebin or
something like that, when I get home I will post the code and place
the link here.

Thanks for the fast replay.

--
André Moraes
http://andredevchannel.blogspot.com/

Reply all
Reply to author
Forward
0 new messages