worked on 3d models within map
adjusted grid factory adjusted nav mesh factory minoor changes/fixes new helper classes refactoring
This commit is contained in:
@@ -44,6 +44,19 @@ struct HelperPoly {
|
||||
bbox_cm.add(p.xy());
|
||||
}
|
||||
|
||||
|
||||
void shrink(float cm) {
|
||||
Point2 center;
|
||||
for (const Point2 pt : points_cm) {center += pt;}
|
||||
center /= points_cm.size();
|
||||
for (Point2& pt : points_cm) {
|
||||
Point2 dir = pt - center;
|
||||
float len = dir.length();
|
||||
dir = dir.normalized();
|
||||
pt = center + dir * (len-cm);
|
||||
}
|
||||
}
|
||||
|
||||
/** does the polygon contain the given point (in cm)? */
|
||||
bool contains(const Point2 p_cm) const {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user