Exemple #1
0
        /// Turn
        private HashSet <IPhysicEvent> calculateTurnEvents(PCar iterCar, Vector needDirAngle)
        {
            HashSet <IPhysicEvent> pEvents = new HashSet <IPhysicEvent> {
                passageLineEvent.Copy(),
                                   outLineEvent.Copy(),
                                   angleReachEvent.Copy()
            };

            PCar physicCar = new PCar(iterCar);

            PhysicEventsCalculator.calculateEvents(physicCar, new MoveToAngleFunction(needDirAngle.Angle), pEvents, calculateTurnEventCheckEnd);

            if (!pEvents.Containts(PhysicEventType.SpeedReach))
            {
                pEvents.Add(new SpeedReachEvent());
            }

            return(pEvents);
        }