function Clone(t)
if type(t) ~= "table" then return t end
local b = {}
table.foreach(t, function(k,v) b[k]= Clone(v) end)
return b
end
This is ever so slighly modified from something I grabbed out of the Lua mailing list. The basic problem was I wanted to have a copy of the varaible rather that editing its reference. I wanted the lua argument to be constant, remain unchanged, through out the function.
As always my bookmarks have grown. I watched the first video at MIT for the linear algebra course. Yes a free online maths course in Linear Algebra - perfect for writing 3D games. Cool no? Maybe because this guy is a better a lecturer or I was watching out of free will - but for the first time - matrix vector multiplication has stuck with me. Previously I just memorized the method for exams and promptly forgot it as soon as they were over. Anyway I intend to keep checking them out! They're very good I recommend them!
That's how it's going, my weekends going to be busy but maybe Sunday I'll be able to get some game time.
No comments:
Post a Comment