ScummVM API documentation
te_model_vertex_animation.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_MODEL_VERTEX_ANIMATION_H
23 #define TETRAEDGE_TE_TE_MODEL_VERTEX_ANIMATION_H
24 
25 #include "common/str.h"
26 #include "common/array.h"
27 #include "common/stream.h"
28 
29 #include "tetraedge/te/te_animation.h"
30 #include "tetraedge/te/te_matrix4x4.h"
31 #include "tetraedge/te/te_model.h"
32 #include "tetraedge/te/te_intrusive_ptr.h"
33 #include "tetraedge/te/te_resource.h"
34 #include "tetraedge/te/te_vector3f32.h"
35 
36 namespace Tetraedge {
37 
38 class TeModel;
39 class TeModelAnimation;
40 
42 public:
43  struct KeyData {
44  float _frame;
46  Common::Array<TeMatrix4x4> _matricies;
47  };
48 
50  virtual ~TeModelVertexAnimation() {
51  _keydata.clear();
52  }
53 
54  void bind(TeIntrusivePtr<TeModel> &model);
55  // void deleteLater() // original overrides this, but just calls the super.
56  void destroy();
57 
58  const Common::String &head() const { return _head; }
59  TeVector3f32 getKeyVertex(uint keyno, uint vertexno);
60  Common::Array<TeVector3f32> getVertices();
61 
62  bool load(Common::ReadStream &stream);
63  void save(Common::WriteStream &stream) const;
64 
65  void update(double millis) override;
66 
67  static void deleteLaterStatic(TeModelVertexAnimation *obj) { TeObject::deleteLaterStatic(obj); }
68 
69 private:
70  float _lastMillis;
72  TeModelAnimation *_modelAnim;
73  TeQuaternion _rot;
74  Common::String _head;
75  Common::Array<KeyData> _keydata;
76 
77 };
78 
79 } // end namespace Tetraedge
80 
81 #endif // TETRAEDGE_TE_TE_MODEL_VERTEX_ANIMATION_H
Definition: str.h:59
Definition: detection.h:27
Definition: stream.h:77
Definition: te_quaternion.h:32
Definition: array.h:52
Definition: te_resource.h:31
Definition: te_model_animation.h:40
Definition: te_intrusive_ptr.h:31
Definition: te_animation.h:31
Definition: te_vector3f32.h:33
Definition: stream.h:385
Definition: te_model_vertex_animation.h:41
Definition: te_model_vertex_animation.h:43