XRay3D/include/light.h
2020-04-17 18:11:57 +02:00

43 lines
1.0 KiB
C++

#pragma once
#ifndef LIGHT
#define LIGHT
#include <GL/glew.h>
#include "matrix.h"
#define DEPTH_MAP_SIZE 1024
class Xr_Light
{
public:
Xr_Light();
Xr_Light(float posX, float poxY, float posZ, float eyeX, float eyeY, float eyeZ, float intensity, float colorR, float colorG, float colorB, float fov, bool shadow);
~Xr_Light();
void configure(float posX, float posY, float posZ, float eyeX, float eyeY, float eyeZ, float intensity, float colorR, float colorG, float colorB, float fov, bool shadow);
float* const getColorRGB() const;
float getIntensity() const;
float* const getPos() const;
float* const getEye() const;
float getFov() const;
Xr_MATRIX_4X4* const getLightProjectionMatrix() const;
Xr_MATRIX_4X4* const getLightModelviewMatrix() const;
GLuint getLightDepthMap() const;
bool hasShadow() const;
private:
float L_colorRGB[3];
float L_intensity;
float L_pos[3];
float L_eye[3];
float L_fov;
bool L_shadow;
Xr_MATRIX_4X4 *L_projection;
Xr_MATRIX_4X4 *L_modelview;
GLuint L_depthMap;
};
#endif