- Added serialization to btBvhTriangleMeshShape/btOptimizedBvh. See ConcaveDemo for example usage.

- added bt32BitAxisSweep3, which co-exists without recompilation, using template class. This broadphase is recommended for large worlds with many objects (> 16384), until btMultiSwap is finished.
- Fixed some recent issues in Bullet 2.57 related to compound (thanks Proctoid) and memory allocations
This commit is contained in:
ejcoumans
2007-09-10 01:14:42 +00:00
parent e1c037b4c2
commit b054f375bc
20 changed files with 1585 additions and 810 deletions

View File

@@ -403,4 +403,58 @@ public:
};
///btSwapVector3Endian swaps vector endianness, useful for network and cross-platform serialization
SIMD_FORCE_INLINE void btSwapVector3Endian(const btVector3& source, btVector3& dest)
{
#ifdef BT_USE_DOUBLE_PRECISION
unsigned long long int tmp;
tmp = btSwapDouble(source.getX());
dest.setXValueByLongInt(tmp);
tmp = btSwapDouble(source.getY());
dest.setYValueByLongInt(tmp);
tmp = btSwapDouble(source.getZ());
dest.setZValueByLongInt(tmp);
tmp = btSwapDouble(source[3]);
dest.setWValueByLongInt(tmp);
#else
unsigned int tmp;
tmp = btSwapEndianFloat(source.getX());
dest.setXValueByInt(tmp);
tmp = btSwapEndianFloat(source.getY());
dest.setYValueByInt(tmp);
tmp = btSwapEndianFloat(source.getZ());
dest.setZValueByInt(tmp);
tmp = btSwapEndianFloat(source[3]);
dest.setWValueByInt(tmp);
#endif //BT_USE_DOUBLE_PRECISION
}
///btUnSwapVector3Endian swaps vector endianness, useful for network and cross-platform serialization
SIMD_FORCE_INLINE void btUnSwapVector3Endian(btVector3& vector)
{
#ifdef BT_USE_DOUBLE_PRECISION
unsigned long long int tmp;
tmp = vector.getLongIntXValue();
vector.setX( btUnswapDouble(tmp));
tmp = vector.getLongIntYValue();
vector.setY( btUnswapDouble(tmp));
tmp = vector.getLongIntZValue();
vector.setZ( btUnswapDouble(tmp));
tmp = vector.getLongIntWValue();
vector[3] = btUnswapDouble(tmp);
#else
unsigned int tmp;
tmp = vector.getIntXValue();
vector.setX( btUnswapEndianFloat(tmp));
tmp = vector.getIntYValue();
vector.setY( btUnswapEndianFloat(tmp));
tmp = vector.getIntZValue();
vector.setZ( btUnswapEndianFloat(tmp));
tmp = vector.getIntWValue();
vector[3] = btUnswapEndianFloat(tmp);
#endif //BT_USE_DOUBLE_PRECISION
}
#endif //SIMD__VECTOR3_H