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

◆ DetectFlippedUsingWheels()

bool DetectFlippedUsingWheels ( VehicleFlippedContext ctx,
bool disallowSide )
protected

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

76 {
77 if (disallowSide && (vector.Dot(GetDirectionUp(), vector.Up) < 0.7))
78 {
79 // return as "flipped", vehicle isn't pointing enough up to be reasonably certain
80 return true;
81 }
82
83 int wheelCount = WheelCount();
84
85 for (int wheelIdx = 0; wheelIdx < wheelCount; wheelIdx++)
86 {
87 if (!WheelHasContact(wheelIdx))
88 {
89 // wheel not in contact, then we could be flipped, we assume there exist other predicates
90 return true;
91 }
92 }
93
94 // all wheels in contact (or zero registered wheels), then we are in contact
95 return false;
96 }
proto native int WheelCount()
How many wheel can be attached to a motorbike (hubs only)
proto native bool WheelHasContact(int wheelIdx)
static float Dot(vector v1, vector v2)
Returns Dot product of vector v1 and vector v2.
Определения EnConvert.c:305
static const vector Up
Определения EnConvert.c:120
Определения EnConvert.c:119

Перекрестные ссылки vector::Dot(), vector::Up, Transport::WheelCount() и Transport::WheelHasContact().

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