Open mlarcher opened 11 years ago
I like the idea to make it more flexible.
switch
could be more compact. Though array indexing and the char codes for 'xyz'Using different orders in steps may cause weird translations between them...
I'm sure there could be some optimizations :) I tried to stay as close as possible to the existing code, a more efficient rewrite would require more drastic changes. Are you ok with this ? Also, what do you mean by "It should use the transforms of the parent" ? Those arrays are taken from what was there, I just stuck them to variables in order to reuse them without having to repeat myself. I agree the switch could me more compact too, I'll see to it as soon as I find some time for it.
+1 IS this going to be merged?
It can come in handy to be able to force the rotation on the Y axis to occur before the one on the X axis, or to apply rotations before applying translations. This pull request handles those cases, and won't interfere with the default behaviour.
It adds the following options :
rotateOrder: 'xyz' Its value is a string that can be any combination of x,y and z. Translations will be applied in that order.
transformOrder: 'trs' Its value is a string that can be any combination of t, r and s. t stands for translate, r for rotate and s for scale. Transformations will be applied in that order.