--
-- PowershaftT
-- This is the specialization for PowershaftT
--
-- M@D Author  Manuel Leithner & Headshot XXL
-- M@D date 09.08.2009
--
-- > Copyright (C) Headshot XXL - www.planet-ls.de < --

PowershaftT = {};

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

function PowershaftT:load(xmlFile)
	self.powerShaftAttacher = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.attacherJoint#shaft"));	
	self.powerShaftAttacher2 = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.attacherJoint#shaft2"));	
end;

function PowershaftT:delete()
	
end;

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

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

function PowershaftT:update(dt)
end;

function PowershaftT:draw()
end;


function PowershaftT:onAttach()
	self.attVehicle = self.attacherVehicle; 
	self.attacherVehicle.doJointSearch = true;
	self.attacherVehicle.doJointSearch2 = true;
end;



function PowershaftT:onDetach()
--print("detach")
	if self.attVehicle.powerShaft2 then
		setTranslation(self.attVehicle.powerShaft2.part, unpack(self.attVehicle.powerShaft2.trans));
		setRotation(self.attVehicle.powerShaft2.node, unpack(self.attVehicle.powerShaft2.rot));
		self.attVehicle.PowerShaftGo2 = nil;
	end; 
	
	if self.attVehicle.powerShaft then
		setTranslation(self.attVehicle.powerShaft.part, unpack(self.attVehicle.powerShaft.trans));
		setRotation(self.attVehicle.powerShaft.node, unpack(self.attVehicle.powerShaft.rot));
		self.attVehicle.PowerShaftGo = nil;
	end; 	
end;