#pragma once #include #include #include #include #include #define DllExport __declspec( dllexport ) typedef unsigned int uint; template struct Array { T* data; size_t len; size_t cap; inline T& operator[](int i) { return data[i]; } }; template void append(Array& a, T el); template T pop(Array& a); template void resize(Array& a, size_t new_cap); template void clear(Array& a); bool read_file(Array* out, const char* filepath); Array split_str(const char* s, char delimiter); Array split_str(const char* s); glm::mat4 quat_to_mat4(glm::quat q); template T lerp(T start, T end, float t) { return t * end + (1 - t) * start; } template float ilerp(T start, T end, T pos) { return (pos - start) / (end - start); } float randf(); // returns a float between 0 and 1