/****************************************************************************
* Copyright 2019 Nreal Techonology Limited. All rights reserved.
*
* This file is part of NRSDK.
*
* https://www.nreal.ai/
*
*****************************************************************************/
namespace NRKernal
{
using UnityEngine;
/// Align the world coordinate to the pose.
public class UpdateWorldOrigin
{
/// Align the world coordinate to positon and rotation.
/// .
/// .
/// .
public static void AlignWorldCoordinate(Transform cameraRoot, Vector3 position, Quaternion rotation)
{
var marker_in_world = ConversionUtility.GetTMatrix(position, rotation);
var world_in_marker = Matrix4x4.Inverse(marker_in_world);
cameraRoot.position = ConversionUtility.GetPositionFromTMatrix(world_in_marker);
cameraRoot.rotation = ConversionUtility.GetRotationFromTMatrix(world_in_marker);
}
}
}