| 263 | } |
| 264 | |
| 265 | std::set<Handle::EntityHandle> ScriptEngine::getNPCsInRadius(const Math::float3& center, float radius) |
| 266 | { |
| 267 | std::set<Handle::EntityHandle> outSet; |
| 268 | float radSq = radius * radius; |
| 269 | |
| 270 | for (const Handle::EntityHandle& e : m_WorldNPCs) |
| 271 | { |
| 272 | Math::float3 translation = m_World.getEntity<Components::PositionComponent>(e).m_WorldMatrix.Translation(); |
| 273 | |
| 274 | if ((center - translation).lengthSquared() < radSq) |
| 275 | outSet.insert(e); |
| 276 | } |
| 277 | |
| 278 | return outSet; |
| 279 | } |
| 280 | |
| 281 | Handle::EntityHandle ScriptEngine::findWorldNPC(const std::string& name) |
| 282 | { |
no test coverage detected