[core] Cleanup function signatures in CollisionTile
- Prefer pass-by-value for primitive types. - Use floating point precision for yStretch to match receiving type.
This commit is contained in:
@@ -36,7 +36,7 @@ CollisionTile::CollisionTile(PlacementConfig config_) : config(std::move(config_
|
||||
|
||||
// The amount the map is squished depends on the y position.
|
||||
// Sort of account for this by making all boxes a bit bigger.
|
||||
yStretch = std::pow(_yStretch, 1.3);
|
||||
yStretch = std::pow(_yStretch, 1.3f);
|
||||
}
|
||||
|
||||
|
||||
@@ -80,7 +80,7 @@ float CollisionTile::findPlacementScale(float minPlacementScale, const Point<flo
|
||||
return minPlacementScale;
|
||||
}
|
||||
|
||||
float CollisionTile::placeFeature(const CollisionFeature& feature, const bool allowOverlap, const bool avoidEdges) {
|
||||
float CollisionTile::placeFeature(const CollisionFeature& feature, bool allowOverlap, bool avoidEdges) {
|
||||
|
||||
float minPlacementScale = minScale;
|
||||
|
||||
@@ -124,7 +124,7 @@ float CollisionTile::placeFeature(const CollisionFeature& feature, const bool al
|
||||
return minPlacementScale;
|
||||
}
|
||||
|
||||
void CollisionTile::insertFeature(CollisionFeature& feature, const float minPlacementScale, const bool ignorePlacement) {
|
||||
void CollisionTile::insertFeature(CollisionFeature& feature, float minPlacementScale, bool ignorePlacement) {
|
||||
for (auto& box : feature.boxes) {
|
||||
box.placementScale = minPlacementScale;
|
||||
}
|
||||
@@ -156,7 +156,7 @@ Box CollisionTile::getTreeBox(const Point<float>& anchor, const CollisionBox& bo
|
||||
};
|
||||
}
|
||||
|
||||
std::vector<IndexedSubfeature> CollisionTile::queryRenderedSymbols(const GeometryCoordinates& queryGeometry, const float scale) {
|
||||
std::vector<IndexedSubfeature> CollisionTile::queryRenderedSymbols(const GeometryCoordinates& queryGeometry, float scale) {
|
||||
|
||||
std::vector<IndexedSubfeature> result;
|
||||
if (queryGeometry.empty()) return result;
|
||||
|
||||
@@ -39,10 +39,10 @@ class CollisionTile {
|
||||
public:
|
||||
explicit CollisionTile(PlacementConfig);
|
||||
|
||||
float placeFeature(const CollisionFeature&, const bool allowOverlap, const bool avoidEdges);
|
||||
void insertFeature(CollisionFeature&, const float minPlacementScale, const bool ignorePlacement);
|
||||
float placeFeature(const CollisionFeature&, bool allowOverlap, bool avoidEdges);
|
||||
void insertFeature(CollisionFeature&, float minPlacementScale, bool ignorePlacement);
|
||||
|
||||
std::vector<IndexedSubfeature> queryRenderedSymbols(const GeometryCoordinates&, const float scale);
|
||||
std::vector<IndexedSubfeature> queryRenderedSymbols(const GeometryCoordinates&, float scale);
|
||||
|
||||
const PlacementConfig config;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user