Pathfollowing component의 문제와 해결방법

문제점

AIController를 생성하면 기본적으로 Pathfollowing component가 서브오브젝트로 생성된다.
그런데 이 Pathfollowing component는 Navmesh boundary의 지형/지물만을 인식해서 길을 찾아갈뿐 앞에 있는 Pawn을 인식하지못한다.

결과적으로, 메쉬의 콜리전이 켜있을경우 한 봇의 메쉬가 다른 봇의 캡슐과 충돌해 봇이 공중부양 하고 Output Log에서는 Warning을 미친듯이 뽑아낸다.

한두시간 삽질끝에 알아낸 해결방법. 계속 읽기 “Pathfollowing component의 문제와 해결방법”

C++에서 구글 Geocode 이용하기

C++ Rest SDK를 이용해서 간단히 짜보았다.

struct geocodelocation
{
double lat;
double lng;
};

geocodelocation getGeocodeLocation(wstring& Address)
{
geocodelocation loc;
uri_builder uri(U(“http://maps.google.com/maps/api/geocode/json”));
uri.set_query(U(“address=”) + uri::encode_uri(Address));

http_client client(uri.to_uri());

http_request req(methods::GET);
client.request(req).then([=,&loc](http_response r){
r.extract_json(true).then([&loc](json::value v) {
//wcout << v.at(U(“lat”)).as_string() << endl;
json::value results = v.at(U(“results”));
for (int i = 0; i < results.size(); i++)
{
auto geometry = results[i].at(U(“geometry”));
auto location = geometry.at(U(“location”));

loc.lat = location.at(U(“lat”)).as_double();
loc.lng = location.at(U(“lng”)).as_double();
}
}).wait();

}).wait();

return loc;
}

짧지만 람다식을 써보는게 처음이라 삽질을 좀 했다. 테스트 결과 잘 작동한다.