Search code examples
androidgame-physicsandenginephysics-engine

AndEngine physics joint


I use AndEngine for Android,

when i create a scene i place there two physics objects, and i want them to be always at the same distance when they are moving.

I tried to use DistanceJoint, but i cant understand how to set length of it. This length is not in pixels... I want to set: distancejoint.length = "distance between objects in scene initialization".


Solution

  • Every value (especially positions) needs to be divided by: PhysicsConstants.PIXEL_TO_METER_RATIO_DEFAULT.