added serialization support for gimpact mesh

improved cmake build system for updating the serialization structures
This commit is contained in:
erwin.coumans
2010-01-29 02:50:34 +00:00
parent 701bc64ab7
commit 37f6df2c32
25 changed files with 721 additions and 459 deletions

View File

@@ -42,6 +42,7 @@
#include "bullet_btCompoundShapeData.h"
#include "bullet_btCylinderShapeData.h"
#include "bullet_btCapsuleShapeData.h"
#include "bullet_btGImpactMeshShapeData.h"
#include "bullet_btConvexHullShapeData.h"
#include "bullet_btCollisionObjectDoubleData.h"
#include "bullet_btCollisionObjectFloatData.h"

View File

@@ -49,6 +49,7 @@ namespace Bullet {
class btCompoundShapeData;
class btCylinderShapeData;
class btCapsuleShapeData;
class btGImpactMeshShapeData;
class btConvexHullShapeData;
class btCollisionObjectDoubleData;
class btCollisionObjectFloatData;

View File

@@ -0,0 +1,46 @@
/* Copyright (C) 2006-2009 Erwin Coumans & Charlie C
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
*/
// Auto generated from makesdna dna.c
#ifndef __BULLET_BTGIMPACTMESHSHAPEDATA__H__
#define __BULLET_BTGIMPACTMESHSHAPEDATA__H__
// -------------------------------------------------- //
#include "bullet_Common.h"
#include "bullet_btCollisionShapeData.h"
#include "bullet_btStridingMeshInterfaceData.h"
#include "bullet_btVector3FloatData.h"
namespace Bullet {
// ---------------------------------------------- //
class btGImpactMeshShapeData
{
public:
btCollisionShapeData m_collisionShapeData;
btStridingMeshInterfaceData m_meshInterface;
btVector3FloatData m_localScaling;
float m_collisionMargin;
int m_gimpactSubType;
};
}
#endif//__BULLET_BTGIMPACTMESHSHAPEDATA__H__

View File

@@ -20,13 +20,13 @@ subject to the following restrictions:
// 32 && 64 bit versions
//#ifdef _WIN64
#ifdef _WIN64
extern unsigned char sBulletDNAstr64[];
extern int sBulletDNAlen64;
//#else
#else
extern unsigned char sBulletDNAstr[];
extern int sBulletDNAlen;
//#endif //_WIN64
#endif //_WIN64
using namespace bParse;
@@ -35,16 +35,18 @@ btBulletFile::btBulletFile()
:bFile("", "BULLET ")
{
mMemoryDNA = new bDNA();
//#ifdef _WIN64
if (VOID_IS_8)
#ifdef _WIN64
//if (VOID_IS_8)
mMemoryDNA->init((char*)sBulletDNAstr64,sBulletDNAlen64);
else
//#else
// else
#else
mMemoryDNA->init((char*)sBulletDNAstr,sBulletDNAlen);
//#endif
#endif
}
btBulletFile::btBulletFile(const char* fileName)
:bFile(fileName, "BULLET ")
{
@@ -174,25 +176,25 @@ void btBulletFile::writeDNA(FILE* fp)
if (VOID_IS_8)
{
//#ifdef _WIN64
#ifdef _WIN64
dataChunk.len = sBulletDNAlen64;
dataChunk.oldPtr = sBulletDNAstr64;
fwrite(&dataChunk,sizeof(bChunkInd),1,fp);
fwrite(sBulletDNAstr64, sBulletDNAlen64,1,fp);
//#else
// btAssert(0);
//#endif
#else
btAssert(0);
#endif
}
else
{
//#ifndef _WIN64
#ifndef _WIN64
dataChunk.len = sBulletDNAlen;
dataChunk.oldPtr = sBulletDNAstr;
fwrite(&dataChunk,sizeof(bChunkInd),1,fp);
fwrite(sBulletDNAstr, sBulletDNAlen,1,fp);
//#else
// btAssert(0);
//#endif
#else
btAssert(0);
#endif
}
}
@@ -201,19 +203,19 @@ void btBulletFile::parse(bool verboseDumpAllTypes)
{
if (VOID_IS_8)
{
//#ifdef _WIN64
#ifdef _WIN64
parseInternal(verboseDumpAllTypes,(char*)sBulletDNAstr64,sBulletDNAlen64);
//#else
// btAssert(0);
//#endif
#else
btAssert(0);
#endif
}
else
{
//#ifndef _WIN64
#ifndef _WIN64
parseInternal(verboseDumpAllTypes,(char*)sBulletDNAstr,sBulletDNAlen);
//#else
// btAssert(0);
//#endif
#else
btAssert(0);
#endif
}
}