2023-04-01 07:16:14 +08:00
|
|
|
#ifndef CAMERA_H
|
|
|
|
#define CAMERA_H
|
|
|
|
|
2023-04-02 07:41:32 +08:00
|
|
|
#include <SFML/Graphics.hpp>
|
2023-05-01 07:10:01 +08:00
|
|
|
#include "level.h"
|
2023-04-01 07:16:14 +08:00
|
|
|
|
2023-04-20 07:28:17 +08:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
float direction;
|
|
|
|
float distance;
|
2023-05-01 07:10:01 +08:00
|
|
|
TileData tileData;
|
2023-04-20 07:28:17 +08:00
|
|
|
} CameraRay;
|
|
|
|
|
2023-04-01 07:16:14 +08:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
sf::Vector2f pos;
|
|
|
|
float direction;
|
2023-04-02 08:21:02 +08:00
|
|
|
unsigned int resolution;
|
2023-04-01 07:16:14 +08:00
|
|
|
float fov;
|
2023-04-20 07:28:17 +08:00
|
|
|
|
|
|
|
CameraRay* rays;
|
2023-04-01 07:16:14 +08:00
|
|
|
} Camera;
|
|
|
|
|
2023-04-20 07:28:17 +08:00
|
|
|
int camera_init(Camera* camera, sf::Vector2f pos, float direction, unsigned int resolution, float fov);
|
2023-04-16 09:17:11 +08:00
|
|
|
void camera_update(Camera* camera, float t);
|
2023-04-20 07:28:17 +08:00
|
|
|
void camera_destroy(Camera* camera);
|
2023-04-01 07:16:14 +08:00
|
|
|
|
|
|
|
#endif
|