99.imdk_unity 上传

This commit is contained in:
2025-06-19 10:56:43 +08:00
parent d48c1f1f7b
commit 820c663ab8
651 changed files with 123674 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
/*===============================================================================
Copyright (C) 2024 Immersal - Part of Hexagon. All Rights Reserved.
This file is part of the Immersal SDK.
The Immersal SDK cannot be copied, distributed, or made available to
third-parties for commercial purposes without written permission of Immersal Ltd.
Contact sdk@immersal.com for licensing requests.
===============================================================================*/
using System.Threading.Tasks;
using UnityEngine;
namespace Immersal.XR
{
public interface ISceneUpdateable
{
Task SceneUpdate(SceneUpdateData data);
Transform GetTransform();
Task ResetScene();
}
public static class SceneUpdateableExtensions
{
public static Matrix4x4 ToMapSpace(this ISceneUpdateable sceneUpdateable, Vector3 pos, Quaternion rot)
{
Transform spaceTransform = sceneUpdateable.GetTransform();
Matrix4x4 pose = Matrix4x4.TRS(pos, rot, Vector3.one);
Matrix4x4 spacePose = Matrix4x4.TRS(spaceTransform.position, spaceTransform.rotation, Vector3.one);
return spacePose.inverse * pose;
}
}
}