Hey, can anyone explain to me why there's 50 or so Numbers declared in
the object as members when they're used as locals?  Everything except
the 16 numbers at the bottom (starting with sxx) seems like they
should be declared as locals in the few functions they're used instead
of eating instance memory.  x,y,z,w, xx... are only used in
quaternion2matrix, ncos, nsin et al are only used in rotationmatrix,
all the mXXX variables are used in a few functions but only for
intermediate storage.  And the vectors at the top (like _forward) are
only ever set if you call the forward() api, etc.  Why not set them
there?  That way you don't do extra allocs for vectors you never
use.   I moved all of them where they seem to belong and the object
size dropped from 592 bytes to 156.  Which considering that we've got
thousands of them in our app really adds up.  Just curious if there
was some reason I wasn't aware of.

Rick

Reply via email to