fix crouching check

This commit is contained in:
MihailRis 2026-02-24 03:34:17 +03:00
parent b52e990e40
commit ad5089f383
2 changed files with 48 additions and 41 deletions

View file

@ -47,14 +47,14 @@ struct AABB {
}
/// @brief Multiply AABB size from center
inline void scale(const glm::vec3 mul) {
inline void scale(const glm::vec3& mul) {
glm::vec3 center = (a + b) * 0.5f;
a = (a - center) * mul + center;
b = (b - center) * mul + center;
}
/// @brief Multiply AABB size from given origin
inline void scale(const glm::vec3 mul, const glm::vec3 orig) {
inline void scale(const glm::vec3& mul, const glm::vec3& orig) {
glm::vec3 beg = min();
glm::vec3 end = max();
glm::vec3 center = glm::mix(beg, end, orig);
@ -101,8 +101,9 @@ struct AABB {
inline bool intersects(const AABB& aabb) const {
return (
a.x <= aabb.b.x && b.x >= aabb.a.x && a.y <= aabb.b.y &&
b.y >= aabb.a.y && a.z <= aabb.b.z && b.z >= aabb.a.z
a.x <= aabb.b.x && b.x >= aabb.a.x &&
a.y <= aabb.b.y && b.y >= aabb.a.y &&
a.z <= aabb.b.z && b.z >= aabb.a.z
);
}