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

◆ DetectFlippedUsingWheels()

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

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

165 {
166 if (disallowSide && (vector.Dot(GetDirectionUp(), vector.Up) < 0.7))
167 {
168 // return as "flipped", vehicle isn't pointing enough up to be reasonably certain
169 return true;
170 }
171
172 int wheelCount = WheelCount();
173
174 for (int wheelIdx = 0; wheelIdx < wheelCount; wheelIdx++)
175 {
176 if (!WheelHasContact(wheelIdx))
177 {
178 // wheel not in contact, then we could be flipped, we assume there exist other predicates
179 return true;
180 }
181 }
182
183 // all wheels in contact (or zero registered wheels), then we are in contact
184 return false;
185 }
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().