erleben / OpenTissue

OpenTissue is a collection of generic algorithms and data structures for rapid development of interactive modeling and simulation.
http://www.opentissue.org
95 stars 26 forks source link

Problem with the "multibody", "multibody_cows" and "particle_system" demos #7

Closed ChristianLa91 closed 4 years ago

ChristianLa91 commented 4 years ago

Hi!

Me and my co-worker have been interested in OpenTissue for the possibility of using it in our masters thesis work -- and have been trying to make it work for quite some time now. Last week I finally made it so that CMake found everything it needed (but "dot" in boost(?), but there were at least no red markings or completely missing boost like before) and I was able to compile almost every demo after adding directories and libraries in the "Linker" settings ("Additional Library Directories" and "Input").

The problem for us is that the most important demos for our work, the "multibody", "multibody_cows" and "particle_system", still don't work. They all have similar issues, so I'm only going to focus on the "multibody" ones here.

One error we get (among many others) is: "Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int multibody" in the file "OpenTissue\dynamics\mbd\mbd_no_sleepy_policy.h" for instance.

It also complains that "group_type" isn't a member of mbd_type in the NoSleepyPolicy struct in the same file and that it "must be a class or namespace when followed by '::'".

These problems arises when we leave the "typedef retro_types::body_type body_type;" or similar rows be without commenting them out.

Do you know how to solve this for us? Would be much appreciated.

ChristianLa91 commented 4 years ago

The problem is now solved for us! Yesterday my co-worker found the solution to our problems by changing the row positions of most of the type-definitions in the mbd_types.h file so that they are above the "NodeTraitsClass", "EdgeTraitsClass" and "ConstraintTraitsClass" classes. The only typedefs left below them are "EdgeTraitsClass", "NodeTraitsClass", "ConstraintTraitsClass" and "identifier_type". I still get an environment variable issue from the function "get_environment_variable" with the variable's name being "OPENTISSUE" whenever I try to load test-environments like "falling cows" -- but as the most important test-environment for our project is the "ragdoll" one -- it works good enough for us.

erleben commented 4 years ago

Hi,

Thx for the info.

I have been recompiling OT to investigate a little more. I did not encounter the problems you described. I believe it may be due to differences in OS and compilers. Anyhow, I did a few brute force fixes to the code to make it a little more flexible. Details are in this commit.

https://github.com/erleben/OpenTissue/commit/2a1914a496d1f1cf2ee7f1dbe39435289c8c4cd1

It is not uncommon that there are differences in how strict templates are used in different compilers. I am currently using Xcode 11.6 and did not get any template compile errors. The ordering of declarations can be pretty important to some compilers.

OT can use an environment variable named OPENTISSUE to locate data in the demos. This is what the get_environment_variable call is used for. You can create this environment variable if you want to override the default behavior. You can also just hack the code to use a hard-wired path for your project.