public CVehicleWheels(Vehicle vehicle) { vehicle1 = vehicle; decorator = vehicle.Decorator(); foreach (string wheel in FusionUtils.WheelsBonesNames) { if (vehicle.Bones[wheel].Index > 0) { Wheels.Add(new CVehicleWheel(vehicle, wheel, FusionUtils.ConvertWheelNameToID(wheel))); } } }
public static float Lerp(this float firstFloat, float secondFloat, float by) { return(FusionUtils.Lerp(firstFloat, secondFloat, by)); }
/// <summary> /// Returns the 2D squared distance between <paramref name="src"/> and <paramref name="entity"/>. /// </summary> /// <param name="src">Instance of an <see cref="Entity"/>.</param> /// <param name="entity">Instance of an <see cref="Entity"/>.</param> /// <returns>Distance in <c>float</c> between the entities</returns> public static float DistanceToSquared2D(this Entity src, Entity entity) { return(FusionUtils.DistanceToSquared2D(src, entity)); }
/// <summary> /// Checks if <paramref name="vehicle"/> is on rail tracks. /// </summary> /// <param name="vehicle">Instance of <see cref="Vehicle"/>.</param> /// <returns><see langword="true"/> if <paramref name="vehicle"/> is on rail tracks; otherwise <see langword="false"/>.</returns> public static bool IsOnTracks(this Vehicle vehicle) { return(vehicle.Wheels.Select(x => x.LastContactPosition).ToList().TrueForAll(x => FusionUtils.IsWheelOnTracks(x, vehicle))); }