DayZ 1.27
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 = GetGame().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 DebugText("IsCollidingBBox: ", false, isTrue, text);
575
576 int color = 0x01FFFFFF;
577 if (isTrue)
578 color = 0x33F22613;
579
580 DrawDebugCollisionBox(minMax, color);
581 }
582 #endif
583
584 return isTrue;
585 }
void DrawDebugCollisionBox(vector min_max[2], int color)
Определения Construction.c:1170
DiagMenuIDs
Определения EDiagMenuIDs.c:2
proto native bool IsBoxCollidingGeometry(vector center, vector orientation, vector edgeLength, int iPrimaryType, int iSecondaryType, array< Object > excludeObjects, array< Object > collidedObjects=NULL)
Finds all objects with geometry iType that are in choosen oriented bounding box (OBB)
vector GetCollisionBoxSize(vector min_max[2])
Определения Hologram.c:1027
EntityAI m_Projection
Определения Hologram.c:22
PlayerBase m_Player
Определения Hologram.c:23
vector GetProjectionOrientation()
Определения Hologram.c:1453
void GetProjectionCollisionBox(out vector min_max[2])
Определения Hologram.c:1016
class LOD Object
proto native CGame GetGame()

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

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