AntonSynytsia / MSPhysics

A NewtonDynamics wrapper for SketchUp.
http://sketchucation.com/forums/viewtopic.php?f=323&t=56852#p516427
MIT License
55 stars 20 forks source link

Unable to compile in MacOS #16

Open MrPrezident opened 5 years ago

MrPrezident commented 5 years ago

I had to make the following changes to get msp_lib to link properly: https://github.com/MrPrezident/MSPhysics/commit/0e6c4c458ae9765fc6e3561b15ac72a0be89d418

However, even after those changes, the extension is loading, but it is not working. I'm seeing these errors in the Ruby Console when trying to run a simulation:

Entity at index 0 was not added to simulation:
TypeError:
Entity #<Sketchup::ComponentInstance:0x007f96fd813968> doesn't have any valid sub-collisions, making it an invalid compound collision!
/Users/nathan/Library/Application Support/SketchUp 2018/SketchUp/Plugins/MSPhysics/collision.rb:76:in `create'
/Users/nathan/Library/Application Support/SketchUp 2018/SketchUp/Plugins/MSPhysics/body.rb:155:in `initialize'
/Users/nathan/Library/Application Support/SketchUp 2018/SketchUp/Plugins/MSPhysics/simulation.rb:792:in `new'
/Users/nathan/Library/Application Support/SketchUp 2018/SketchUp/Plugins/MSPhysics/simulation.rb:792:in `add_group'
/Users/nathan/Library/Application Support/SketchUp 2018/SketchUp/Plugins/MSPhysics/simulation.rb:3207:in `block in activate'
/Users/nathan/Library/Application Support/SketchUp 2018/SketchUp/Plugins/MSPhysics/simulation.rb:3193:in `each'
/Users/nathan/Library/Application Support/SketchUp 2018/SketchUp/Plugins/MSPhysics/simulation.rb:3193:in `activate'
/Users/nathan/Library/Application Support/SketchUp 2018/SketchUp/Plugins/MSPhysics/simulation.rb:30:in `select_tool'
/Users/nathan/Library/Application Support/SketchUp 2018/SketchUp/Plugins/MSPhysics/simulation.rb:30:in `start'
/Users/nathan/Library/Application Support/SketchUp 2018/SketchUp/Plugins/MSPhysics/main.rb:809:in `block in <top (required)>'
SketchUp:1:in `call'
Error: #<NameError: uninitialized constant AMS::ClothWorks>
/Users/nathan/Library/Application Support/SketchUp 2018/SketchUp/Plugins/MSPhysics/control_panel.rb:129:in `open'
/Users/nathan/Library/Application Support/SketchUp 2018/SketchUp/Plugins/MSPhysics/simulation.rb:3318:in `activate'
/Users/nathan/Library/Application Support/SketchUp 2018/SketchUp/Plugins/MSPhysics/simulation.rb:30:in `select_tool'
/Users/nathan/Library/Application Support/SketchUp 2018/SketchUp/Plugins/MSPhysics/simulation.rb:30:in `start'
/Users/nathan/Library/Application Support/SketchUp 2018/SketchUp/Plugins/MSPhysics/main.rb:809:in `block in <top (required)>'
SketchUp:1:in `call'
AntonSynytsia commented 5 years ago

The first error is normal. The second error was a typo, which I fixed in newer commit. The Mac OS X linking, is something that I guess must be updated. I'll into it.

AntonSynytsia commented 5 years ago

I have fixed the Mac OS X solution but I see that resetting simulation leads to a crash. I think the issue is related to multi-threading, which is on TODO, but I'm not sure since I explicitly forced newton to use one thread at the moment.

Also, the first error you see, is normal and is handled by MSPhysics. It occurs whenever a group or a component added to simulation is flat. All other errors are typos and are I am fixing them.