-- 
-- kardan 
-- author: werik 
-- 

kardan = {}; 

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

function kardan:load(xmlFile) 
--[[val]]------ 
self.crankshaftNode = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.crankshaft#index")); 
self.crankshaft1Node = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.crankshaft1#index")); 
end; 

function kardan:readStream(streamId, connection) 
end; 

function kardan:writeStream(streamId, connection) 
end; 

function kardan:delete() 
end; 

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

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

function kardan:update(dt) 
--[[val]]-------- 
if self.crankshaftNode ~= nil and (self.movingDirection > 0 or self.movingDirection < 0) then 
rotate(self.crankshaftNode, 0, 0, self.motor.lastMotorRpm*0.001); 
end; 
if self.crankshaft1Node ~= nil and (self.movingDirection > 0 or self.movingDirection < 0) then 
rotate(self.crankshaft1Node, 0, 0, self.motor.lastMotorRpm*0.001); 
end; 
end; 

function kardan:onLeave() 
end; 

function kardan:draw() 
end; 
