std::list<location_component*> environment::nearest(point2 postion, unsigned int radius) { std::list<location_component*> list; m_space->find(postion.x(), postion.y(), radius, [&](int, int, location_component* component) { list.push_back(component); }); return list; }
void AABB2D::AddPoint( const point2& p ) { if ( p.x() > m_Max.x ) { m_Max.x = p.x(); } else if ( p.x() < m_Min.x ) { m_Min.x = p.x(); } if ( p.y() > m_Max.y ) { m_Max.y = p.y(); } else if ( p.y() < m_Min.y ) { m_Min.y = p.y(); } m_Len.x = std::abs(m_Max.x - m_Min.x); m_Len.y = std::abs(m_Max.y - m_Min.y);; }
Vec2 Point2toVec2( const point2& p ) { return Vec2( p.x(), p.y() ); }
void VectorGraphics::arc_negative(point2 p, length r, plane_angle a1, plane_angle a2) { cairo_arc_negative(cr(), p.x()/meters, p.y()/meters, r/meters, a1/radians, a2/radians); }
void VectorGraphics::rectangle(point2 p1, point2 p2) { cairo_rectangle(cr(), p1.x()/meters, p1.y()/meters, (p2.x()-p1.x())/meters, (p2.y()-p1.y())/meters); }
void VectorGraphics::line_to(point2 p) { cairo_line_to(cr(), p.x()/meters, p.y()/meters); }