Пример #1
0
 public void UpdateEngineProperties(IReadOnlyHMIPacket HMIPacket, IReadOnlyAEBAction AEBActionPacket)
 {
     this.Gaspedal             = HMIPacket.Gaspedal;
     this.Breakpedal           = HMIPacket.Breakpedal;
     this.GearShifter.Position = HMIPacket.Gear;
     this.GearShifter.SetDriveGear(this.RPM, this.CalculateRPMChange());
     this.SetRPM();
     this.SetVelocityInPixels();
 }
Пример #2
0
        public void UpdateSteeringProperties(IReadOnlyHMIPacket packet)
        {
            CheckCarPosition();

            this.SetVelocityPixelPerTick();
            if (this.velocityPixelPerTick != 0.0)
            {
                this.carCurrentAngle = World.Instance.ControlledCar.Angle;
                this.steeringAngle   = packet.Steering * SteeringWheelConversionConstant * Math.Sqrt(World.Instance.ControlledCar.Speed / 1000.0);
                this.isInReverseGear = packet.Gear == Gears.R;
                this.SetCarDirectionUnitVector();
                this.SetNewDirectionUnitVector();
                this.SetNewCarPosition();
                this.SetNewCarAngle();
            }
        }