2019-05-27 13:50:49 +02:00
|
|
|
//
|
|
|
|
// Created by trotfunky on 27/05/19.
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef RAYCASTING_PLAYER_H
|
|
|
|
#define RAYCASTING_PLAYER_H
|
|
|
|
|
2024-01-21 22:03:04 +00:00
|
|
|
#include <cmath>
|
|
|
|
|
|
|
|
static constexpr float deg_to_rad = 3.14159265/180;
|
2019-05-27 13:50:49 +02:00
|
|
|
|
|
|
|
class Player {
|
|
|
|
public:
|
|
|
|
Player(float x, float y, float alpha);
|
|
|
|
|
|
|
|
float x;
|
|
|
|
float y;
|
|
|
|
float orientation;
|
|
|
|
|
2024-01-21 22:03:04 +00:00
|
|
|
/* View properties. */
|
2019-06-01 06:42:29 +02:00
|
|
|
float fov = 70;
|
2024-01-21 22:03:04 +00:00
|
|
|
float sensorSize = 0.035; /* 35mm, about equivalent to human eye ? */
|
|
|
|
float focalLength = sensorSize / (2*tanf((fov*deg_to_rad)/2));
|
2019-06-01 06:42:29 +02:00
|
|
|
|
|
|
|
void move(float dx, float dy);
|
2024-01-21 20:31:51 +00:00
|
|
|
void rotate(float alpha);
|
2019-05-27 13:50:49 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif //RAYCASTING_PLAYER_H
|