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

◆ DetectFlippedUsingWheels()

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

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

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