Skip to content

Instantly share code, notes, and snippets.

View podgorskiy's full-sized avatar
🏠
Working from home

Stanislav Pidhorskyi podgorskiy

🏠
Working from home
View GitHub Profile
@podgorskiy
podgorskiy / aabb.h
Last active October 27, 2020 20:49
Drop in templated AABB class build on top of glm.
#pragma once
#include <glm/glm.hpp>
#include <limits>
namespace glm
{
template <int Dim, typename Type>
class aabb
{
public:
#pragma once
#include <Eigen/Dense>
#include <glm/matrix.hpp>
template<typename T, int m, int n>
inline glm::mat<m, n, float, glm::precision::highp> E2GLM(const Eigen::Matrix<T, m, n>& em)
{
glm::mat<m, n, float, glm::precision::highp> mat;
for (int i = 0; i < m; ++i)
{
@podgorskiy
podgorskiy / FrustumCull.h
Created July 12, 2017 10:33
Ready to use frustum culling code. Depends only on GLM. The input is only bounding box and ProjectionView matrix. Based on Inigo Quilez's code.
#include <glm/matrix.hpp>
class Frustum
{
public:
Frustum() {}
// m = ProjectionMatrix * ViewMatrix
Frustum(glm::mat4 m);