/
redgpu
/
GDMagArchive
Обзор
Документация
Войти
/
redgpu
/
GDMagArchive
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
aug00/sharp/math/BoundingBox.h
32 строки
732 B
Don Williamson
first commit
31 окт 2016, 17:03
31 окт 2016, 17:03
c823e7b
Код
Авторство
О чём код?
#ifndef BOUNDINGBOX_H #define BOUNDINGBOX_H // This is a little helper class to stor the dimensions of an axis-aligned box. #include <math/Vector.h> class BoundingBox { public: BoundingBox(float minX = 0, float minY = 0, float minZ = 0, float maxX = 0, float maxY = 0, float maxZ = 0) { this->minX = minX; this->minY = minY; this->minZ = minZ; this->sizeX = maxX-minX; this->sizeY = maxY-minY; this->sizeZ = maxZ-minZ; } bool isInside(const Vector& pt) { return (pt.x >= minX && pt.x <= minX+sizeX && pt.y >= minY && pt.y <= minY+sizeY && pt.z >= minZ && pt.z <= minZ+sizeZ); } float minX, minY, minZ, sizeX, sizeY, sizeZ; protected: }; #endif //BOUNDINGBOX_H