(Since Julio has incorporated these changes into the source, you can disregard the following section):
First, you have to make some small changes to "core/dgTypes.h".
Find this code:
- Code: Select all
#if !(defined (__USE_DOUBLE_PRECISION__) || defined (__ppc__))
#define DG_BUILD_SIMD_CODE
#endif
Replace it with this:
- Code: Select all
#if !(defined (__USE_DOUBLE_PRECISION__) || defined (__ppc__) || defined (ANDROID) || defined (IOS))
#define DG_BUILD_SIMD_CODE
#endif
Find this code:
- Code: Select all
#ifdef _POSIX_VER
#include <unistd.h>
#include <assert.h>
// using SSE2
extern "C"
{
// for SSE3 and up
// #include <pmmintrin.h>
// #include <immintrin.h>
// #include <smmintrin.h>
#include <emmintrin.h>
#include <mmintrin.h>
}
#endif
Replace it with this:
- Code: Select all
#ifdef _POSIX_VER
#include <unistd.h>
#include <assert.h>
#ifdef DG_BUILD_SIMD_CODE
// using SSE2
extern "C"
{
// for SSE3 and up
// #include <pmmintrin.h>
// #include <immintrin.h>
// #include <smmintrin.h>
#include <emmintrin.h>
#include <mmintrin.h>
}
#endif
#endif
==BEGIN HERE==
Once you have made those changes, it's just a matter of defining the right preprocessor directives for each platform:
OSX
_MAC_VER
_MAC_VER_64
_POSIX_VER
_POSIX_VER_64
DG_THREAD_EMULATION (required as of now, or your application will stop in the NewtonUpdate() function)
_NEWTON_USE_LIB
_NEWTON_STATIC_LIB
iOS
_MAC_VER
_MAC_VER_64
_POSIX_VER
_POSIX_VER_64
DG_THREAD_EMULATION
_NEWTON_USE_LIB
_NEWTON_STATIC_LIB
IOS
Android
_POSIX_VER
_POSIX_VER_64
DG_THREAD_EMULATION
_NEWTON_USE_LIB
_NEWTON_STATIC_LIB
(ANDROID is automatically defined)
Windows
PTW32_STATIC_LIB
DG_USE_NORMAL_PRIORITY_THREAD
_NEWTON_USE_LIB
_NEWTON_STATIC_LIB
Add all Newton .cpp files in the "core", "meshutil", "newton", and "physics" folders to your project, except the file "dgVehicleConstraint.cpp". Add header search paths for each of the four subdirectories, and you're ready to go!
Windows Only
On Windows, there is one extra step. You also need to include the pthreads library, found in "packages/thirdparty/pthreads.2".
-Add "pthreads.c" to your project. You don't need to add any of the other .c files.
-Add the header include directory "packages/thirdparty/pthreads.2".