00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072 #ifndef __FK_PROJECTION_HEADER__
00073 #define __FK_PROJECTION_HEADER__
00074
00075 #include <FK/Base.h>
00076
00078 enum fk_ProjectMode {
00079 FK_NONE_PROJ_MODE,
00080 FK_PERSPECTIVE_MODE,
00081 FK_FRUSTUM_MODE,
00082 FK_ORTHO_MODE
00083 };
00084
00085
00087
00094 class fk_ProjectBase : public fk_BaseObject {
00095 private:
00096 fk_ProjectMode Mode;
00097
00098 protected:
00099
00100 #ifndef FK_DOXYGEN_USER_PROCESS
00101
00102 void SetMode(fk_ProjectMode);
00103
00104 #endif
00105
00106 public:
00107
00109 fk_ProjectBase(fk_ProjectMode = FK_NONE_PROJ_MODE);
00110
00112 ~fk_ProjectBase();
00113
00115
00120 fk_ProjectMode getMode(void) const;
00121 };
00122
00124
00160 class fk_Perspective : public fk_ProjectBase {
00161 private:
00162 double Fovy;
00163 double Near, Far;
00164
00165 public:
00166
00168
00175 fk_Perspective(double fovy = 2.0*FK_PI/9.0,
00176 double near = 1.0,
00177 double far = 6000.0);
00178
00180 ~fk_Perspective();
00181
00183 fk_Perspective(const fk_Perspective &);
00184
00186 fk_Perspective & operator =(const fk_Perspective &);
00187
00189
00194 void setFovy(double fovy);
00195
00197
00202 void setNear(double near);
00203
00205
00210 void setFar(double far);
00211
00213
00220 void setAll(double fovy, double near, double far);
00221
00223
00228 double getFovy(void) const;
00229
00230
00232
00237 double getNear(void) const;
00238
00240
00245 double getFar(void) const;
00246 };
00247
00249
00282 class fk_Frustum : public fk_ProjectBase {
00283 private:
00284 double Left, Right, Bottom, Top, Near, Far;
00285
00286 public:
00288
00298 fk_Frustum(double left = -10.0,
00299 double right = 10.0,
00300 double bottom = -10.0,
00301 double top = 10.0,
00302 double near = 1.0,
00303 double far = 6000.0);
00304
00306 ~fk_Frustum();
00307
00309 fk_Frustum(const fk_Frustum &);
00310
00312 fk_Frustum & operator =(const fk_Frustum &);
00313
00315
00320 void setLeft(double left);
00321
00323
00328 void setRight(double right);
00329
00331
00336 void setBottom(double bottom);
00337
00339
00344 void setTop(double top);
00345
00347
00352 void setNear(double near);
00353
00355
00360 void setFar(double far);
00361
00363
00373 void setAll(double left,
00374 double right,
00375 double bottom,
00376 double top,
00377 double near,
00378 double far);
00379
00381
00386 double getLeft(void) const;
00387
00389
00394 double getRight(void) const;
00395
00397
00402 double getBottom(void) const;
00403
00405
00410 double getTop(void) const;
00411
00413
00418 double getNear(void) const;
00419
00421
00426 double getFar(void) const;
00427 };
00428
00430
00450 class fk_Ortho : public fk_ProjectBase {
00451 private:
00452 double Left, Right;
00453 double Bottom, Top;
00454 double Near, Far;
00455
00456 public:
00457
00459
00470 fk_Ortho(double left = -500.0, double right = 500.0,
00471 double bottom = -500.0, double top = 500.0,
00472 double near = 0.0, double far = 10000.0);
00473
00475 ~fk_Ortho();
00476
00478 fk_Ortho(const fk_Ortho &);
00479
00481 fk_Ortho & operator =(const fk_Ortho &);
00482
00484
00489 void setLeft(double left);
00490
00492
00497 void setRight(double right);
00498
00500
00505 void setBottom(double bottom);
00506
00508
00513 void setTop(double top);
00514
00516
00521 void setNear(double near);
00522
00524
00529 void setFar(double far);
00530
00532
00543 void setAll(double left, double right,
00544 double bottom, double top,
00545 double near, double far);
00546
00548
00553 double getLeft(void) const;
00554
00556
00561 double getRight(void) const;
00562
00564
00569 double getBottom(void) const;
00570
00572
00577 double getTop(void) const;
00578
00580
00585 double getNear(void) const;
00586
00588
00593 double getFar(void) const;
00594 };
00595
00596 #endif // !__FK_PROJECTION_HEADER__