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

◆ IsColliding()

bool IsColliding ( string part_name)
protected

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

1022 {
1024 return false;
1025 ConstructionPart construction_part = GetConstructionPart( part_name );
1026
1027 if ( construction_part )
1028 {
1029 vector center;
1030 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)
1031 vector edge_length;
1032 vector min_max[2]; //data used for creating trigger
1033 ref array<Object> excluded_objects = new array<Object>;
1034 ref array<Object> collided_objects = new array<Object>;
1035
1036 excluded_objects.Insert( GetParent() );
1037
1038 //get min_max and center from config and memory points
1039 GetCollisionBoxData( part_name, min_max );
1040
1041 center = GetBoxCenter( min_max );
1042 center = GetParent().ModelToWorld( center ); //convert to world coordinates
1043 edge_length = GetCollisionBoxSize( min_max );
1044
1045 //Create trigger
1046 //CreateCollisionTrigger( part_name, min_max, center );
1047
1048 //check collision on box trigger and collision box
1049 //IsTrigger colliding was turned off (for now) for easier way to build something with other players around
1050 if ( /* IsTriggerColliding() || */ GetGame().IsBoxCollidingGeometry( Vector( center[0], center[1] + absolute_ofset, center[2] ), GetParent().GetOrientation(), edge_length, ObjIntersectView, ObjIntersectGeom, excluded_objects, collided_objects ) )
1051 {
1052 //Debug
1053// DrawDebugCollisionBox( min_max, ARGB( 150, 255, 0, 0 ) );
1054 //
1055 for (int i = 0; i < collided_objects.Count(); i++)
1056 {
1057 //Print(collided_objects.Get(i).GetType());
1058 EntityAI entity = EntityAI.Cast(collided_objects.Get(i));
1059 if ( entity && !entity.IsIgnoredByConstruction() )
1060 return true;
1061 }
1062 }
1063 //Debug
1064// DrawDebugCollisionBox( min_max, ARGB( 150, 255, 255, 255 ) );
1065 }
1066 return false;
1067 }
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

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