Chenille = {};

  
function Chenille.prerequisitesPresent(specializations)
      return SpecializationUtil.hasSpecialization(Motorized, specializations);
end;

function Chenille:load(xmlFile)

    self.roue = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.roue#index"));
    self.roue2 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.roue2#index"));

    self.tuile1 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuile1#index"));
    if self.tuile1 ~= nil then
        setVisibility(self.tuile1, true);
    end;
    self.tuile2 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuile2#index"));
    if self.tuile3 ~= nil then
        setVisibility(self.tuile3, true);
    end;
	self.tuile3 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuile3#index"));
	if self.tuile3 ~= nil then
        setVisibility(self.tuile3, true);
    end;
    self.tuile4 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuile4#index"));
    if self.tuile4 ~= nil then
        setVisibility(self.tuile4, true);
    end;
    self.tuile5 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuile5#index"));
    if self.tuile5 ~= nil then
        setVisibility(self.tuile5, true);
    end;
	self.tuile6 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuile6#index"));
    self.tuile7 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuile7#index"));
    self.tuile8 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuile8#index"));
    self.tuile9 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuile9#index"));
    self.tuile10 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuile10#index"));
    

	self.tuile12 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuile12#index"));
    if self.tuile12 ~= nil then
        setVisibility(self.tuile12, true);
    end;
    
	self.tuile13 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuile13#index"));
    if self.tuile13 ~= nil then
        setVisibility(self.tuile13, false);
    end;
	self.tuile14 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuile14#index"));
    self.tuile15 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuile15#index"));
    self.tuile16 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuile16#index"));
    self.tuile17 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuile17#index"));
    self.tuile18 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuile18#index"));
    self.tuile19 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuile19#index"));
	self.tuile21 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuile21#index"));
    self.tuile22 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuile22#index"));
    self.tuile23 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuile23#index"));
    self.tuile24 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuile24#index"));
    self.tuile25 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuile25#index"));
    self.tuile26 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuile26#index"));
    self.tuile28 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuile28#index"));
    self.tuile29 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuile29#index"));
    self.tuile30 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuile30#index"));
    self.tuile31 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuile31#index"));
    self.tuile32 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuile32#index"));
    self.tuile33 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuile33#index"));
    self.tuile34 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuile34#index"));
    self.tuile35 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuile35#index"));
    self.tuile36 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuile36#index"));
    self.tuile37 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuile37#index"));
    self.tuile38 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuile38#index"));
    self.tuile39 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuile39#index"));
    self.tuile40 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuile40#index"));
    self.tuile41 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuile41#index"));
    self.tuile42 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuile42#index"));
	self.tuile43 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuile43#index"));
    self.tuile44 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuile44#index"));
    self.tuile45 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuile45#index"));
    self.tuile46 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuile46#index"));
	self.tuile47 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuile47#index"));
	self.tuile48 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuile48#index"));
	self.tuile49 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuile49#index"));
	self.tuile50 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuile50#index"));
	self.tuile51 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuile51#index"));
	self.tuile52 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuile52#index"));
	self.tuile53 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuile53#index"));
	self.tuile54 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuile54#index"));
	self.tuile55 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuile55#index"));
	self.tuile56 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuile56#index"));
	self.tuile57 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuile57#index"));
	self.tuile58 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuile58#index"));
	self.tuile59 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuile59#index"));
	self.tuile60 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuile60#index"));
	self.tuile61 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuile61#index"));
	self.tuile62 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuile62#index"));  
	
	
	
	    self.tuil1 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuil1#index"));
    if self.tuil1 ~= nil then
        setVisibility(self.tuil1, true);
    end;
    self.tuil2 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuil2#index"));
    if self.tuil3 ~= nil then
        setVisibility(self.tuil3, true);
    end;
	self.tuil3 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuil3#index"));
	if self.tuil3 ~= nil then
        setVisibility(self.tuil3, true);
    end;
    self.tuil4 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuil4#index"));
    if self.tuil4 ~= nil then
        setVisibility(self.tuil4, true);
    end;
    self.tuil5 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuil5#index"));
    if self.tuil5 ~= nil then
        setVisibility(self.tuil5, true);
    end;
	self.tuil6 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuil6#index"));
    self.tuil7 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuil7#index"));
    self.tuil8 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuil8#index"));
    self.tuil9 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuil9#index"));
    self.tuil10 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuil10#index"));
    
	self.tuil12 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuil12#index"));
    if self.tuil12 ~= nil then
        setVisibility(self.tuil12, true);
    end;
    
	self.tuil13 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuil13#index"));
    if self.tuil13 ~= nil then
        setVisibility(self.tuil13, false);
    end;
	self.tuil14 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuil14#index"));
    self.tuil15 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuil15#index"));
    self.tuil16 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuil16#index"));
    self.tuil17 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuil17#index"));
    self.tuil18 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuil18#index"));
    self.tuil19 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuil19#index"));
	self.tuil21 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuil21#index"));
    self.tuil22 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuil22#index"));
    self.tuil23 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuil23#index"));
    self.tuil24 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuil24#index"));
    self.tuil25 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuil25#index"));
    self.tuil26 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuil26#index"));
    self.tuil28 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuil28#index"));
    self.tuil29 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuil29#index"));
    self.tuil30 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuil30#index"));
    self.tuil31 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuil31#index"));
    self.tuil32 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuil32#index"));
    self.tuil33 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuil33#index"));
    self.tuil34 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuil34#index"));
    self.tuil35 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuil35#index"));
    self.tuil36 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuil36#index"));
    self.tuil37 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuil37#index"));
    self.tuil38 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuil38#index"));
    self.tuil39 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuil39#index"));
    self.tuil40 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuil40#index"));
    self.tuil41 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuil41#index"));
    self.tuil42 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuil42#index"));
	self.tuil43 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuil43#index"));
    self.tuil44 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuil44#index"));
    self.tuil45 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuil45#index"));
    self.tuil46 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuil46#index"));
	self.tuil47 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuil47#index"));
	self.tuil48 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuil48#index"));
	self.tuil49 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuil49#index"));
	self.tuil50 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuil50#index"));
	self.tuil51 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuil51#index"));
	self.tuil52 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuil52#index"));
	self.tuil53 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuil53#index"));
	self.tuil54 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuil54#index"));
	self.tuil55 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuil55#index"));
	self.tuil56 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuil56#index"));
	self.tuil57 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuil57#index"));
	self.tuil58 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuil58#index"));
	self.tuil59 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuil59#index"));
	self.tuil60 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuil60#index"));
	self.tuil61 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuil61#index"));
	self.tuil62 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.tuil62#index"));                                                                                                   
