lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

This is essentially what we do in our game (using lua 4). Code that
uses vectors looks like:

local cooky = BeginMath() -- saves state of the vector/quat "stacks"
-- code that uses vectors and quats

If you neglect the Begin/End pair, you get just-in-time allocated
objects, instead of preallocated ones. We don't have the need (yet?)
to retain vectors, so we don't have any analogue of retain().