diff options
author | Sergej Reich <sergej.reich@googlemail.com> | 2012-06-08 20:13:01 +0400 |
---|---|---|
committer | Sergej Reich <sergej.reich@googlemail.com> | 2012-06-08 20:13:01 +0400 |
commit | 82d3d9f2ba47bbf2f868b5a970d1fe149eba13e2 (patch) | |
tree | e99d947080f8e787059d86500f01dd6c1ad616e4 /extern/bullet2/src/LinearMath/btScalar.h | |
parent | 221a7878223e983372ba830e4ca1a17067abf2ba (diff) |
Update Bullet to version 2.80 (bullet svn revision 2537)
Remove Jamfiles and other unused files that stuck around during previous updates.
Add patches for local changes to the patches directory.
Update readme.txt, it had outdated infromation.
Diffstat (limited to 'extern/bullet2/src/LinearMath/btScalar.h')
-rw-r--r-- | extern/bullet2/src/LinearMath/btScalar.h | 37 |
1 files changed, 30 insertions, 7 deletions
diff --git a/extern/bullet2/src/LinearMath/btScalar.h b/extern/bullet2/src/LinearMath/btScalar.h index 6ba6c5ad30d..ecae972243c 100644 --- a/extern/bullet2/src/LinearMath/btScalar.h +++ b/extern/bullet2/src/LinearMath/btScalar.h @@ -14,8 +14,8 @@ subject to the following restrictions: -#ifndef SIMD___SCALAR_H -#define SIMD___SCALAR_H +#ifndef BT_SCALAR_H +#define BT_SCALAR_H #ifdef BT_MANAGED_CODE //Aligned data types not supported in managed code @@ -25,12 +25,10 @@ subject to the following restrictions: #include <math.h> #include <stdlib.h>//size_t for MSVC 6.0 -#include <cstdlib> -#include <cfloat> #include <float.h> -/* SVN $Revision: 35500 $ on $Date: 2011-03-12 21:34:17 +0100 (Sat, 12 Mar 2011) $ from http://bullet.googlecode.com*/ -#define BT_BULLET_VERSION 278 +/* SVN $Revision$ on $Date$ from http://bullet.googlecode.com*/ +#define BT_BULLET_VERSION 280 inline int btGetVersion() { @@ -521,4 +519,29 @@ struct btTypedObject return m_objectType; } }; -#endif //SIMD___SCALAR_H + + + +///align a pointer to the provided alignment, upwards +template <typename T>T* btAlignPointer(T* unalignedPtr, size_t alignment) +{ + + struct btConvertPointerSizeT + { + union + { + T* ptr; + size_t integer; + }; + }; + btConvertPointerSizeT converter; + + + const size_t bit_mask = ~(alignment - 1); + converter.ptr = unalignedPtr; + converter.integer += alignment-1; + converter.integer &= bit_mask; + return converter.ptr; +} + +#endif //BT_SCALAR_H |