#pragma once #include "../utils/common.h" class Voxels { public: Voxels(const std::string &path); int nVoxels() const { return _voxels->n(); } int nCorners() const { return _corners->n(); } int nGrids() const { return _steps[0] * _steps[1] * _steps[2]; } glm::vec3 voxelSize() const { return (_bbox[1] - _bbox[0]) / (glm::vec3)_steps; } void toVoxelIndices(sptr> gi, sptr> o_vi) const; private: glm::vec3 _bbox[2]; glm::ivec3 _steps; sptr> _voxels; sptr> _cornerIndices; sptr> _corners; sptr> _voxelIndicesInGrid; };