InteractiveComputerGraphics / PositionBasedDynamics

PositionBasedDynamics is a library for the physically-based simulation of rigid bodies, deformable solids and fluids.
MIT License
1.89k stars 358 forks source link

Reference implementation #91

Closed EelcoHoogendoorn closed 2 years ago

EelcoHoogendoorn commented 3 years ago

Hi, and first of thanks for the interesting code contained in this repo.

I cam here hoping to find a reference implementation of 'Detailed Rigid Body Simulation with Extended Position Based Dynamics', a work that you also seem to have been involved in.

I believed that I had found that in 'PositionBasedRigidBodyDynamics.cpp'. However, the log show that most of the code there significantly predates the publication date of the paper. That kind of thing happens I suppose, but it made my question if I am missing something. Can the code in this file be considered a reference implementation, or are there key differences that my cursory reading missed?

Thanks for the help!

korzen commented 3 years ago

Have a look here https://matthias-research.github.io/pages/challenges/bodyChainPBD.html for a demo. A partial reference code is in PBD.js.

EelcoHoogendoorn commented 3 years ago

Thanks; indeed that does seem to be a more recent piece of code, and is also looking informative; but seems to contain a smaller subset of functionality.

I suppose matthias is not employed to write papers so it makes sense his work does not always make it quickly into a paper; I can relate to that, and I do appreciate the info that we do get.

The reason I am asking is because I wanted to try and see if I could extend the XPBD rigid body logic, with flexible bodies based on a modal approximation; without reinventing too many wheels. Im thinking this might be fairly straightforward; if you think of translations and rotations as simply being the zero-order modes of a flexible body.

For the sake of trying this out and debugging just writing a little 2d implementation myself might be the simplest option tho, if no such thing exists.