-----------------------------------------------------------------------------------------------------------
| 254 | // |
| 255 | //----------------------------------------------------------------------------------------------------------- |
| 256 | void CAISystem::DebugDrawDamageControlGraph() const |
| 257 | { |
| 258 | FUNCTION_PROFILER(GetISystem(), PROFILE_AI); |
| 259 | |
| 260 | CDebugDrawContext dc; |
| 261 | Vec3 camPos = dc->GetCameraPos(); |
| 262 | |
| 263 | static std::vector<CPuppet*> shooters; |
| 264 | shooters.clear(); |
| 265 | |
| 266 | AIActorSet::const_iterator it = m_enabledAIActorsSet.begin(); |
| 267 | AIActorSet::const_iterator itEnd = m_enabledAIActorsSet.end(); |
| 268 | for (; it != itEnd; ++it) |
| 269 | { |
| 270 | CAIActor* pAIActor = it->GetAIObject(); |
| 271 | if (!pAIActor) |
| 272 | continue; |
| 273 | |
| 274 | CPuppet* pPuppet = pAIActor->CastToCPuppet(); |
| 275 | if (!pPuppet) |
| 276 | continue; |
| 277 | |
| 278 | if (pPuppet->CastToCAIVehicle()) |
| 279 | continue; |
| 280 | |
| 281 | if (!pPuppet->m_targetDamageHealthThrHistory) |
| 282 | continue; |
| 283 | |
| 284 | if (Distance::Point_PointSq(camPos, pPuppet->GetPos()) > sqr(150.f)) |
| 285 | continue; |
| 286 | |
| 287 | shooters.push_back(pPuppet); |
| 288 | } |
| 289 | |
| 290 | if (shooters.empty()) |
| 291 | return; |
| 292 | |
| 293 | dc->Init2DMode(); |
| 294 | dc->SetAlphaBlended(true); |
| 295 | dc->SetBackFaceCulling(false); |
| 296 | |
| 297 | const Vec3 u(1, 0, 0); |
| 298 | const Vec3 v(0, -1, 0); |
| 299 | const Vec3 w(0, 0, 1); |
| 300 | |
| 301 | static std::vector<Vec3> values; |
| 302 | |
| 303 | if (gAIEnv.CVars.DebugDrawDamageControl > 2) |
| 304 | { |
| 305 | // Combined graph |
| 306 | static std::vector<CAIActor*> targets; |
| 307 | targets.clear(); |
| 308 | for (unsigned int i = 0; i < shooters.size(); ++i) |
| 309 | { |
| 310 | CPuppet* pPuppet = shooters[i]; |
| 311 | if (pPuppet->GetAttentionTarget()) |
| 312 | { |
| 313 | CAIActor* pTargetActor = 0; |
nothing calls this directly
no test coverage detected