50 lines
644 B
C
50 lines
644 B
C
#ifndef UTILS_H
|
|
#define UTILS_H
|
|
#include <stdbool.h>
|
|
|
|
/**
|
|
* GLSL-like three dimensional vector
|
|
*/
|
|
typedef struct vec3f
|
|
{
|
|
float x;
|
|
float y;
|
|
float z;
|
|
} vec3f;
|
|
|
|
typedef struct vec3i
|
|
{
|
|
int x;
|
|
int y;
|
|
int z;
|
|
} vec3i;
|
|
|
|
typedef struct vec4f
|
|
{
|
|
float x;
|
|
float y;
|
|
float z;
|
|
float w;
|
|
} vec4f;
|
|
|
|
/**
|
|
* Color with RGB components
|
|
*/
|
|
typedef struct Color
|
|
{
|
|
float red;
|
|
float green;
|
|
float blue;
|
|
} Color;
|
|
|
|
/**
|
|
* Calculates radian from degree.
|
|
*/
|
|
double degree_to_radian(double degree);
|
|
|
|
bool is_oob(int i, int min, int max);
|
|
|
|
void mult_matrix(float *matrix, vec4f vector, vec4f *ret);
|
|
|
|
#endif /* UTILS_H */
|