{"categories":[],"author_name":"naoppy_ac","version":"1.0","image_url":"https://cdn-ak.f.st-hatena.com/images/fotolife/n/naoppy_ac/20240305/20240305115406.png","url":"https://naoppy.hateblo.jp/entry/2024/03/05/141056","published":"2024-03-05 14:10:56","type":"rich","blog_title":"naoppy\u306e\u65e5\u8a18","blog_url":"https://naoppy.hateblo.jp/","provider_name":"Hatena Blog","height":"190","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fnaoppy.hateblo.jp%2Fentry%2F2024%2F03%2F05%2F141056\" title=\"\u5186\u3068\u8ef8\u4e26\u884c\u77e9\u5f62\u306e\u5f53\u305f\u308a\u5224\u5b9a (Circle to AABB) - naoppy\u306e\u65e5\u8a18\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","title":"\u5186\u3068\u8ef8\u4e26\u884c\u77e9\u5f62\u306e\u5f53\u305f\u308a\u5224\u5b9a (Circle to AABB)","width":"100%","provider_url":"https://hatena.blog","author_url":"https://blog.hatena.ne.jp/naoppy_ac/","description":"\u5148\u306b\u7d50\u8ad6\u3092\u66f8\u304d\u307e\u3059\u3002 \u5186\u3092\u4e2d\u5fc3\u304c (x, y) \u534a\u5f84 r \u3067\u8ef8\u4e26\u884c\u77e9\u5f62\u306e\u4e2d\u5fc3\u304c (cx, cy) \u6a2a\u5e45\u304c w \u7e26\u5e45\u304c h \u3068\u3059\u308b\u3068\u3001 bool HitTestCircle2AABB(float x, float y, float r, float cx, float cy, float h, float w) { float dx = std::max(0.f, std::abs(x - cx) - w); float dy = std::max(0.f, std::abs(y - cy) - h); return dx * dx + dy * dy <= r * r; } \u5c0e\u51fa \u30a2\u30a4\u30c7\u30a21 \u2026"}