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
28class SimpleFile;
29
30namespace Titanic {
31
37enum StarColor { WHITE = 0, PINK = 2 };
38
44class CViewport {
45private:
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;
56private:
57 void reset();
58public:
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;
68public:
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: viewport.h:44
void setFrontClip(double dist)
void SetRoleAngle(double angle)
void getRelativeXCenterPixels(double *v1, double *v2, double *v3, double *v4)
void load(SimpleFile *file, int param)
const FMatrix & getOrientation() const
void setCenterYAngle(double angleDegrees)
void setOrientation(const FMatrix &m)
void setBackClip(double dist)
void save(SimpleFile *file, int indent)
void changeOrientation(const FMatrix &matrix)
void setCenterZAngle(double angleDegrees)
void setPosition(const FVector &v)
void changeStarColorPixel(StarMode mode, double pixelOffSet)
void copyFrom(const CViewport *src)
void setOrientation(const FVector &v)
void setPosition(const FPose &pose)
Definition: fmatrix.h:35
Definition: fpoint.h:32
Definition: fpose.h:34
Definition: fvector.h:36
Definition: simple_file.h:49