worked on floorplan (v2)

worked on grid-generation (v2)
new helper methods for geometry
new test cases
This commit is contained in:
2016-07-13 19:11:18 +02:00
parent cc21cbb0ea
commit 34e52cd7f0
26 changed files with 2083 additions and 272 deletions

View File

@@ -30,12 +30,22 @@ struct GridPoint {
return x_cm == o.x_cm && y_cm == o.y_cm && z_cm == o.z_cm;
}
/** not equal? */
bool operator != (const GridPoint& o) const {
return x_cm != o.x_cm || y_cm != o.y_cm || z_cm != o.z_cm;
}
/** get the distance (in meter) betwen this and the given point */
float getDistanceInMeter(const GridPoint& other) const {
return getDistanceInCM(other) / 100.0f;
}
/** get the distance (in centimeter) betwen this and the given point */
float getDistanceInCM(const GridPoint& other) const {
const int dx = x_cm - other.x_cm;
const int dy = y_cm - other.y_cm;
const int dz = z_cm - other.z_cm;
return std::sqrt(dx*dx + dy*dy + dz*dz) / 100.0f;
return std::sqrt(dx*dx + dy*dy + dz*dz);
}
/** cast to Point3 */