-
Notifications
You must be signed in to change notification settings - Fork 0
/
vrdistortionmesh.h
34 lines (29 loc) · 1.08 KB
/
vrdistortionmesh.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#ifndef VRDISTORTIONMESH_H
#define VRDISTORTIONMESH_H
#include <QOpenGLFunctions>
#include <QOpenGLBuffer>
#include <cmath>
#include <QDebug>
#include "vrgoggles.h"
#include "vrprojection.h"
/**
* @brief The VrDistortionMesh class dummu object ot create mesh of pincushion distortion.
*/
class VrDistortionMesh
{
public:
VrDistortionMesh();
QOpenGLBuffer arrayBuffer;
QOpenGLBuffer elementBuffer;
int nIndices;
/**
* @brief createProjection Create a mesh and upload it into OpenGL buffers
* @param config Configuration of projeciton
* @param rotete Swap the X and Y axis, in case that you OS doens not support screen rotation (Sailfish OS)
*/
void createProjection(const VrProjection *config, bool rotate=false);
private:
void create(const VrGoggles * distortion, const VrProjection::Viewport &viewport, float *vertexData, unsigned short *indexData, float screenWidthM, float screenHeightM, float xEyeOffsetMScreen, float yEyeOffsetMScreen, float textureWidthM, float textureHeightM, bool rotate);
const int rows, cols;
};
#endif // VRDISTORTIONMESH_H