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

◆ IsBoxColliding()

proto native bool CGame::IsBoxColliding ( vector center,
vector orientation,
vector edgeLength,
array< Object > excludeObjects,
array< Object > collidedObjects = NULL )
protected

Finds all objects that are in choosen oriented bounding box (OBB)

Аргументы
centervector, center of OBB
orientationvector, direction (front vector), used for calculation of OBB rotation
edgeLengthvector, sizes of whole box
excludeObjectsarray<Object>, objects that should be excluded from collision check
collidedObjectsarray<Object>, out parameter, objects that collided with OBB
Возвращает
bool, true if at least one object collided with OBB, false otherwise
Заметки
Object that doesn't have collision geometry will be ignored, as this only uses geometry
vector orientation = GetOrientation();
vector size = "10 4 8";
array<Object> excluded_objects = new array<Object>;
excluded_objects.Insert(this);
array<Object> nearby_objects = new array<Object>;
if(GetGame().IsBoxColliding( pos, orientation, size, excluded_objects, nearby_objects))
{
for (int i = 0, c = nearby_objects.Count(); i < c; ++i)
{
PrintString("object " + i.ToString());
}
}
vector GetOrientation()
Определения AreaDamageManager.c:306
proto native bool IsBoxColliding(vector center, vector orientation, vector edgeLength, array< Object > excludeObjects, array< Object > collidedObjects=NULL)
Finds all objects that are in choosen oriented bounding box (OBB)
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
Определения EnConvert.c:106
proto native CGame GetGame()
void PrintString(string s)
Helper for printing out string expression. Example: PrintString("Hello " + var);.
Определения EnScript.c:345
class JsonUndergroundAreaTriggerData GetPosition
Определения UndergroundAreaLoader.c:9

Используется в EntityAI::IsAreaAtDoorFree().