Search code examples
game-physics

Force-based graph: 3D edge collision


Imagine a moving 3D force-based graph with colliding edges. How easy it is to write a specific physics engine for calculating edge (strings, ropes) collision so that every object would behave like in a real world? Strings should bend, nodes should repulse each other, etc. Accuracy beyond visual recognition as "looks real" doesn't matter, it's a game.

Edit: Maybe I forgot to mention, that approximating edges as multi-segmented strings is the only option I can think of.

And yes, would it be possible to scale such physics to hundreds or thousands of edges?


Solution

  • Physics engines have a lot of minor details in them to ensure that the end result 'looks real'. I would not recommend coding one unless you are looking to learn. Start with something that works and is free, such as Bullet Physics.

    Besides, then you get to spend less time coding a physics engine and more time coding a game. Win-Win.

    EDIT:

    If you really want to program your own however, take a look at Real Time Collision Detection, which is pretty definitive information on the subject.