ScummVM API documentation
object3d.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_GAME_OBJECT3D_H
23 #define TETRAEDGE_GAME_OBJECT3D_H
24 
25 #include "common/str.h"
26 #include "common/hashmap.h"
27 
28 #include "tetraedge/te/te_curve_anim2.h"
29 #include "tetraedge/te/te_object.h"
30 #include "tetraedge/te/te_model.h"
31 #include "tetraedge/te/te_vector3f32.h"
32 
33 namespace Tetraedge {
34 
35 class Object3D : public TeObject {
36 public:
37  struct ObjectSettings {
38  Common::String _name;
39  Common::String _modelFileName;
40  TeVector3f32 _defaultScale;
41  TeVector3f32 _originOffset;
42  bool _invertNormals;
43 
44  void clear();
45  };
46 
47  Object3D();
48 
49  bool loadModel(const Common::String &name);
50 
51  static bool loadSettings(const Common::Path &path);
52  static void cleanup();
53 
54  TeIntrusivePtr<TeModel> model() { return _modelPtr; }
55 
56  void setObjectMoveDest(const TeVector3f32 &vec);
57  void setObjectMoveTime(float f);
58  bool onMoveAnimFinished();
59  void setCurMovePos(const TeVector3f32 &pos);
60 
61  float _rotateTime;
62  TeTimer _rotateTimer;
63  TeQuaternion _rotateStart;
64  TeVector3f32 _rotateAmount; // Rotate vector in degrees
65 
66  float _translateTime;
67  TeTimer _translateTimer;
68  TeVector3f32 _translateStart;
69  TeVector3f32 _translateAmount;
70 
72  TeVector3f32 _curMovePos;
73 
74  Common::String _onCharName;
75  Common::String _onCharBone;
76 
77  // TRS relative to the character this object is "on"
78  TeVector3f32 _objTranslation;
79  TeQuaternion _objRotation;
80  TeVector3f32 _objScale;
81  TeMatrix4x4 _lastMatrix;
82 
83  int _startFrame;
84  int _endFrame;
85 
86 private:
88 
89  TeIntrusivePtr<TeModel> _modelPtr;
90  Common::String _modelFileName;
91  TeVector3f32 _defaultScale;
92 };
93 
94 } // end namespace Tetraedge
95 
96 #endif // TETRAEDGE_GAME_OBJECT3D_H
Definition: str.h:59
Definition: detection.h:27
Definition: te_quaternion.h:32
Definition: path.h:52
Definition: te_curve_anim2.h:36
Definition: te_timer.h:33
Definition: te_matrix4x4.h:37
Definition: hashmap.h:85
Definition: te_object.h:29
Definition: object3d.h:37
Definition: te_intrusive_ptr.h:31
Definition: te_vector3f32.h:33
Definition: object3d.h:35