[dali_2.3.21] Merge branch 'devel/master'
[platform/core/uifw/dali-toolkit.git] / dali-physics / third-party / bullet3 / src / Bullet3Serialize / Bullet2FileLoader / b3BulletFile.h
1 /*
2 bParse
3 Copyright (c) 2006-2010 Charlie C & Erwin Coumans  http://gamekit.googlecode.com
4
5 This software is provided 'as-is', without any express or implied warranty.
6 In no event will the authors be held liable for any damages arising from the use of this software.
7 Permission is granted to anyone to use this software for any purpose,
8 including commercial applications, and to alter it and redistribute it freely,
9 subject to the following restrictions:
10
11 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.
12 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
13 3. This notice may not be removed or altered from any source distribution.
14 */
15
16 #ifndef B3_BULLET_FILE_H
17 #define B3_BULLET_FILE_H
18
19 #include "b3File.h"
20 #include "Bullet3Common/b3AlignedObjectArray.h"
21 #include "b3Defines.h"
22
23 #include "Bullet3Serialize/Bullet2FileLoader/b3Serializer.h"
24
25 namespace bParse
26 {
27 // ----------------------------------------------------- //
28 class b3BulletFile : public bFile
29 {
30 protected:
31         char* m_DnaCopy;
32
33 public:
34         b3AlignedObjectArray<bStructHandle*> m_softBodies;
35
36         b3AlignedObjectArray<bStructHandle*> m_rigidBodies;
37
38         b3AlignedObjectArray<bStructHandle*> m_collisionObjects;
39
40         b3AlignedObjectArray<bStructHandle*> m_collisionShapes;
41
42         b3AlignedObjectArray<bStructHandle*> m_constraints;
43
44         b3AlignedObjectArray<bStructHandle*> m_bvhs;
45
46         b3AlignedObjectArray<bStructHandle*> m_triangleInfoMaps;
47
48         b3AlignedObjectArray<bStructHandle*> m_dynamicsWorldInfo;
49
50         b3AlignedObjectArray<char*> m_dataBlocks;
51         b3BulletFile();
52
53         b3BulletFile(const char* fileName);
54
55         b3BulletFile(char* memoryBuffer, int len);
56
57         virtual ~b3BulletFile();
58
59         virtual void addDataBlock(char* dataBlock);
60
61         // experimental
62         virtual int write(const char* fileName, bool fixupPointers = false);
63
64         virtual void parse(int verboseMode);
65
66         virtual void parseData();
67
68         virtual void writeDNA(FILE* fp);
69
70         void addStruct(const char* structType, void* data, int len, void* oldPtr, int code);
71 };
72 };  // namespace bParse
73
74 #endif  //B3_BULLET_FILE_H