ScummVM API documentation
Bone.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_BONE_H
29 #define HPL_BONE_H
30 
31 #include "common/list.h"
32 #include "hpl1/engine/graphics/GraphicsTypes.h"
33 #include "hpl1/engine/math/MathTypes.h"
34 #include "hpl1/engine/system/SystemTypes.h"
35 #include "common/stablemap.h"
36 
37 namespace hpl {
38 
39 class cSkeleton;
40 class cBone;
41 
42 typedef Common::List<cBone *> tBoneList;
43 typedef tBoneList::iterator tBoneListIt;
44 
45 typedef cSTLIterator<cBone *, tBoneList, tBoneListIt> cBoneIterator;
46 
47 class cBone {
48  friend class cSkeleton;
49 
50 public:
51  cBone(const tString &asName, cSkeleton *apSkeleton);
52  ~cBone();
53 
54  cBone *CreateChildBone(const tString &asName);
55 
56  void SetTransform(const cMatrixf &a_mtxTransform);
57  const cMatrixf &GetLocalTransform();
58  const cMatrixf &GetWorldTransform();
59  const cMatrixf &GetInvWorldTransform();
60 
61  const tString &GetName() { return msName; }
62 
63  cBoneIterator GetChildIterator();
64 
65  void Detach();
66 
67  cBone *GetParent() { return mpParent; }
68 
69  // Needed for some loading stuff..
70  int GetValue() { return mlValue; }
71  void SetValue(int alVal) { mlValue = alVal; }
72 
73 private:
74  void NeedsUpdate();
75 
76  void UpdateMatrix();
77 
78  tString msName;
79 
80  cMatrixf m_mtxTransform;
81 
82  cMatrixf m_mtxWorldTransform;
83  cMatrixf m_mtxInvWorldTransform;
84 
85  cBone *mpParent;
86  tBoneList mlstChildren;
87 
88  cSkeleton *mpSkeleton;
89 
90  bool mbNeedsUpdate;
91 
92  int mlValue;
93 };
94 
95 } // namespace hpl
96 
97 #endif // HPL_BONE_H
Definition: AI.h:36
Definition: str.h:59
Definition: Skeleton.h:46
ListInternal::Iterator< t_T > iterator
Definition: list.h:52
Definition: Bone.h:47