ScummVM API documentation
te_trs.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 #ifndef TETRAEDGE_TE_TE_TRS_H
23 #define TETRAEDGE_TE_TE_TRS_H
24 
25 #include "common/stream.h"
26 #include "tetraedge/te/te_quaternion.h"
27 #include "tetraedge/te/te_vector3f32.h"
28 
29 namespace Tetraedge {
30 
31 class TeTRS {
32 public:
33  TeTRS();
34 
35  static void deserialize(Common::ReadStream &stream, TeTRS &dest);
36  static void serialize(Common::WriteStream &stream, const TeTRS &src);
37 
38  void setIdentity();
39 
40  void setRotation(const TeQuaternion &rot) {
41  _rot = rot;
42  }
43  void setScale(const TeVector3f32 &scale) {
44  _scale = scale;
45  }
46  void setTranslation(const TeVector3f32 &trans) {
47  _trans = trans;
48  }
49 
50  const TeVector3f32 &getTranslation() const { return _trans; }
51  const TeQuaternion &getRotation() const { return _rot; }
52  const TeVector3f32 &getScale() const { return _scale; }
53 
54  TeTRS lerp(const TeTRS &other, float amount);
55 
56 private:
57  TeVector3f32 _trans;
58  TeQuaternion _rot;
59  TeVector3f32 _scale;
60 };
61 
62 } // end namespace Tetraedge
63 
64 #endif // TETRAEDGE_TE_TE_TRS_H
Definition: detection.h:27
Definition: stream.h:77
Definition: te_quaternion.h:32
Graphics::Surface * scale(const Graphics::Surface &srcImage, int xSize, int ySize)
Definition: te_trs.h:31
Definition: te_vector3f32.h:33
Definition: stream.h:385