KardanWelle = {};

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

function KardanWelle:load(xmlFile)
	
	self.kWells = {};	
	
	local i = -1;
	while true do
		i = i + 1;
		local index = getXMLString(xmlFile, string.format('vehicle.kardanWelle.welle(%d)#index', i));
		if index == nil then break; end;
		local kw = {};
		kw.idz = Utils.indexToObject(self.components, index);
		kw.spd = getXMLFloat(xmlFile, string.format('vehicle.kardanWelle.welle(%d)#speed', i));
		table.insert(self.kWells, kw);
	end;
	
end;

function KardanWelle:delete()
end;

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

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

function KardanWelle:update(dt)
	
end;

function KardanWelle:updateTick(dt)

	local x,y,z = getRotation(self.wheels[4].driveNode);
	for i,welle in pairs(self.kWells) do
		setRotation(welle.idz, 0 ,0 ,x*welle.spd);			
	end;

end;

function KardanWelle:draw()
end;
