1
This commit is contained in:
parent
1bf347bf12
commit
a4a8586f36
@ -11,6 +11,12 @@ namespace mt
|
||||
|
||||
void SafeAreaSafePoint::Init1()
|
||||
{
|
||||
auto itr = _type_safe_points_hash.find(type());
|
||||
if (itr == _type_safe_points_hash.end()) {
|
||||
_type_safe_points_hash[type()] = std::vector<glm::vec3>();
|
||||
itr = _type_safe_points_hash.find(type());
|
||||
}
|
||||
itr->second.push_back(glm::vec3(x(), y(), z()));
|
||||
}
|
||||
|
||||
void SafeAreaSafePoint::StaticPostInit()
|
||||
@ -19,7 +25,9 @@ namespace mt
|
||||
|
||||
glm::vec3* SafeAreaSafePoint::RandPoint(int type) const
|
||||
{
|
||||
|
||||
auto itr = _type_safe_points_hash.find(type);
|
||||
return itr != _type_safe_points_hash.end() && !itr->second.empty() ?
|
||||
&itr->second.at(rand() % itr->second.size()) : nullptr;
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user