MCPcopy Create free account
hub / github.com/9chu/LuaSTGPlus / CollisionCheck

Method CollisionCheck

LuaSTGPlus/GameObjectPool.cpp:339–371  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

337}
338
339bool GameObjectBentLaser::CollisionCheck(float x, float y, float rot, float a, float b, bool rect)LNOEXCEPT
340{
341 // ����ֻ��һ���ڵ�����
342 if (m_Queue.Size() <= 1)
343 return false;
344
345 GameObject testObjA;
346 testObjA.Reset();
347 testObjA.rot = 0.;
348 testObjA.rect = false;
349
350 GameObject testObjB;
351 testObjB.Reset();
352 testObjB.x = x;
353 testObjB.y = y;
354 testObjB.rot = rot;
355 testObjB.a = a;
356 testObjB.b = b;
357 testObjB.rect = rect;
358 testObjB.UpdateCollisionCirclrRadius();
359
360 for (size_t i = 0; i < m_Queue.Size(); ++i)
361 {
362 LaserNode& n = m_Queue[i];
363 testObjA.x = n.pos.x;
364 testObjA.y = n.pos.y;
365 testObjA.a = testObjA.b = n.half_width;
366 testObjA.UpdateCollisionCirclrRadius();
367 if (::CollisionCheck(&testObjA, &testObjB))
368 return true;
369 }
370 return false;
371}
372
373bool GameObjectBentLaser::BoundCheck()LNOEXCEPT
374{

Callers

nothing calls this directly

Calls 4

CollisionCheckFunction · 0.85
SizeMethod · 0.45
ResetMethod · 0.45

Tested by

no test coverage detected