public TransformExt(Spatial spatial) { position = Vector3.FromV3(spatial.GetTranslation()); rotation = Quaternion.FromEulerRHS(Vector3.FromV3((spatial.GetRotationDegrees()))); scale = Vector3.FromV3(spatial.GetScale()); posLHS = new Vector3(position.x, position.y, -position.z); updateTransformMatrix(); }
public static TransformExt FromTransform(Transform transform, Vector3 rotation) { TransformExt transformExt = new TransformExt(); transformExt.worldMatrix = Matrix4x4.TransformToMatrix4x4(transform); transformExt.position = Vector3.FromV3(transform.origin); transformExt.rotation = Quaternion.FromEuler(rotation); transformExt.scale = new Vector3(1, 1, 1); return(transformExt); }