/
redgpu
/
tech5
Обзор
Документация
Войти
/
redgpu
/
tech5
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
source/shared/idlib/bv/bounds2d.cpp
42 строки
1005 B
Justin Marshall
First pass idLib conversion from hex rays4.
08 авг 2026, 23:54
08 авг 2026, 23:54
09a4cb9
Код
Авторство
О чём код?
#include "bounds2d.h" bool idBounds2D::AddPoint(const idVec2& point) { bool expanded = false; if (point.x < bounds[0].x) { bounds[0].x = point.x; expanded = true; } if (point.x > bounds[1].x) { bounds[1].x = point.x; expanded = true; } if (point.y < bounds[0].y) { bounds[0].y = point.y; expanded = true; } if (point.y > bounds[1].y) { bounds[1].y = point.y; expanded = true; } return expanded; } bool idBounds2D::ContainsPoint(const idVec2& point) const { return point.x >= bounds[0].x && point.x <= bounds[1].x && point.y >= bounds[0].y && point.y <= bounds[1].y; } bool idBounds2D::IntersectBounds(const idBounds2D& other) const { if (&other == this) { return true; } return other.bounds[0].x <= bounds[1].x && other.bounds[1].x >= bounds[0].x && other.bounds[0].y <= bounds[1].y && other.bounds[1].y >= bounds[0].y; }