I add the components(LocalToWorld /CopyTransformFromGameobject) to an gameObject, than we can get the value(float4x4) ,but in the LocalToWorld component we just get Position and Right/Up/Forwrd, how to get Rotation and Scale from the value(float4x4) ? thank you !
To get world rotation from a LocalToWorld component, you can use the quaternion constructor and pass the float4x4 value:
var rotation = new quaternion(localToWorld.Value);
Thank you !
I am learning Tranforms ,In the Section 2: Hierarchical Transforms (Basic) ,I find two components LocalToParent and Parent,and i also find Child, so if i want make a chain ,I control the first warp motion, and the later nodes move again according to their parent trajectories:
1: I cant add LocalToParent to the gameObject,so i can
t get the translate and rotation(in parent space),Is there any other way to do it?
2: In the ECS, how to get the info of parent transforms and child transform from one entity(gameObject);