end;
  
function Chenille:delete()
end;
 

   
function Chenille:mouseEvent(posX, posY, isDown, isUp, button)
end;
 
function Chenille:keyEvent(unicode, sym, modifier, isDown)
end;
 
function Chenille:update(dt)



local Lwx, Lwy, Lwz = getTranslation(self.roue);
local xt,yt,zt = getRotation(self.roue);
if xt > 0.439885 then
      setRotation(self.roue, 0, 0, 0);
end;
if xt < 0 then
      setRotation(self.roue, 0.439885, 0, 0);
end;
setTranslation(self.tuile1, 0, 0, -xt*0.6);
setTranslation(self.tuile2, 0, 0, -xt*0.6);
setTranslation(self.tuile3, 0, 0, -xt*0.6);
setTranslation(self.tuile13, 0, 0, -xt*0.6);
setTranslation(self.tuile14, 0, 0, -xt*0.6);
setTranslation(self.tuile15, 0, 0, -xt*0.6);
setTranslation(self.tuile16, 0, 0, -xt*0.6);
setTranslation(self.tuile17, 0, 0, -xt*0.6);
setTranslation(self.tuile18, 0, 0, -xt*0.6);
setTranslation(self.tuile19, 0, 0, -xt*0.6);
setTranslation(self.tuile21, 0, 0, -xt*0.6);
setTranslation(self.tuile22, 0, 0, -xt*0.6);
setTranslation(self.tuile23, 0, 0, -xt*0.6);
setTranslation(self.tuile24, 0, 0, -xt*0.6);
setTranslation(self.tuile25, 0, 0, -xt*0.6);
setTranslation(self.tuile26, 0, 0, -xt*0.6);
setTranslation(self.tuile28, 0, 0, -xt*0.6);
setTranslation(self.tuile29, 0, 0, -xt*0.6);
setTranslation(self.tuile30, 0, 0, -xt*0.6);
setTranslation(self.tuile31, 0, 0, -xt*0.6);
setTranslation(self.tuile33, 0, 0, -xt*0.6);

