aboutsummaryrefslogtreecommitdiff
path: root/viewpoint.h
blob: 0aae5dbe044eef25a34e11aca4bbbf4756e39adb (plain)
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
#ifndef VIEWPOINT_H
#define VIEWPOINT_H

#include "vector.h"

// 90 degrees
#define FOV 3.1415/2

typedef struct {
	// Viewpoint dimensions
	unsigned int width;
	unsigned int height;

	// Position and orientation
	vector_t position, target;

	// Viewpoint shift vectors
	// Calculated at initialisation
	vector_t qx, qy;
	// Left button center pixel location
	vector_t blc;
} viewpoint_t;

// Todo handle initial setup
void viewpoint_init(viewpoint_t *view);

void viewpoint_ray(viewpoint_t *view, vector_t *r, unsigned x, unsigned y);
#endif