-- by modelleicher
-- www.schwabenmodding.bplaced.net
-- BETA Script!

realisticIndoorCam = {};

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

function realisticIndoorCam:load(xmlFile)	
	self.ric = {};
	self.ric.directionPart = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.realisticIndoorCam#directionPart"));
	self.ric.rotationPart = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.realisticIndoorCam#rotationPart"));
end;
function realisticIndoorCam:delete()
end;
function realisticIndoorCam:mouseEvent(posX, posY, isDown, isUp, button)
end;
function realisticIndoorCam:keyEvent(unicode, sym, modifier, isDown)
end;

function realisticIndoorCam:update(dt)
	if self:getIsActive() then
		if self:getIsActiveForInput() then
			local ax, ay, az = getWorldTranslation(self.ric.directionPart);
			local bx = 0;
			local by = 1100000;
			local bz = 0;
			x, y, z = worldDirectionToLocal(getParent(self.ric.directionPart), bx-ax, by-ay, bz-az);
			setDirection(self.ric.directionPart, x, y, z, 0, 0, 1);		
		end;
	end;
end;

function realisticIndoorCam:draw()	
end;
