more fixes in serialization/BVH/endianness

This commit is contained in:
ejcoumans
2007-09-19 23:04:37 +00:00
parent 287f11de01
commit a0e92efebb
3 changed files with 13 additions and 5 deletions

View File

@@ -898,10 +898,14 @@ static const unsigned BVH_ALIGNMENT_BLOCKS = 2;
unsigned int btOptimizedBvh::getAlignmentSerializationPadding()
{
return BVH_ALIGNMENT_BLOCKS * BVH_ALIGNMENT;
}
unsigned btOptimizedBvh::calculateSerializeBufferSize()
{
unsigned baseSize = sizeof(btOptimizedBvh) + BVH_ALIGNMENT_BLOCKS * BVH_ALIGNMENT;
unsigned baseSize = sizeof(btOptimizedBvh) + getAlignmentSerializationPadding();
baseSize += sizeof(btBvhSubtreeInfo) * m_subtreeHeaderCount;
if (m_useQuantization)
{

View File

@@ -344,6 +344,8 @@ public:
///deSerializeInPlace loads and initializes a BVH from a buffer in memory 'in place'
static btOptimizedBvh *deSerializeInPlace(void *i_alignedDataBuffer, unsigned i_dataBufferSize, bool i_swapEndian);
static unsigned int getAlignmentSerializationPadding();
inline bool isQuantized()
{
return m_useQuantization;