Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 31, 2009, 8:05:51 PM (15 years ago)
Author:
rgrieder
Message:

Update from Bullet 2.73 to 2.74.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/bullet/LinearMath/btAlignedObjectArray.h

    r2662 r2882  
    5959                        return (size ? size*2 : 1);
    6060                }
    61                 SIMD_FORCE_INLINE       void    copy(int start,int end, T* dest)
     61                SIMD_FORCE_INLINE       void    copy(int start,int end, T* dest) const
    6262                {
    6363                        int i;
     
    121121                }
    122122
    123                 SIMD_FORCE_INLINE       int capacity() const
    124                 {       // return current length of allocated storage
    125                         return m_capacity;
    126                 }
    127                
     123                ///Generally it is best to avoid using the copy constructor of an btAlignedObjectArray, and use a (const) reference to the array instead.
     124                btAlignedObjectArray(const btAlignedObjectArray& otherArray)
     125                {
     126                        init();
     127
     128                        int otherSize = otherArray.size();
     129                        resize (otherSize);
     130                        otherArray.copy(0, otherSize, m_data);
     131                }
     132
     133               
     134               
     135                /// return the number of elements in the array
    128136                SIMD_FORCE_INLINE       int size() const
    129                 {       // return length of sequence
     137                {       
    130138                        return m_size;
    131139                }
     
    142150               
    143151
     152                ///clear the array, deallocated memory. Generally it is better to use array.resize(0), to reduce performance overhead of run-time memory (de)allocations.
    144153                SIMD_FORCE_INLINE       void    clear()
    145154                {
     
    157166                }
    158167
     168                ///resize changes the number of elements in the array. If the new size is larger, the new elements will be constructed using the optional second argument.
     169                ///when the new number of elements is smaller, the destructor will be called, but memory will not be freed, to reduce performance overhead of run-time memory (de)allocations.
    159170                SIMD_FORCE_INLINE       void    resize(int newsize, const T& fillData=T())
    160171                {
     
    220231
    221232       
     233                /// return the pre-allocated (reserved) elements, this is at least as large as the total number of elements,see size() and reserve()
     234                SIMD_FORCE_INLINE       int capacity() const
     235                {       
     236                        return m_capacity;
     237                }
    222238               
    223239                SIMD_FORCE_INLINE       void reserve(int _Count)
Note: See TracChangeset for help on using the changeset viewer.