Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small fixes to allow compilation in Visual Studio 2015, and get rid of some warnings #99

Merged
merged 3 commits into from
Mar 21, 2016

Conversation

sherm1
Copy link
Member

@sherm1 sherm1 commented Mar 21, 2016

I tried building FCL on Windows 10 with Visual Studio 2015 Win64 and got a couple of compilation failures (there was a missing include and use of non-standard constant M_PI_2). This PR fixes those and allows FCL to build. However 4 or 13 tests failed -- those need to be addressed but I'm not attempting that in this PR.

There were also a few warnings when I built in Ubuntu 14.04; those are fixed here too. All tests passed there.

Some cleanup from C-like code to C++.
Fix call to deprecated method.
@@ -126,6 +125,7 @@ BOOST_AUTO_TEST_CASE(distance_capsulecapsule_transformZ)

BOOST_AUTO_TEST_CASE(distance_capsulecapsule_transformZ2)
{
const FCL_REAL Pi = std::acos(FCL_REAL(-1.0));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer either using boost::math::constants::pi or defining M_PI if not defined.
{{{
#ifndef M_PI
#define M_PI 3.1415926535....
#endif
}}}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was trying to fix what appeared to be incorrect use of floating point type. Using macros for constants means they will be untyped and might not convert properly to FCL_REAL. I took a look at boost::pi and can't figure out what type it is! I don't think it is a good idea to have the digits of pi included here -- there must be a better way! What would you suggest as the proper way to get a "pi" of type FCL_REAL?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I see -- it's a template function. I'll use it.

@sherm1
Copy link
Member Author

sherm1 commented Mar 21, 2016

@isucan -- I replaced the calculated pi with the boost version.

isucan added a commit that referenced this pull request Mar 21, 2016
Small fixes to allow compilation in Visual Studio 2015, and get rid of some warnings
@isucan isucan merged commit ebb6d3d into flexible-collision-library:master Mar 21, 2016
@isucan
Copy link
Contributor

isucan commented Mar 21, 2016

Thanks!

@jslee02 jslee02 added this to the FCL 0.5.0 milestone Mar 21, 2016
@sherm1 sherm1 deleted the fix-vs2015-compile branch March 23, 2016 04:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants