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

◆ DetectFlippedUsingWheels()

bool Transport::DetectFlippedUsingWheels ( VehicleFlippedContext ctx,
bool disallowSide )
inlineprotected

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

150 {
151 if (disallowSide && (vector.Dot(GetDirectionUp(), vector.Up) < 0.7))
152 {
153 // return as "flipped", vehicle isn't pointing enough up to be reasonably certain
154 return true;
155 }
156
157 int wheelCount = WheelCount();
158
159 for (int wheelIdx = 0; wheelIdx < wheelCount; wheelIdx++)
160 {
161 if (!WheelHasContact(wheelIdx))
162 {
163 // wheel not in contact, then we could be flipped, we assume there exist other predicates
164 return true;
165 }
166 }
167
168 // all wheels in contact (or zero registered wheels), then we are in contact
169 return false;
170 }
proto native bool WheelHasContact(int wheelIdx)
proto native int WheelCount()
How many wheel can be attached to a car (hubs only)

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