diff options
author | Erwin Coumans <blender@erwincoumans.com> | 2011-03-12 23:34:17 +0300 |
---|---|---|
committer | Erwin Coumans <blender@erwincoumans.com> | 2011-03-12 23:34:17 +0300 |
commit | 5e374328a87c1b418f8454d5ef38470484804961 (patch) | |
tree | 1d6de85165175c5192f74dbd423e1d5cb48f8ff6 /extern/bullet2/src/LinearMath/btAlignedObjectArray.h | |
parent | 8c526e79e31d40d56a6fecce9343c74bd9fe62d8 (diff) |
update Bullet physics sdk to latest trunk/version 2.78
add PhysicsConstraints.exportBulletFile(char* fileName) python command
I'll be checking the bf-committers mailing list, in case this commit broke stuff
scons needs to be updated, I'll do that in a second.
Diffstat (limited to 'extern/bullet2/src/LinearMath/btAlignedObjectArray.h')
-rw-r--r-- | extern/bullet2/src/LinearMath/btAlignedObjectArray.h | 35 |
1 files changed, 32 insertions, 3 deletions
diff --git a/extern/bullet2/src/LinearMath/btAlignedObjectArray.h b/extern/bullet2/src/LinearMath/btAlignedObjectArray.h index bad1eee1f63..955bb128e83 100644 --- a/extern/bullet2/src/LinearMath/btAlignedObjectArray.h +++ b/extern/bullet2/src/LinearMath/btAlignedObjectArray.h @@ -138,6 +138,16 @@ class btAlignedObjectArray return m_size; } + SIMD_FORCE_INLINE const T& at(int n) const + { + return m_data[n]; + } + + SIMD_FORCE_INLINE T& at(int n) + { + return m_data[n]; + } + SIMD_FORCE_INLINE const T& operator[](int n) const { return m_data[n]; @@ -171,9 +181,9 @@ class btAlignedObjectArray { int curSize = size(); - if (newsize < size()) + if (newsize < curSize) { - for(int i = curSize; i < newsize; i++) + for(int i = newsize; i < curSize; i++) { m_data[i].~T(); } @@ -195,6 +205,18 @@ class btAlignedObjectArray m_size = newsize; } + SIMD_FORCE_INLINE T& expandNonInitializing( ) + { + int sz = size(); + if( sz == capacity() ) + { + reserve( allocSize(size()) ); + } + m_size++; + + return m_data[sz]; + } + SIMD_FORCE_INLINE T& expand( const T& fillValue=T()) { @@ -384,7 +406,7 @@ class btAlignedObjectArray int findBinarySearch(const T& key) const { int first = 0; - int last = size(); + int last = size()-1; //assume sorted array while (first <= last) { @@ -437,6 +459,13 @@ class btAlignedObjectArray m_capacity = capacity; } + void copyFromArray(const btAlignedObjectArray& otherArray) + { + int otherSize = otherArray.size(); + resize (otherSize); + otherArray.copy(0, otherSize, m_data); + } + }; #endif //BT_OBJECT_ARRAY__ |