use size_t instead of int, for allocator
added hashtable based PairManager, thanks Pierre Terdiman and Erin Catto improved friction in 'cachefriendly' solver moved 'refreshcontactpoints' into collision detection, instead of solver avoid linear search for contact manifolds, by storing an index ignore margin for sphere shape (its entire radius is already margin) avoid alignment checks in BVH serialization, they don't compile on 64-bit architectures made 'bomb' box more heavy
This commit is contained in:
@@ -19,7 +19,7 @@ subject to the following restrictions:
|
||||
#if defined (BT_HAS_ALIGNED_ALOCATOR)
|
||||
|
||||
#include <malloc.h>
|
||||
void* btAlignedAlloc (int size, int alignment)
|
||||
void* btAlignedAlloc (size_t size, int alignment)
|
||||
{
|
||||
void* ptr = _aligned_malloc(size,alignment);
|
||||
// printf("btAlignedAlloc %d, %x\n",size,ptr);
|
||||
@@ -41,7 +41,7 @@ void btAlignedFree (void* ptr)
|
||||
int numAllocs = 0;
|
||||
int numFree = 0;
|
||||
|
||||
void* btAlignedAlloc (int size, int alignment)
|
||||
void* btAlignedAlloc (size_t size, int alignment)
|
||||
{
|
||||
numAllocs++;
|
||||
return memalign(alignment, size);
|
||||
@@ -55,7 +55,7 @@ void btAlignedFree (void* ptr)
|
||||
|
||||
#else
|
||||
|
||||
void* btAlignedAlloc (int size, int alignment)
|
||||
void* btAlignedAlloc (size_t size, int alignment)
|
||||
{
|
||||
void *ret;
|
||||
char *real;
|
||||
|
||||
@@ -22,7 +22,7 @@ subject to the following restrictions:
|
||||
|
||||
#include "btScalar.h"
|
||||
|
||||
void* btAlignedAlloc (int size, int alignment);
|
||||
void* btAlignedAlloc (size_t size, int alignment);
|
||||
|
||||
void btAlignedFree (void* ptr);
|
||||
|
||||
|
||||
@@ -61,6 +61,17 @@ public:
|
||||
return result;
|
||||
}
|
||||
|
||||
bool validPtr(void* ptr)
|
||||
{
|
||||
if (ptr) {
|
||||
if (((unsigned char*)ptr >= m_pool && (unsigned char*)ptr < m_pool + m_maxElements * m_elemSize))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void free(void* ptr)
|
||||
{
|
||||
if (ptr) {
|
||||
|
||||
@@ -288,6 +288,13 @@ SIMD_FORCE_INLINE float btSelect(unsigned condition, float valueIfConditionNonZe
|
||||
#endif
|
||||
}
|
||||
|
||||
template<typename T> inline void btSwap(T& a, T& b)
|
||||
{
|
||||
T tmp = a;
|
||||
a = b;
|
||||
b = tmp;
|
||||
}
|
||||
|
||||
|
||||
//PCK: endian swapping functions
|
||||
SIMD_FORCE_INLINE unsigned btSwapEndian(unsigned val)
|
||||
|
||||
Reference in New Issue
Block a user