void GraphicsWorld::DebugDrawCircle(const Circle &c, int numSubdivisions, const Color &clr, bool depthTest) { float3 p = c.GetPoint(0); for(int i = 1; i <= numSubdivisions; ++i) { float3 p2 = c.GetPoint(i * 2.f * 3.14f / numSubdivisions); DebugDrawLineSegment(LineSegment(p, p2), clr, depthTest); p = p2; } }
float3 Capsule::PointInside(float l, float a, float d) const { Circle c = CrossSection(l); return c.GetPoint(a*2.f*pi, d); }
static inline bool IsColliding( Circle a,Point b ){ return b.GetDistance(a.GetPoint()) <= a.r; }
static inline bool IsColliding( Circle& b,Circle& a ){ if ( a.GetPoint().GetDistance(b.GetPoint()) <= b.r+a.r){ return true; } return false; }