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

◆ IsCollidingEx()

bool IsCollidingEx ( CollisionCheckData check_data)
protected

Collision check for building part.

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

1071 {
1073 return false;
1074 ConstructionPart construction_part = GetConstructionPart( check_data.m_PartName );
1075
1076 if ( construction_part )
1077 {
1078 vector center;
1079 float absolute_ofset = 0.05; //we need to lift BBox even more, because it colliddes with house floors due to various reasons (probably geometry or float imperfections)
1080 vector edge_length;
1081 vector min_max[2]; //data used for creating trigger
1082 ref array<Object> excluded_objects = new array<Object>;
1083 ref array<Object> collided_objects = new array<Object>;
1084
1085 excluded_objects.Insert( GetParent() );
1086 if (check_data.m_AdditionalExcludes.Count() > 0)
1087 {
1088 excluded_objects.InsertAll(check_data.m_AdditionalExcludes);
1089 }
1090
1091 GetCollisionBoxData( check_data.m_PartName, min_max );
1092 center = GetBoxCenter( min_max );
1093 center = GetParent().ModelToWorld( center ); //convert to world coordinates
1094 edge_length = GetCollisionBoxSize( min_max );
1095
1096 if ( GetGame().IsBoxCollidingGeometry( Vector( center[0], center[1] + absolute_ofset, center[2] ), GetParent().GetOrientation(), edge_length, check_data.m_PrimaryGeometry, check_data.m_SecondaryGeometry, excluded_objects, collided_objects ) )
1097 {
1098 //Debug
1099 //DrawDebugCollisionBox( min_max, ARGB( 150, 255, 0, 0 ) );
1100 for (int i = 0; i < collided_objects.Count(); i++)
1101 {
1102 EntityAI entity = EntityAI.Cast(collided_objects.Get(i));
1103 if ( entity && !entity.IsIgnoredByConstruction() )
1104 return true;
1105 }
1106 }
1107 //Debug
1108 //DrawDebugCollisionBox( min_max, ARGB( 150, 255, 255, 255 ) );
1109 }
1110 return false;
1111 }
vector GetOrientation()
Определения AreaDamageManager.c:306
vector GetBoxCenter(vector min_max[2])
Определения Construction.c:1146
vector GetCollisionBoxSize(vector min_max[2])
Определения Construction.c:1113
void GetCollisionBoxData(string part_name, out vector min_max[2])
Определения Construction.c:1125
ConstructionPart GetConstructionPart(string part_name)
Определения Construction.c:280
static bool GetDisableIsCollidingCheck()
Определения CfgGameplayHandler.c:317
override bool IsIgnoredByConstruction()
Определения Transport.c:151
Определения Building.c:6
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
Определения EnConvert.c:106
proto native CGame GetGame()
proto native vector Vector(float x, float y, float z)
Vector constructor from components.
BaseBuildingBase GetParent()
Get parent of the Effect.
Определения Construction.c:40

Перекрестные ссылки CollisionCheckData(), GetBoxCenter(), GetCollisionBoxData(), GetCollisionBoxSize(), GetConstructionPart(), CfgGameplayHandler::GetDisableIsCollidingCheck(), GetGame(), GetOrientation(), GetParent(), EntityAI::IsIgnoredByConstruction() и Vector().