From 1b3fe7069cfdfde9e5f05427d94b3162e91b4916 Mon Sep 17 00:00:00 2001 From: jackfiled Date: Thu, 2 Mar 2023 19:06:32 +0800 Subject: [PATCH] =?UTF-8?q?feature:=20PoseTransform=E8=BF=90=E7=AE=97?= =?UTF-8?q?=E7=AC=A6=E9=87=8D=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Models/PoseTransform.cs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/Assets/Models/PoseTransform.cs b/Assets/Models/PoseTransform.cs index 877e33c..318ffd6 100644 --- a/Assets/Models/PoseTransform.cs +++ b/Assets/Models/PoseTransform.cs @@ -70,6 +70,25 @@ public static void CalculateRotation(ref PoseTransform poseTransform, PoseLandma } + public static Vector3 operator +(PoseTransform a) => a.ResultPosition; + + public static Vector3 operator -(PoseTransform a) => -a.ResultPosition; + + public static Vector3 operator +(PoseTransform a, PoseTransform b) => + a.ResultPosition + b.ResultPosition; + + public static Vector3 operator -(PoseTransform a, PoseTransform b) => + a.ResultPosition - b.ResultPosition; + + public static Vector3 operator *(PoseTransform a, int b) => + a.ResultPosition * b; + + public static Vector3 operator *(int a, PoseTransform b) => + a * b.ResultPosition; + + public static Vector3 operator /(PoseTransform a, int b) => + a.ResultPosition / b; + /// /// 获得同相关捕捉点关联的骨骼 ///