ScummVM API documentation
motion_control.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 TITANIC_MOTION_CONTROL_H
23#define TITANIC_MOTION_CONTROL_H
24
25#include "titanic/star_control/fmatrix.h"
26
27namespace Titanic {
28
29class CCamera;
30class CErrorCode;
31class FMatrix;
32class FVector;
33class SimpleFile;
34
36 double _initialVelocity;
37 double _minVelocity;
38 double _maxVelocity;
39 double _velocity;
40 double _acceleration;
41 double _rotationX;
42 double _rotationY;
43 double _rotationZ;
44};
45
50private:
51 CCamera *_owner;
52 FVector _vector;
53public:
54 CCallbackHandler(CCamera *owner, const FVector &v) : _owner(owner), _vector(v) {
55 }
56
60 void apply();
61};
62
64protected:
65 double _currVelocity;
66 double _incVelocity;
67 double _incAcceleration;
68 double _minVelocity;
69 double _maxVelocity;
70 double _rotationX;
71 double _rotationY;
72 double _rotationZ;
73public:
74 int _lockCounter;
75 CCallbackHandler *_callback;
76public:
78 virtual ~CMotionControl();
79
80 virtual void setMotion(const CNavigationInfo *src);
81 virtual void getMotion(CNavigationInfo *dest);
82
86 virtual void clear();
90 virtual void reset();
91
95 virtual void setCallback(CCallbackHandler *callback);
99 virtual void accelerate();
100
104 virtual void deccelerate();
105
109 virtual void fullSpeed();
110
114 virtual void stop();
115
120 virtual void transitionBetweenPosOrients(const FVector &oldPos, const FVector &newPos,
121 const FMatrix &oldOrientation, const FMatrix &newOrientation) {}
122
126 virtual void moveTo(const FVector &srcV, const FVector &destV, const FMatrix &orientation) {}
127
132 virtual void transitionBetweenOrientations(const FVector &v1, const FVector &v2, const FVector &v3, const FMatrix &m) {}
133
137 virtual void updatePosition(CErrorCode &errorCode, FVector &pos, FMatrix &orientation) {}
138
142 virtual void load(SimpleFile *file, int version = 0);
143
147 virtual void save(SimpleFile *file, int indent);
148
153
158
162 bool isLocked() const { return _lockCounter > 0; }
163};
164
165} // End of namespace Titanic
166
167#endif /* TITANIC_MOTION_CONTROL_H */
Definition: motion_control.h:49
Definition: camera.h:42
Definition: error_code.h:27
Definition: motion_control.h:63
virtual void deccelerate()
virtual void clear()
bool isLocked() const
Definition: motion_control.h:162
virtual void accelerate()
virtual void transitionBetweenOrientations(const FVector &v1, const FVector &v2, const FVector &v3, const FMatrix &m)
Definition: motion_control.h:132
virtual void fullSpeed()
virtual void setCallback(CCallbackHandler *callback)
virtual void updatePosition(CErrorCode &errorCode, FVector &pos, FMatrix &orientation)
Definition: motion_control.h:137
virtual void load(SimpleFile *file, int version=0)
virtual void reset()
virtual void moveTo(const FVector &srcV, const FVector &destV, const FMatrix &orientation)
Definition: motion_control.h:126
virtual void save(SimpleFile *file, int indent)
virtual void transitionBetweenPosOrients(const FVector &oldPos, const FVector &newPos, const FMatrix &oldOrientation, const FMatrix &newOrientation)
Definition: motion_control.h:120
Definition: fmatrix.h:35
Definition: fvector.h:36
Definition: simple_file.h:49
Definition: motion_control.h:35