1
This commit is contained in:
parent
73177454cc
commit
e908a1e8e9
@ -362,4 +362,16 @@ namespace a8
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool IntersectCylinderCylinder(const glm::vec3& a_pos, float a_rad, float a_height,
|
||||
const glm::vec3& b_pos, float b_rad, float b_height)
|
||||
{
|
||||
glm::vec2 v = glm::vec2(b_pos.x, b_pos.z) - glm::vec2(a_pos.x, a_pos.z);
|
||||
float n = glm::length(v);
|
||||
if (n > a_rad + b_rad) {
|
||||
return false;
|
||||
}
|
||||
return (a_pos.y - b_pos.y) < (a_height + b_height) / 2.0f;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -16,6 +16,9 @@ namespace a8
|
||||
float b_width,
|
||||
float b_height);
|
||||
bool IntersectCircleCircle(a8::Vec2 a_pos, float a_rad, a8::Vec2 b_pos, float b_rad);
|
||||
bool IntersectCylinderCylinder(const glm::vec3& a_pos, float a_rad, float a_height,
|
||||
const glm::vec3& b_pos, float b_rad, float b_height);
|
||||
|
||||
bool IntersectCircleArc(a8::Vec2 a_pos,
|
||||
float a_rad,
|
||||
a8::Vec2 b_pos,
|
||||
|
Loading…
x
Reference in New Issue
Block a user