#pragma once #include "Vertex.h" #include "Matrix.h" #include enum class Axis { X, Y, Z }; enum class ColRef { Red, Green, Blue }; template int sgn(T val) { return (T(0) < val) - (val < T(0)); } namespace SharedTools { const float PI = (float)acos(-1); int BoundsCheck(int min, int max, int value); float BoundsCheck(float min, float max, float value); Matrix GetTranslateMatrix(const float x, const float y, const float z); Matrix GetTranslateMatrix(const Vertex& position); Matrix GetScaleMatrix(const float x, const float y, const float z); Matrix GetRotationMatrix(const Axis rotAxis, const float rotDegrees); Matrix GetRotationMatrixFromPoint(const Axis rotAxis, const float rotDegrees, const float x, const float y, const float z); Matrix GetOrthegraphicProjectionMatrix(float d); Matrix GetPerspectiveProjectionMatrix(float d, float aspectRatio); Matrix GetViewMatrix(float d, int width, int height); Matrix GetCameraRotationMatrix(const Axis rotAxis, const float rotDegrees); Matrix GetCameraTranslateMatrix(const float x, const float y, const float z); Matrix GetCameraTranslateMatrix(const Vertex& position); float DegreesToRadians(const float degrees); };