I'm developing a simple, 2D physics system to complement an entity/component game object framework. So far, I have implemented some basic, tutorial-level physics. An entity that is affected by physics must have two components:

  • Transform (translation, rotation, scale; may have parent transform)
  • Rigidbody (mass, list of forces)

The physics engine currently uses Verlet integration to move entities - that is, velocity is derived from the current and previous positions of an entity, and is not explicitly stated anywhere.

I would now like to start implementing some joints, starting with the basics and perhaps expanding as I grow more familiar with the concepts.

The first joint I attempted to implement was extremely simple - the fixed joint, whereby two entities are 'fixed' together and their transforms may not change relative to each other. My approach was to make one entity an immovable child of the other - that is, to set the transform of A as a local transform relative to B and disable movement of A by passing all accumulated forces of the rigidbody of A to the parent, B. Already this seems hackish and inflexible and has issues with gravity (B ends up with two gravity forces acting on it) - I'm clearly heading in the wrong direction.

I have searched for some literature on the subject but have only found either very basic tutorials that only cover what I've already done, or articles with advanced mathematical formulae that are difficult to follow or relate to simulation in any meaningful way.

This leads to two questions:

  1. How are fixed joints normally implemented?
  2. Are there any good 2D physics simulation tutorials aimed at those without a degree in physics or mathematics?

1 Answer 1


This article ("Advanced Character Physics" by Thomas Jakobsen, with a PDF mirror here that preserves images) discusses solving fixed distance constraints (which sound to me like your fixed joints) between particles by relaxation -- specifically you want the section "Solving several concurrent constraints by relaxation" on page 2, I think -- treating the constraints as infinitely stiff springs. I found this article approachable enough years ago when I was implementing something similar, so hopefully it will have what you need.

A relevant passage:

One may think of this process as inserting infinitely stiff springs between the particle and the penetration surface – springs that are exactly so strong and suitably damped that instantly they will attain their rest length zero. We now extend the experiment to model a stick of length 100. We do this by setting up two individual particles (with positions x1 and x2) and then require them to be a distance of 100 apart. Expressed mathematically, we get the following bilateral (equality) constraint: |x2 - x1| = 100.

Although the particles might be correctly placed initially, after one integration step the separation distance between them might have become invalid. In order to obtain the correct distance once again, we move the particles by projecting them onto the set of solutions described by [the above equality constraint]. This is done by pushing the particles directly away from each other or by pulling them closer together (depending on whether the erroneous distance is too small or too large).

This page appears to have source code of a concrete example, although I'm not sure of its quality.

  • \$\begingroup\$ Exactly what I was looking for. +1 and more if I could. Thank you! \$\endgroup\$
    – Alex
    Commented Oct 3, 2011 at 23:40
  • 1
    \$\begingroup\$ "This article" seems to be broken -.- \$\endgroup\$
    – super
    Commented Aug 25, 2014 at 17:43
  • 1
    \$\begingroup\$ @Murplyx It totally was; this is why we now warn users against exactly these sort of link-only answers. I found two more mirrors (one that preserves images) and yanked what I recall to be the key passage from the documentation. Feel free to suggest further edits if you think it needs more clarification. \$\endgroup\$
    – user1430
    Commented Aug 25, 2014 at 18:00
  • \$\begingroup\$ New link to the article: gamedeveloper.com/programming/advanced-character-physics \$\endgroup\$
    – saud
    Commented May 17, 2022 at 17:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .