2017-08-01 12:30:58 +00:00
|
|
|
/*
|
|
|
|
bParse
|
|
|
|
Copyright (c) 2006-2010 Charlie C & Erwin Coumans http://gamekit.googlecode.com
|
|
|
|
|
|
|
|
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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef B3_BULLET_FILE_H
|
|
|
|
#define B3_BULLET_FILE_H
|
|
|
|
|
|
|
|
#include "b3File.h"
|
|
|
|
#include "Bullet3Common/b3AlignedObjectArray.h"
|
|
|
|
#include "b3Defines.h"
|
|
|
|
|
|
|
|
#include "Bullet3Serialize/Bullet2FileLoader/b3Serializer.h"
|
|
|
|
|
2019-01-03 13:26:51 +00:00
|
|
|
namespace bParse
|
|
|
|
{
|
|
|
|
// ----------------------------------------------------- //
|
|
|
|
class b3BulletFile : public bFile
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
char* m_DnaCopy;
|
2017-08-01 12:30:58 +00:00
|
|
|
|
2019-01-03 13:26:51 +00:00
|
|
|
public:
|
|
|
|
b3AlignedObjectArray<bStructHandle*> m_softBodies;
|
2017-08-01 12:30:58 +00:00
|
|
|
|
2019-01-03 13:26:51 +00:00
|
|
|
b3AlignedObjectArray<bStructHandle*> m_rigidBodies;
|
2017-08-01 12:30:58 +00:00
|
|
|
|
2019-01-03 13:26:51 +00:00
|
|
|
b3AlignedObjectArray<bStructHandle*> m_collisionObjects;
|
2017-08-01 12:30:58 +00:00
|
|
|
|
2019-01-03 13:26:51 +00:00
|
|
|
b3AlignedObjectArray<bStructHandle*> m_collisionShapes;
|
2017-08-01 12:30:58 +00:00
|
|
|
|
2019-01-03 13:26:51 +00:00
|
|
|
b3AlignedObjectArray<bStructHandle*> m_constraints;
|
2017-08-01 12:30:58 +00:00
|
|
|
|
2019-01-03 13:26:51 +00:00
|
|
|
b3AlignedObjectArray<bStructHandle*> m_bvhs;
|
2017-08-01 12:30:58 +00:00
|
|
|
|
2019-01-03 13:26:51 +00:00
|
|
|
b3AlignedObjectArray<bStructHandle*> m_triangleInfoMaps;
|
2017-08-01 12:30:58 +00:00
|
|
|
|
2019-01-03 13:26:51 +00:00
|
|
|
b3AlignedObjectArray<bStructHandle*> m_dynamicsWorldInfo;
|
2017-08-01 12:30:58 +00:00
|
|
|
|
2019-01-03 13:26:51 +00:00
|
|
|
b3AlignedObjectArray<char*> m_dataBlocks;
|
|
|
|
b3BulletFile();
|
2017-08-01 12:30:58 +00:00
|
|
|
|
2019-01-03 13:26:51 +00:00
|
|
|
b3BulletFile(const char* fileName);
|
2017-08-01 12:30:58 +00:00
|
|
|
|
2019-01-03 13:26:51 +00:00
|
|
|
b3BulletFile(char* memoryBuffer, int len);
|
2017-08-01 12:30:58 +00:00
|
|
|
|
2019-01-03 13:26:51 +00:00
|
|
|
virtual ~b3BulletFile();
|
2017-08-01 12:30:58 +00:00
|
|
|
|
2019-01-03 13:26:51 +00:00
|
|
|
virtual void addDataBlock(char* dataBlock);
|
2017-08-01 12:30:58 +00:00
|
|
|
|
2019-01-03 13:26:51 +00:00
|
|
|
// experimental
|
|
|
|
virtual int write(const char* fileName, bool fixupPointers = false);
|
2017-08-01 12:30:58 +00:00
|
|
|
|
2019-01-03 13:26:51 +00:00
|
|
|
virtual void parse(int verboseMode);
|
2017-08-01 12:30:58 +00:00
|
|
|
|
2019-01-03 13:26:51 +00:00
|
|
|
virtual void parseData();
|
2017-08-01 12:30:58 +00:00
|
|
|
|
2019-01-03 13:26:51 +00:00
|
|
|
virtual void writeDNA(FILE* fp);
|
2017-08-01 12:30:58 +00:00
|
|
|
|
2019-01-03 13:26:51 +00:00
|
|
|
void addStruct(const char* structType, void* data, int len, void* oldPtr, int code);
|
2017-08-01 12:30:58 +00:00
|
|
|
};
|
2019-01-03 13:26:51 +00:00
|
|
|
}; // namespace bParse
|
2017-08-01 12:30:58 +00:00
|
|
|
|
2019-01-03 13:26:51 +00:00
|
|
|
#endif //B3_BULLET_FILE_H
|