mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-07 03:51:50 +00:00
fix crouching check
This commit is contained in:
parent
b52e990e40
commit
ad5089f383
2 changed files with 48 additions and 41 deletions
|
|
@ -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
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue