-- Script By Mihai94
-- 
-- VasilisVasilis31 
--
-- Universal 650 M


SchimbatorViteze = {};

function SchimbatorViteze.prerequisitesPresent(specializations)
    return true;
end;

function SchimbatorViteze:load(xmlFile)

-- Schimbator Viteze
 self.SchimbatorViteze = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.SchimbatorViteze#index"));
end;

function SchimbatorViteze:delete()
end;

function SchimbatorViteze:mouseEvent(posX, posY, isDown, isUp, button)
end;

function SchimbatorViteze:keyEvent(unicode, sym, modifier, isDown)
end;

function SchimbatorViteze:update(dt)	

-- Schimbator Viteze
local speed = self.lastSpeed*3600;
     if self.SchimbatorViteze ~= nil then
--Inapoi--
          if self.movingDirection < 0 then
               setRotation(self.SchimbatorViteze, Utils.degToRad(9.5), Utils.degToRad(-1.5), Utils.degToRad(10));
--Liber--
          else     
          if speed >= -0.5 and speed < 0.5 then
               setRotation(self.SchimbatorViteze, Utils.degToRad(0), Utils.degToRad(0), Utils.degToRad(0));
--Inainte--

          elseif speed >= 0.5 and speed <8 then
               setRotation(self.SchimbatorViteze, Utils.degToRad(-5), Utils.degToRad(1.5), Utils.degToRad(-10));

          elseif speed >= 8 and speed < 12 then
               setRotation(self.SchimbatorViteze, Utils.degToRad(9.5), Utils.degToRad(1.5), Utils.degToRad(0-10));

          elseif speed >= 12 and speed < 24 then
               setRotation(self.SchimbatorViteze, Utils.degToRad(-12), Utils.degToRad(-1.5), Utils.degToRad(10));

          elseif speed >= 14 and speed < 30 then
               setRotation(self.SchimbatorViteze, Utils.degToRad(-5), Utils.degToRad(-1.5), Utils.degToRad(10));
			   
          elseif speed >= 17 then
               setRotation(self.SchimbatorViteze, Utils.degToRad(-12), Utils.degToRad(1.5), Utils.degToRad(-10));			   

          end;
     end;
  end;

end;

function SchimbatorViteze:draw()
end;