Ejemplo n.º 1
0
        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)));
                }
            }
        }
Ejemplo n.º 2
0
 public static float Lerp(this float firstFloat, float secondFloat, float by)
 {
     return(FusionUtils.Lerp(firstFloat, secondFloat, by));
 }
Ejemplo n.º 3
0
 /// <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));
 }
Ejemplo n.º 4
0
 /// <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)));
 }