If I have a number of nested transformNodes, each has a different scale, mostly smaller as you move deeper into the tree
Is there a built in method of of calculating the overall scale of any target in the structure?
Example say I want 1.1.2, since nested its overall scale is not 0.5 but really 1 multiplied by 0.5 multipled by 0.5 = 0.25
Node 1: Scale Factor (x,y,z) 1
Node 1.1: Scale Factor (x,y,z) 0.5
Node 1.1.1: Scale Factor (x,y,z) 0.2
Node 1.1.2: Scale Factor (x,y,z) 0.5
I could solve this easily with recursion and walking up the tree, but figured there may be a built in method that I was not seeing in the documentation, and I am trying to get better at using built in methods vs just whipping up my own.
let targetWorldMatrx = targetTransformNode.getWorldMatrix();
let scaleFactorVector3 = new Vector3;
targetWorldMatrx.decompose(scaleFactorVector3);
let scale = scaleFactorVector3.x