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

macOS compatibility #123

Closed ruberith closed 1 year ago

ruberith commented 2 years ago

These adaptations allow builds using Clang on recent versions of macOS (tested on Apple silicon):

amirhmk commented 2 years ago

Hi @ruberith, thank you for getting this to work on Mac! I'm a noob in C++, could you please tell me how you build and run the demos on MacOS? (M1 as well).

I can successfully generate the makefiles using cmake and build on the terminal, but I don't see any executables for the demos...

Which compiler do you use? GCC or clang (Apple's own version)

EDIT: Actually I found the executables in the bin folder. However, when I run the ClothDemo for example, the TweekBar is very small and hard to interact with. The rendering isn't super smooth either, is that to be expected?

See screenshot below:

Screen Shot 2022-04-14 at 12 50 18 PM
ruberith commented 2 years ago

If you hover over the TweakBar, you can find a small button at the top left to toggle between a few sizes. The bar also has an option to reduce the # time steps / update of the visualization.

ruberith commented 2 years ago

I previously did not notice the incorrect rendering of the bar, as I had an external monitor connected. Thank you for mentioning that issue, @amirhmk. AntTweakBar does not seem to handle the Framebuffer scale on Retina displays well, so the last commit should fix that.