ScummVM API documentation
EntityLoader_Object.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 /*
23  * Copyright (C) 2006-2010 - Frictional Games
24  *
25  * This file is part of HPL1 Engine.
26  */
27 
28 #ifndef HPL_ENTITY_LOADER_OBJECT_H
29 #define HPL_ENTITY_LOADER_OBJECT_H
30 
31 #include "hpl1/engine/graphics/GraphicsTypes.h"
32 #include "hpl1/engine/math/MathTypes.h"
33 #include "hpl1/engine/system/SystemTypes.h"
34 
35 #include "hpl1/engine/resources/Resources.h"
36 
37 class TiXmlElement;
38 
39 namespace hpl {
40 
41 class iPhysicsBody;
42 class iPhysicsJoint;
43 class iPhysicsWorld;
44 class cMesh;
45 class cMeshEntity;
46 class cParticleSystem3D;
47 class cBillboard;
48 class cBeam;
49 class cSoundEntity;
50 class iLight3D;
51 
53 public:
54  cEntityLoader_Object(const tString &asName) : iEntity3DLoader(asName) {}
55  virtual ~cEntityLoader_Object() {}
56 
57  iEntity3D *Load(const tString &asName, TiXmlElement *apRootElem, const cMatrixf &a_mtxTransform,
58  cWorld3D *apWorld, const tString &asFileName, bool abLoadReferences);
59 
60 protected:
61  virtual void BeforeLoad(TiXmlElement *apRootElem, const cMatrixf &a_mtxTransform, cWorld3D *apWorld){};
62  virtual void AfterLoad(TiXmlElement *apRootElem, const cMatrixf &a_mtxTransform, cWorld3D *apWorld){};
63 
64  void SetBodyProperties(iPhysicsBody *apBody, TiXmlElement *apPhysicsElem);
65  void SetJointProperties(iPhysicsJoint *apJoint, TiXmlElement *apJointElem, cWorld3D *apWorld);
66 
67  void LoadController(iPhysicsJoint *apJoint, iPhysicsWorld *apPhysicsWorld, TiXmlElement *apElem);
68 
69  eAnimationEventType GetAnimationEventType(const char *apString);
70 
71  tString msSubType;
72  tString msName;
73 
74  tString msFileName;
75 
78 
80  Common::Array<cParticleSystem3D *> mvParticleSystems;
81  Common::Array<cBillboard *> mvBillboards;
82  Common::Array<cBeam *> mvBeams;
83  Common::Array<cSoundEntity *> mvSoundEntities;
84 
85  cMeshEntity *mpEntity;
86  cMesh *mpMesh;
87 };
88 
89 } // namespace hpl
90 
91 #endif // HPL_ENTITY_LOADER_OBJECT_H
Definition: AI.h:36
Definition: str.h:59
Definition: array.h:52
Definition: PhysicsWorld.h:115
Definition: Mesh.h:215
Definition: Resources.h:114
Definition: PhysicsBody.h:117
Definition: World3D.h:179
Definition: Entity3D.h:81
Definition: EntityLoader_Object.h:52
Definition: tinyxml.h:864
Definition: MeshEntity.h:96
Definition: PhysicsJoint.h:135