#include <viewport.h>
Definition at line 52 of file viewport.h.
Public Member Functions | |
| CViewport () | |
| Default constructor. Setup a fullscreen viewport. | |
| float | getHeight () const |
| void | getRayWithPoint (float x, float y, CVector &pos, CVector &dir, const CMatrix &camMatrix, const CFrustum &camFrust) const |
| void | getValues (float &x, float &y, float &width, float &height) const |
| float | getWidth () const |
| float | getX () const |
| float | getY () const |
| void | init (float x, float y, float width, float height) |
| void | init16_9 () |
| Setup a 16/9 viewport. | |
| void | initFullScreen () |
| Setup a fullscreen viewport. | |
Private Attributes | |
| float | _Height |
| float | _Width |
| float | _X |
| float | _Y |
|
|
Default constructor. Setup a fullscreen viewport.
Definition at line 37 of file viewport.cpp. References initFullScreen(), and NL3D_MEM_VIEWPORT.
00038 {
00039 NL3D_MEM_VIEWPORT
00040 initFullScreen ();
00041 }
|
|
|
Definition at line 105 of file viewport.h. Referenced by NL3D::CFlareModel::traverseRender().
00105 { return _Height; }
|
|
||||||||||||||||||||||||||||
|
Get a 3d ray with a 2d point
Definition at line 81 of file viewport.cpp. References NLMISC::CMatrix::getPos(), NL3D::CFrustum::getValues(), NL3D_MEM_VIEWPORT, NLMISC::CMatrix::setPos(), NLMISC::CVector::x, x, NLMISC::CVector::y, y, and NLMISC::CVector::z. Referenced by NL3D::CEvent3dMouseListener::operator()().
00082 {
00083 NL3D_MEM_VIEWPORT
00084 float xVP=(x-_X)/_Width;
00085 float yVP=(y-_Y)/_Height;
00086
00087 // Pos of the ray
00088 pos= camMatrix.getPos();
00089
00090 // Get camera frustrum
00091 float left;
00092 float right;
00093 float bottom;
00094 float top;
00095 float znear;
00096 float zfar;
00097 camFrust.getValues (left, right, bottom, top, znear, zfar);
00098
00099 // Get a local direction
00100 dir.x=left+(right-left)*xVP;
00101 dir.y=znear;
00102 dir.z=bottom+(top-bottom)*yVP;
00103
00104 // Get a world direction
00105 CMatrix mat=camMatrix;
00106 mat.setPos (CVector (0,0,0));
00107 dir=mat*dir;
00108 }
|
|
||||||||||||||||||||
|
Get the viewport values
Definition at line 93 of file viewport.h. References height, NL3D_MEM_VIEWPORT, width, x, and y.
|
|
|
Definition at line 104 of file viewport.h. Referenced by NL3D::CFlareModel::traverseRender().
00104 { return _Width; }
|
|
|
Definition at line 102 of file viewport.h. Referenced by NL3D::CFlareModel::traverseRender().
00102 { return _X; }
|
|
|
Definition at line 103 of file viewport.h. Referenced by NL3D::CFlareModel::traverseRender().
00103 { return _Y; }
|
|
||||||||||||||||||||
|
Constructor
Definition at line 44 of file viewport.cpp. References NLMISC::clamp(), height, NL3D_MEM_VIEWPORT, width, x, and y. Referenced by NL3D::CCloud::genBill(), NL3D::CShadowMapManager::renderGenerate(), and NL3D::CDriverGL::setupViewport().
|
|
|
Setup a 16/9 viewport.
Definition at line 70 of file viewport.cpp. References NL3D_MEM_VIEWPORT.
00071 {
00072 NL3D_MEM_VIEWPORT
00073 // Very easy
00074 _X=0.f;
00075 _Y=(1.f-0.75f)/2;
00076 _Width=1.f;
00077 _Height=0.75f;
00078 }
|
|
|
Setup a fullscreen viewport.
Definition at line 59 of file viewport.cpp. References NL3D_MEM_VIEWPORT. Referenced by NL3D::CEvent3dMouseListener::CEvent3dMouseListener(), CViewport(), NL3D::CCloud::genBill(), NL3D::CShadowMapManager::renderGenerate(), and NL3D::CDriverUser::setDisplay().
00060 {
00061 NL3D_MEM_VIEWPORT
00062 // Very easy
00063 _X=0.f;
00064 _Y=0.f;
00065 _Width=1.f;
00066 _Height=1.f;
00067 }
|
|
|
Definition at line 112 of file viewport.h. |
|
|
Definition at line 111 of file viewport.h. |
|
|
Definition at line 109 of file viewport.h. |
|
|
Definition at line 110 of file viewport.h. |
1.3.6