ScummVM API documentation
Entity2D.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_ENTITY2D_H
29 #define HPL_ENTITY2D_H
30 
31 #include "hpl1/engine/math/MathTypes.h"
32 #include "hpl1/engine/scene/Entity.h"
33 #include "hpl1/engine/system/SystemTypes.h"
34 
35 namespace hpl {
36 
37 class cGrid2DObject;
38 
39 class iEntity2D : public iEntity {
40 public:
41  iEntity2D(tString asName);
42  virtual ~iEntity2D() {}
43 
44  virtual const cRect2f &GetBoundingBox() = 0;
45  virtual bool UpdateBoundingBox() = 0;
46 
47  cVector3f &GetLocalPosition() { return mvPosition; }
48  cVector3f &GetLocalRotation() { return mvRotation; }
49  cVector3f &GetLocalScale() { return mvScale; }
50 
51  cVector3f GetWorldPosition();
52  cVector3f GetWorldRotation();
53  cVector3f GetWorldScale();
54 
55  void SetPosition(const cVector3f &avPos);
56  void SetRotation(const cVector3f &avRot);
57  void SetScale(const cVector3f &avScale);
58 
59  cGrid2DObject *GetGrid2DObject() { return mpGridObject; }
60  void SetGrid2DObject(cGrid2DObject *apGrid) { mpGridObject = apGrid; }
61  bool HasGrid2DObject() { return mpGridObject != NULL; }
62 
63 protected:
64  cGrid2DObject *mpGridObject;
65 
66  cVector3f mvPosition;
67  cVector3f mvRotation;
68  cVector3f mvScale;
69 
70  cVector3f mvLastPosition;
71  cVector3f mvLastRotation;
72  cVector3f mvLastScale;
73 
74  cRect2f mBoundingBox;
75 };
76 
79 
80 } // namespace hpl
81 
82 #endif // HPL_ENTITY2D_H
Definition: AI.h:36
Definition: GridMap2D.h:48
Definition: str.h:59
Definition: list.h:44
Definition: Entity2D.h:39
Definition: list_intern.h:51
Definition: Entity.h:50