setTranslation(self.tuile43, 0, 0, -xt*0.6);
setTranslation(self.tuile44, 0, 0, -xt*0.6);
setTranslation(self.tuile45, 0, 0, -xt*0.6);
setTranslation(self.tuile46, 0, 0, -xt*0.6);
setTranslation(self.tuile47, 0, 0, -xt*0.6);
setTranslation(self.tuile48, 0, 0, -xt*0.6);
setTranslation(self.tuile49, 0, 0, -xt*0.6);
setTranslation(self.tuile50, 0, 0, -xt*0.6);
setTranslation(self.tuile51, 0, 0, -xt*0.6);
setTranslation(self.tuile52, 0, 0, -xt*0.6);
setTranslation(self.tuile53, 0, 0, -xt*0.6);
setTranslation(self.tuile54, 0, 0, -xt*0.6);
setTranslation(self.tuile55, 0, 0, -xt*0.6);
setTranslation(self.tuile56, 0, 0, -xt*0.6);
setTranslation(self.tuile57, 0, 0, -xt*0.6);
setTranslation(self.tuile58, 0, 0, -xt*0.6);
setTranslation(self.tuile59, 0, 0, -xt*0.6);
setTranslation(self.tuile60, 0, 0, -xt*0.6);
setTranslation(self.tuile61, 0, 0, -xt*0.6);
setTranslation(self.tuile62, 0, 0, -xt*0.6);

local a, b, c = getTranslation(self.tuile13);
if c <  -0.0758022 then
    setVisibility(self.tuile13, true);
end;
if c >=  -0.0758022 then
    setVisibility(self.tuile13, false);
end;
setRotation(self.tuile4, xt, 0, 0);
setRotation(self.tuile5, xt, 0, 0);
setRotation(self.tuile6, xt, 0, 0);
setRotation(self.tuile7, xt, 0, 0);
setRotation(self.tuile8, xt, 0, 0);
setRotation(self.tuile9, xt, 0, 0);
setRotation(self.tuile10, xt, 0, 0);


setRotation(self.tuile34, xt, 0, 0);
setRotation(self.tuile35, xt, 0, 0);
setRotation(self.tuile36, xt, 0, 0);
setRotation(self.tuile37, xt, 0, 0);
setRotation(self.tuile38, xt, 0, 0);
setRotation(self.tuile40, xt, 0, 0);
setRotation(self.tuile41, xt, 0, 0);

setRotation(self.tuile12, xt, 0, 0);
local d, e, f = getRotation(self.tuile12);
if d <  0.126337 then
    setVisibility(self.tuile12, true);
end;
if d >=  0.126337 then
    setVisibility(self.tuile12, false);
end;


setTranslation(self.tuile32, 0, 0, -xt*0.6);
local g, h, i = getTranslation(self.tuile32);
if i <  -0.173891 then
    setVisibility(self.tuile32, false);
end;
if i >=  -0.173891 then
    setVisibility(self.tuile32, true);
end;

setTranslation(self.tuile42, 0, 0, -xt*0.6);
local m, n, o = getTranslation(self.tuile42);

if o <  -0.174013 then
    setVisibility(self.tuile42, true);
end;
if o >=  -0.174013 then
    setVisibility(self.tuile42, false);
end;

setRotation(self.tuile39, xt, 0, 0);
local p, q, r = getRotation(self.tuile39);

if p <   0.290021 then
    setVisibility(self.tuile39, true);
end;
if p >=  0.290021 then
    setVisibility(self.tuile39, false);
end;




local wx, wy, wz = getTranslation(self.roue2);
local lxt,lyt,lzt = getRotation(self.roue2);
if lxt > 0.439885 then
      setRotation(self.roue2, 0, 0, 0);
end;
if lxt < 0 then
      setRotation(self.roue2, 0.439885, 0, 0);
end;
setTranslation(self.tuil1, 0, 0, -lxt*0.6);
setTranslation(self.tuil2, 0, 0, -lxt*0.6);
setTranslation(self.tuil3, 0, 0, -lxt*0.6);
setTranslation(self.tuil13, 0, 0, -lxt*0.6);
setTranslation(self.tuil14, 0, 0, -lxt*0.6);
setTranslation(self.tuil15, 0, 0, -lxt*0.6);
setTranslation(self.tuil16, 0, 0, -lxt*0.6);
setTranslation(self.tuil17, 0, 0, -lxt*0.6);
setTranslation(self.tuil18, 0, 0, -lxt*0.6);
setTranslation(self.tuil19, 0, 0, -lxt*0.6);
setTranslation(self.tuil21, 0, 0, -lxt*0.6);
setTranslation(self.tuil22, 0, 0, -lxt*0.6);
setTranslation(self.tuil23, 0, 0, -lxt*0.6);
setTranslation(self.tuil24, 0, 0, -lxt*0.6);
setTranslation(self.tuil25, 0, 0, -lxt*0.6);
setTranslation(self.tuil26, 0, 0, -lxt*0.6);
setTranslation(self.tuil28, 0, 0, -lxt*0.6);
setTranslation(self.tuil29, 0, 0, -lxt*0.6);
setTranslation(self.tuil30, 0, 0, -lxt*0.6);
setTranslation(self.tuil31, 0, 0, -lxt*0.6);
setTranslation(self.tuil33, 0, 0, -lxt*0.6);

