Rename Waypoint's GetTransform to ComputeTransform
This commit is contained in:
parent
13368d8d6d
commit
04c76acd7a
|
@ -14,7 +14,8 @@ namespace client {
|
|||
|
||||
Waypoint::Waypoint(SharedPtr<const Map> parent, road::element::Waypoint waypoint)
|
||||
: _parent(std::move(parent)),
|
||||
_waypoint(std::move(waypoint)) {}
|
||||
_waypoint(std::move(waypoint)),
|
||||
_transform(_waypoint.ComputeTransform()) {}
|
||||
|
||||
Waypoint::~Waypoint() = default;
|
||||
|
||||
|
|
|
@ -22,8 +22,8 @@ namespace client {
|
|||
|
||||
~Waypoint();
|
||||
|
||||
geom::Transform GetTransform() const {
|
||||
return _waypoint.GetTransform();
|
||||
const geom::Transform &GetTransform() const {
|
||||
return _transform;
|
||||
}
|
||||
|
||||
road::element::id_type GetRoadId() const {
|
||||
|
@ -45,6 +45,8 @@ namespace client {
|
|||
SharedPtr<const Map> _parent;
|
||||
|
||||
road::element::Waypoint _waypoint;
|
||||
|
||||
geom::Transform _transform;
|
||||
};
|
||||
|
||||
} // namespace client
|
||||
|
|
|
@ -19,7 +19,7 @@ namespace road {
|
|||
|
||||
Optional<Waypoint> Map::GetWaypoint(const geom::Location &loc) const {
|
||||
Waypoint w = Waypoint(shared_from_this(), loc);
|
||||
auto d = geom::Math::Distance2D(w.GetTransform().location, loc);
|
||||
auto d = geom::Math::Distance2D(w.ComputeTransform().location, loc);
|
||||
const RoadInfoLane *inf = _data.GetRoad(w._road_id)->GetInfo<RoadInfoLane>(w._dist);
|
||||
|
||||
if (d < inf->getLane(w._lane_id)->_width * 0.5) {
|
||||
|
|
|
@ -89,7 +89,7 @@ namespace element {
|
|||
|
||||
Waypoint::~Waypoint() = default;
|
||||
|
||||
geom::Transform Waypoint::GetTransform() const {
|
||||
geom::Transform Waypoint::ComputeTransform() const {
|
||||
road::element::DirectedPoint dp =
|
||||
_map->GetData().GetRoad(_road_id)->GetDirectedPointIn(_dist);
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ namespace element {
|
|||
|
||||
~Waypoint();
|
||||
|
||||
geom::Transform GetTransform() const;
|
||||
geom::Transform ComputeTransform() const;
|
||||
|
||||
id_type GetRoadId() const {
|
||||
return _road_id;
|
||||
|
|
Loading…
Reference in New Issue