-- 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(35), Utils.degToRad(0), Utils.degToRad(-27));
--Liber--
          else     
          if speed >= -0.5 and speed < 0.5 then
               setRotation(self.SchimbatorViteze, Utils.degToRad(0), Utils.degToRad(0), Utils.degToRad(-20));
--Inainte--

          elseif speed >= 0.5 and speed <4 then
               setRotation(self.SchimbatorViteze, Utils.degToRad(0), Utils.degToRad(0), Utils.degToRad(0));	

          elseif speed >= 4 and speed < 8 then
               setRotation(self.SchimbatorViteze, Utils.degToRad(35), Utils.degToRad(0), Utils.degToRad(0));

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

          elseif speed >= 12 and speed < 14 then
               setRotation(self.SchimbatorViteze, Utils.degToRad(70), Utils.degToRad(0), Utils.degToRad(-45));			   

          end;
     end;
  end;

end;

function SchimbatorViteze:draw()
end;