raycasting/camera.h

29 lines
486 B
C
Raw Permalink Normal View History

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>
#include "level.h"
2023-04-01 07:16:14 +08:00
typedef struct
{
float direction;
float distance;
TileData tileData;
} CameraRay;
2023-04-01 07:16:14 +08:00
typedef struct
{
sf::Vector2f pos;
float direction;
unsigned int resolution;
2023-04-01 07:16:14 +08:00
float fov;
CameraRay* rays;
2023-04-01 07:16:14 +08:00
} Camera;
int camera_init(Camera* camera, sf::Vector2f pos, float direction, unsigned int resolution, float fov);
void camera_update(Camera* camera, float t);
void camera_destroy(Camera* camera);
2023-04-01 07:16:14 +08:00
#endif