ScummVM API documentation
viewport.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_VIEWPORT_H
23 #define TITANIC_VIEWPORT_H
24 
25 #include "titanic/star_control/base_stars.h"
26 #include "titanic/star_control/fpose.h"
27 
28 class SimpleFile;
29 
30 namespace Titanic {
31 
37 enum StarColor { WHITE = 0, PINK = 2 };
38 
44 class CViewport {
45 private:
46  double _spin;
47  double _centerYAngleDegrees;
48  double _centerZAngleDegrees;
49  int _width;
50  int _height;
51  FMatrix _orientation;
52  FPose _currentPose;
53  FPose _rawPose;
54  FPoint _center;
55  bool _poseUpToDate;
56 private:
57  void reset();
58 public:
59  FVector _position;
60  double _frontClip;
61  double _backClip;
62  StarColor _starColor; // Used in CBaseStars::draw
63  double _valArray[2]; // has value 0.0 or 30.0
64  double _isZero;
65  double _pixel1OffSetX; // Used in CBaseStars::draw3 and CBaseStars::draw4 has value 0.0 or 28000.0
66  double _pixel2OffSetX; // Used in CBaseStars::draw3 and CBaseStars::draw4 has value 0.0 or -28000.0
67  FVector _centerVector;
68 public:
69  CViewport();
70  CViewport(CViewport *src);
71 
75  void copyFrom(const CViewport *src);
76 
80  void load(SimpleFile *file, int param);
81 
85  void save(SimpleFile *file, int indent);
86 
90  void setPosition(const FVector &v);
91 
95  void setPosition(const FPose &pose);
96 
100  void setOrientation(const FMatrix &m);
101 
105  void setOrientation(const FVector &v);
106 
107  void randomizeOrientation();
108 
114  void changeStarColorPixel(StarMode mode, double pixelOffSet);
115  void reposition(double factor);
116 
121  void changeOrientation(const FMatrix &matrix);
122 
123  FPose getPose();
124  FPose getRawPose();
125  FVector getRelativePosNoCentering(int index, const FVector &src);
126  FVector getRelativePosCentering(int index, const FVector &src);
127  FVector getRelativePosCenteringRaw(int index, const FVector &src);
128 
136  void getRelativeXCenterPixels(double *v1, double *v2, double *v3, double *v4);
137 
141  const FMatrix &getOrientation() const;
142 
146  void SetRoleAngle(double angle);
147 
151  void setFrontClip(double dist);
152 
156  void setBackClip(double dist);
157 
163  void setCenterYAngle(double angleDegrees);
164 
170  void setCenterZAngle(double angleDegrees);
171 };
172 
173 } // End of namespace Titanic
174 
175 #endif /* TITANIC_VIEWPORT_H */
Definition: fmatrix.h:35
void getRelativeXCenterPixels(double *v1, double *v2, double *v3, double *v4)
void load(SimpleFile *file, int param)
void copyFrom(const CViewport *src)
void setFrontClip(double dist)
void changeOrientation(const FMatrix &matrix)
Definition: viewport.h:44
void setCenterYAngle(double angleDegrees)
Definition: simple_file.h:49
Definition: fpose.h:34
void setOrientation(const FMatrix &m)
Definition: arm.h:30
void save(SimpleFile *file, int indent)
void changeStarColorPixel(StarMode mode, double pixelOffSet)
const FMatrix & getOrientation() const
void setBackClip(double dist)
void setCenterZAngle(double angleDegrees)
void setPosition(const FVector &v)
Definition: fpoint.h:32
void SetRoleAngle(double angle)
Definition: fvector.h:36