|
From: <kw...@us...> - 2006-07-06 00:34:37
|
Revision: 1002 Author: kwizatz Date: 2006-07-05 17:34:30 -0700 (Wed, 05 Jul 2006) ViewCVS: http://svn.sourceforge.net/opende/?rev=1002&view=rev Log Message: ----------- Added Cross compilation patch Modified Paths: -------------- trunk/configure.in trunk/ode/src/convex.cpp Modified: trunk/configure.in =================================================================== --- trunk/configure.in 2006-07-05 03:26:14 UTC (rev 1001) +++ trunk/configure.in 2006-07-06 00:34:30 UTC (rev 1002) @@ -98,6 +98,8 @@ dnl DOUBLE was chosen AC_DEFINE(dDOUBLE,,[Use double precision]) dnl Check from lest likelly to more likelly. +if test "$build_os" == "$target_os" +then AC_TRY_RUN([ #define dInfinity 1e20 int main() @@ -137,9 +139,15 @@ } ],dinfinity=DBL_MAX,,) else +#cross-compiling, use a reasonable value. We should add an option for setting this. +dinfinity=DBL_MAX +fi +else dnl default to SINGLE. AC_DEFINE(dSINGLE,,[Use single precision]) dnl Check from lest likelly to more likelly. +if test "$build_os" == "$target_os" +then AC_TRY_RUN([ #define dInfinity 1e20f int main() @@ -178,7 +186,10 @@ else return -1; } ],dinfinity=FLT_MAX,,) +#cross-compiling, use a reasonable value. We should add an option for setting this. +dinfinity=FLT_MAX fi +fi AC_MSG_RESULT($precision) AC_DEFINE_UNQUOTED(dInfinity,${dinfinity},[dInfinity Constant]) AC_MSG_CHECKING(for appropriate dInfinity constant) @@ -209,6 +220,8 @@ dnl Check for PENTIUM +if test "$build_os" == "$target_os" +then AC_MSG_CHECKING(for a Pentium CPU) AC_TRY_RUN([ int main() @@ -218,6 +231,9 @@ return 0; }; ],pentium=yes,pentium=no,) +else +pentium=no +fi if test "x$pentium" == xyes then AC_DEFINE(PENTIUM,1,[is this a pentium on a gcc-based platform?]) @@ -226,6 +242,8 @@ dnl Check for 64bit CPU AC_MSG_CHECKING(for a x86-64 CPU) +if test "$build_os" == "$target_os" +then AC_TRY_RUN([ int main() { @@ -237,6 +255,9 @@ return 0; }; ],cpu64=yes,cpu64=no,) +else +cpu64=no +fi if test "x$cpu64" == xyes then AC_DEFINE(X86_64_SYSTEM,1,[is this a X86_64 system on a gcc-based platform?]) @@ -383,12 +404,15 @@ dnl Check for autoscan sugested functions AC_CHECK_FUNCS([floor memmove memset select sqrt sqrtf sinf cosf fabsf atan2f fmodf copysignf copysign snprintf vsnprintf gettimeofday isnan isnanf _isnan _isnanf __isnan __isnanf]) +if test "$build_os" == "$target_os" +then AC_FUNC_ALLOCA AC_FUNC_MALLOC AC_FUNC_OBSTACK AC_FUNC_REALLOC AC_FUNC_SELECT_ARGTYPES AC_FUNC_VPRINTF +fi dnl include found system headers into config.h AH_TOP([ Modified: trunk/ode/src/convex.cpp =================================================================== --- trunk/ode/src/convex.cpp 2006-07-05 03:26:14 UTC (rev 1001) +++ trunk/ode/src/convex.cpp 2006-07-06 00:34:30 UTC (rev 1002) @@ -1025,6 +1025,7 @@ if(max2<min1 || max1 < min2) return 0; else if(contacts<maxc) { + // This aint right CONTACT(contact,skip*contacts)->normal[0] = plane[0]; CONTACT(contact,skip*contacts)->normal[1] = plane[1]; CONTACT(contact,skip*contacts)->normal[2] = plane[2]; @@ -1034,6 +1035,18 @@ CONTACT(contact,skip*contacts)->g1 = &cvx2; CONTACT(contact,skip*contacts)->g2 = &cvx1; contacts++; + fprintf(stdout, + "Contact Info:\n" + "Normal %f,%f,%f\n" + "Position %f,%f,%f\n" + "Depth %f\n", + CONTACT(contact,skip*contacts)->normal[0], + CONTACT(contact,skip*contacts)->normal[1], + CONTACT(contact,skip*contacts)->normal[2], + CONTACT(contact,skip*contacts)->pos[0], + CONTACT(contact,skip*contacts)->pos[1], + CONTACT(contact,skip*contacts)->pos[2], + CONTACT(contact,skip*contacts)->depth); } } // Test faces of cvx2 for separation This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |