module("EseSkyDome", package.seeall)

function RegisterTickEvent(entityID)
    BehaviorAPI.SendEvent( entityID, "OnTick", nil, "", 0.05)
end

-- Behavior
function OnCreate(selfID, strm)
	BehaviorAPI.SetProperty(2, string.format("Planet::OnCreate(%x)", selfID))
	
	RegisterTickEvent(selfID)
end

-- Behavior
function OnTick(selfID, strm)
	RegisterTickEvent(selfID)
	
	local v3Rotation = BehaviorAPI.GetProperty(selfID, "Rotation")	
	local rotationSpeed = BehaviorAPI.GetProperty(selfID, "RotationSpeed")
	
	-- Apply a rotation.
	v3Rotation[3] = v3Rotation[3] + (rotationSpeed * 0.05)
	
	BehaviorAPI.SetProperty(selfID, "Rotation", v3Rotation)
end