setTranslation(self.tuil43, 0, 0, -lxt*0.6);
setTranslation(self.tuil44, 0, 0, -lxt*0.6);
setTranslation(self.tuil45, 0, 0, -lxt*0.6);
setTranslation(self.tuil46, 0, 0, -lxt*0.6);
setTranslation(self.tuil47, 0, 0, -lxt*0.6);
setTranslation(self.tuil48, 0, 0, -lxt*0.6);
setTranslation(self.tuil49, 0, 0, -lxt*0.6);
setTranslation(self.tuil50, 0, 0, -lxt*0.6);
setTranslation(self.tuil51, 0, 0, -lxt*0.6);
setTranslation(self.tuil52, 0, 0, -lxt*0.6);
setTranslation(self.tuil53, 0, 0, -lxt*0.6);
setTranslation(self.tuil54, 0, 0, -lxt*0.6);
setTranslation(self.tuil55, 0, 0, -lxt*0.6);
setTranslation(self.tuil56, 0, 0, -lxt*0.6);
setTranslation(self.tuil57, 0, 0, -lxt*0.6);
setTranslation(self.tuil58, 0, 0, -lxt*0.6);
setTranslation(self.tuil59, 0, 0, -lxt*0.6);
setTranslation(self.tuil60, 0, 0, -lxt*0.6);
setTranslation(self.tuil61, 0, 0, -lxt*0.6);
setTranslation(self.tuil62, 0, 0, -lxt*0.6);

local a, b, c = getTranslation(self.tuil13);
if c <  -0.0758022 then
    setVisibility(self.tuil13, true);
end;
if c >=  -0.0758022 then
    setVisibility(self.tuil13, false);
end;
setRotation(self.tuil4, lxt, 0, 0);
setRotation(self.tuil5, lxt, 0, 0);
setRotation(self.tuil6, lxt, 0, 0);
setRotation(self.tuil7, lxt, 0, 0);
setRotation(self.tuil8, lxt, 0, 0);
setRotation(self.tuil9, lxt, 0, 0);
setRotation(self.tuil10, lxt, 0, 0);
setRotation(self.tuil34, lxt, 0, 0);
setRotation(self.tuil35, lxt, 0, 0);
setRotation(self.tuil36, lxt, 0, 0);
setRotation(self.tuil37, lxt, 0, 0);
setRotation(self.tuil38, lxt, 0, 0);
setRotation(self.tuil40, lxt, 0, 0);
setRotation(self.tuil41, lxt, 0, 0);

setRotation(self.tuil12, lxt, 0, 0);
local d, e, f = getRotation(self.tuil12);
if d <  0.126337 then
    setVisibility(self.tuil12, true);
end;
if d >=  0.126337 then
    setVisibility(self.tuil12, false);
end;

setTranslation(self.tuil32, 0, 0, -lxt*0.6);
local g, h, i = getTranslation(self.tuil32);
if i <  -0.173891 then
    setVisibility(self.tuil32, false);
end;
if i >=  -0.173891 then
    setVisibility(self.tuil32, true);
end;

setTranslation(self.tuil42, 0, 0, -lxt*0.6);
local m, n, o = getTranslation(self.tuil42);

if o <  -0.174013 then
    setVisibility(self.tuil42, true);
end;
if o >=  -0.174013 then
    setVisibility(self.tuil42, false);
end;

setRotation(self.tuil39, lxt, 0, 0);
local p, q, r = getRotation(self.tuil39);

if p <   0.290021 then
    setVisibility(self.tuil39, true);
end;
if p >=  0.290021 then
    setVisibility(self.tuil39, false);
end;



end;
 
 
 
 
function Chenille:updateTick(dt)
end;
 
function Chenille:draw()
end;
 

function Chenille:onActivate()
end;


function Chenille:onDeactivate()
end;
 
 
