
--TODO: make a plan and redo
--[[do --look
	function mobs.default_prototype:look(dir)
		local pos = self.object:get_pos()
		local dest = vector_add(pos, vector_mul(dir, self.view_range))
		
		local ray = raycast(pos, dest, true, true)
		
		local b = true
		while b
		do
			b = false
			local pt = ray:next()
			if pt
			then
				if pt.type == node
				then
					local node = get_node(pt.under)
					if node and node.name ~= "ignore"
					then
						if not(reg_nodes[node.name] or {walkable = true}).walkable
						then
							b = true
						end
					end
					if not b
					then
						return false, pt.under
					end
				end
--				elseif pt.type == object and
--					vector_dist(pt.intersection_point, pos) > 2
--				then
--					return false
--				end
			end
		end
		return true
	end
end
]]
