local midentity = matrixh()
local valtitude = vector()
function model:update_fast()
local global_matrix = self.global_matrix
geometry.matrixh.copy(global_matrix, midentity)
global_matrix:rotate(self.orbital_orientation)
valtitude.y = self.altitude
global_matrix:translate(valtitude)
global_matrix:rotate(self.orientation)
global_matrix:translate(self.position)
end
And even if that optimized form is acceptable for entity update, for
skeletal animation of a couple hundred of entities with 64 bones each
it just takes too much time to run at interactive framerate, so
instead I rewrite these critical bottlenecks in C.
If you are willing to use this syntax, you could perhaps go the next
step and use light user data for matrices? You could then completely
avoid Lua's garbage collection (and production).