Started work on cache for canvas components

This commit is contained in:
Yousef Khadadeh 2025-07-19 15:57:09 +03:00
parent c7842c2924
commit 1095b91cec
15 changed files with 261 additions and 74 deletions

View file

@ -38,6 +38,9 @@ namespace SCollision {
bool operator==(const AABB<T>& other) const {
return min == other.min && max == other.max;
}
bool fully_contains_aabb(const AABB<T>& other) const {
return other.min.x() >= min.x() && other.min.y() >= min.y() && other.max.x() <= max.x() && other.max.y() <= max.y();
}
template <typename S> AABB<S> transform(const std::function<Vector<S, 2>(const Vector<T, 2>&)>& transformFunc, const std::function<S(const T&)>& transformLinearFunc) const {
Vector<S, 2> aabb1 = transformFunc(min);
Vector<S, 2> aabb2 = transformFunc(max);