DayZ 1.29
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ IsCollidingBBox()

bool Hologram::IsCollidingBBox ( ItemBase action_item = null)
inlineprotected

См. определение в файле Hologram.c строка 540

541 {
542 if (CfgGameplayHandler.GetDisableIsCollidingBBoxCheck())
543 return false;
544
545 vector center;
546 vector relativeOffset; //we need to lift BBox, because it is calculated from the bottom of projection, and not from the middle
547 vector absoluteOffset = "0 0.05 0"; //we need to lift BBox even more, because it colliddes with house floors due to various reasons (probably geometry or float imperfections)
548 vector orientation = GetProjectionOrientation();
549 vector edgeLength;
550 vector minMax[2];
551 array<Object> excludedObjects = new array<Object>();
552 array<Object> collidedObjects = new array<Object>();
553
555 relativeOffset[1] = (minMax[1][1] - minMax[0][1]) * 0.5;
556 center = m_Projection.GetPosition() + relativeOffset + absoluteOffset;
557 edgeLength = GetCollisionBoxSize(minMax);
558 excludedObjects.Insert(m_Projection);
559 excludedObjects.Insert(m_Player);
560
561 if (action_item)
562 excludedObjects.Insert(action_item);
563
564 //add is construction check
565 // Base building objects behave in a way that causes this test to generate false positives
566 bool isTrue = g_Game.IsBoxCollidingGeometry(center, orientation, edgeLength, ObjIntersectFire, ObjIntersectGeom, excludedObjects, collidedObjects);
567 #ifdef DIAG_DEVELOPER
568 if ( DiagMenu.GetBool(DiagMenuIDs.MISC_HOLOGRAM) )
569 {
570 string text = "";
571 foreach (Object object: collidedObjects)
572 text += " | " + Object.GetDebugName(object);
573
574 DebugLog("IsCollidingBBox: ", false, isTrue, text);
575
576 int color = 0x01FFFFFF;
577 if (isTrue)
578 color = 0x33F22613;
579
580 if (m_CollisionBox)
582 DrawDebugCollisionBox(minMax, color);
583 }
584 #endif
585
586 return isTrue;
587 }
void DrawDebugCollisionBox(vector min_max[2], int color)
Определения Construction.c:1170
Shape m_CollisionBox
Определения Construction.c:19
void DestroyDebugCollisionBox()
Определения Construction.c:1181
DayZGame g_Game
Определения DayZGame.c:3942
DiagMenuIDs
Определения EDiagMenuIDs.c:2
vector GetCollisionBoxSize(vector min_max[2])
Определения Hologram.c:1078
EntityAI m_Projection
Определения Hologram.c:22
PlayerBase m_Player
Определения Hologram.c:23
vector GetProjectionOrientation()
Определения Hologram.c:1502
void GetProjectionCollisionBox(out vector min_max[2])
Определения Hologram.c:1067
class LOD Object

Перекрестные ссылки DestroyDebugCollisionBox(), DrawDebugCollisionBox(), g_Game, DiagMenu::GetBool(), GetCollisionBoxSize(), CfgGameplayHandler::GetDisableIsCollidingBBoxCheck(), GetProjectionCollisionBox(), GetProjectionOrientation(), m_CollisionBox, m_Player и m_Projection.

Используется в EvaluateCollision().