MCPcopy Create free account
hub / github.com/MergHQ/CRYENGINE / DebugDrawDamageControlGraph

Method DebugDrawDamageControlGraph

Code/CryEngine/CryAISystem/DebugDraw.cpp:256–580  ·  view source on GitHub ↗

-----------------------------------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

254//
255//-----------------------------------------------------------------------------------------------------------
256void 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;

Callers

nothing calls this directly

Calls 15

GetISystemFunction · 0.85
Point_PointSqFunction · 0.85
sqrFunction · 0.85
CastToCAIActorSafeFunction · 0.85
cry_sprintfFunction · 0.85
CastToCPuppetMethod · 0.80
CastToCAIVehicleMethod · 0.80
Init2DModeMethod · 0.80
SetAlphaBlendedMethod · 0.80
SetBackFaceCullingMethod · 0.80
CastToCAIActorMethod · 0.80
GetAssociationMethod · 0.80

Tested by

no test coverage detected