/// <summary></summary> /// <returns>tracking pose matrix</returns> public Matrix4x4 GetPose() { NativeAPI.Trackable_getPose(cPtr, glPoseMatrix); if (AbstractARManager.Instance.WorldCenterModeSetting == AbstractARManager.WorldCenterMode.TARGET) { return(Matrix4x4.identity); } else { Matrix4x4 tempPose = MatrixUtils.GetUnityPoseMatrix(glPoseMatrix); Quaternion rotation = Quaternion.Euler(90, 0, 0); Matrix4x4 m = Matrix4x4.TRS(AbstractARManager.Instance.GetARCamera().transform.position, rotation, new Vector3(1, 1, 1)); // First. Change world matrix tempPose = m * tempPose; rotation = Quaternion.Euler(-90, 0, 0); m = Matrix4x4.TRS(Vector3.zero, rotation, new Vector3(1, 1, 1)); // Second. Change local matrix tempPose = tempPose * m; return(tempPose); } }
// Get target pose for camera transform (When world center mode is TARGET) internal Matrix4x4 GetTargetPose() { NativeAPI.Trackable_getPose(cPtr, glPoseMatrix); return(MatrixUtils.GetUnityPoseMatrix(glPoseMatrix)); }