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

◆ IsInTerrain()

bool Hologram::IsInTerrain ( )
inlineprotected

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

941 {
942 if (CfgGameplayHandler.GetDisableIsInTerrainCheck())
943 return false;
944 vector fromHeightOffset = "0 0.3 0";
945 vector toHeightOffset = "0 1 0";
946
947 vector from_left_close = m_Projection.CoordToParent( GetLeftCloseProjectionVector() ) + fromHeightOffset;
948 vector to_left_close_down = from_left_close + toHeightOffset;
949
950 vector from_right_close = m_Projection.CoordToParent( GetRightCloseProjectionVector() ) + fromHeightOffset;
951 vector to_right_close_down = from_right_close + toHeightOffset;
952
953 vector from_left_far = m_Projection.CoordToParent( GetLeftFarProjectionVector() ) + fromHeightOffset;
954 vector to_left_far_down = from_left_far + toHeightOffset;
955
956 vector from_right_far = m_Projection.CoordToParent( GetRightFarProjectionVector() ) + fromHeightOffset;
957 vector to_right_far_down = from_right_far + toHeightOffset;
958
959 vector contact_pos_left_close;
960 vector contact_pos_right_close;
961 vector contact_pos_left_far;
962 vector contact_pos_right_far;
963
964 vector contact_dir_left_close;
965 vector contact_dir_right_close;
966 vector contact_dir_left_far;
967 vector contact_dir_right_far;
968
969 int contact_component_left_close;
970 int contact_component_right_close;
971 int contact_component_left_far;
972 int contact_component_right_far;
973
974 #ifdef DIAG_DEVELOPER
975 // I'd rather duplicate this on internal than introduce (even) more raycasts than needed on retail..
976 set<Object> lcO = new set<Object>();
977 set<Object> rcO = new set<Object>();
978 set<Object> lfO = new set<Object>();
979 set<Object> rfO = new set<Object>();
980 bool lc = DayZPhysics.RaycastRV( from_left_close, to_left_close_down, contact_pos_left_close, contact_dir_left_close, contact_component_left_close, lcO, m_Projection, m_Projection, false, true, ObjIntersectFire );
981 bool rc = DayZPhysics.RaycastRV( from_right_close, to_right_close_down, contact_pos_right_close, contact_dir_right_close, contact_component_right_close, rcO, m_Projection, m_Projection, false, true, ObjIntersectFire );
982 bool lf = DayZPhysics.RaycastRV( from_left_far, to_left_far_down, contact_pos_left_far, contact_dir_left_far, contact_component_left_far, lfO, m_Projection, m_Projection, false, true, ObjIntersectFire );
983 bool rf = DayZPhysics.RaycastRV( from_right_far, to_right_far_down, contact_pos_right_far, contact_dir_right_far, contact_component_right_far, rfO, m_Projection, m_Projection, false, true, ObjIntersectFire );
984 bool isTrue = ( lc || rc || lf || rf );
985 string text = "";
986 if (isTrue)
987 {
988 if (lc)
989 text += " | lc";
990 if (rc)
991 text += " | rc";
992 if (lf)
993 text += " | lf";
994 if (rf)
995 text += " | rf";
996
997 if (lcO.Count() > 0)
998 text += " | lcO: " + lcO[0];
999 if (rcO.Count() > 0)
1000 text += " | rcO: " + rcO[0];
1001 if (lfO.Count() > 0)
1002 text += " | lfO: " + lfO[0];
1003 if (rfO.Count() > 0)
1004 text += " | rfO: " + rfO[0];
1005
1006 array<bool> conditions = {!lc, !rc, !lf, !rf};
1007 DrawBaseSpheres(conditions);
1008 }
1009 DebugLog("IsInTerrain: ", false, isTrue, text);
1010 #endif
1011
1012 if (DayZPhysics.RaycastRV( from_left_close, to_left_close_down, contact_pos_left_close, contact_dir_left_close, contact_component_left_close, NULL, m_Projection, m_Projection, false, true, ObjIntersectFire ))
1013 return true;
1014
1015 if (DayZPhysics.RaycastRV( from_right_close, to_right_close_down, contact_pos_right_close, contact_dir_right_close, contact_component_right_close, NULL,m_Projection, m_Projection, false, true, ObjIntersectFire ))
1016 return true;
1017
1018 if (DayZPhysics.RaycastRV( from_left_far, to_left_far_down, contact_pos_left_far, contact_dir_left_far, contact_component_left_far, NULL, m_Projection, m_Projection, false, true, ObjIntersectFire ))
1019 return true;
1020
1021 if (DayZPhysics.RaycastRV( from_right_far, to_right_far_down, contact_pos_right_far, contact_dir_right_far, contact_component_right_far, NULL, m_Projection, m_Projection, false, true, ObjIntersectFire ))
1022 return true;
1023
1024 return false;
1025 }
vector GetLeftFarProjectionVector()
Определения Hologram.c:1107
EntityAI m_Projection
Определения Hologram.c:22
vector GetRightFarProjectionVector()
Определения Hologram.c:1116
vector GetLeftCloseProjectionVector()
Определения Hologram.c:1089
vector GetRightCloseProjectionVector()
Определения Hologram.c:1097

Перекрестные ссылки CfgGameplayHandler::GetDisableIsInTerrainCheck(), GetLeftCloseProjectionVector(), GetLeftFarProjectionVector(), GetRightCloseProjectionVector(), GetRightFarProjectionVector(), m_Projection и DayZPhysics::RaycastRV().

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