Add Tizen.AIAvatar project (#6014)
[platform/core/csapi/tizenfx.git] / src / Tizen.AIAvatar / src / public / Avatar / Animations / AnimationModule / JointTransformer.cs
1 /*
2  * Copyright(c) 2023 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17
18 using System.ComponentModel;
19 using Tizen.NUI;
20 using Tizen.NUI.Scene3D;
21
22 namespace Tizen.AIAvatar
23 {
24     [EditorBrowsable(EditorBrowsableState.Never)]
25     internal class JointTransformer
26     {
27         [EditorBrowsable(EditorBrowsableState.Never)]
28         public JointTransformer() 
29         {
30         }
31
32         [EditorBrowsable(EditorBrowsableState.Never)]
33         public void Init(Animation animation)
34         {
35         }
36
37         [EditorBrowsable(EditorBrowsableState.Never)]
38         public void Play(IAnimationModuleData data)
39         {
40         }
41
42         [EditorBrowsable(EditorBrowsableState.Never)]
43         public void Pause()
44         {
45         }
46
47         [EditorBrowsable(EditorBrowsableState.Never)]
48         public void Stop()
49         {
50         }
51
52         [EditorBrowsable(EditorBrowsableState.Never)]
53         public void Destroy()
54         {
55         }
56
57         private void SetJointMotion(AvatarProperties properties, JointType jointType, MotionTransformIndex.TransformTypes type, Rotation rotation)
58         {
59             var motionTransform = new AvatarJointTransformIndex(properties.JointMapper, jointType, type);
60             var motionData = new MotionData();
61             motionData.Add(
62                 motionTransform,
63                 new MotionValue()
64                 {
65                     //TODO : Tizen_7.0에 pitch, yaw, roll patch 추가하기
66                     //PropertyValue = new PropertyValue(new Rotation(new Radian(pitch), new Radian(yaw), new Radian(roll))),
67                 }
68             );
69             //avatar.SetMotionData(motionData);
70         }
71
72         private void SetJointMotion(string keyValue, float pitch, float yaw, float roll)
73         {
74             var motionData = new MotionData();
75             motionData.Add(
76                 new MotionTransformIndex()
77                 {
78                     ModelNodeId = new PropertyKey(keyValue),
79                     TransformType = MotionTransformIndex.TransformTypes.Orientation,
80                 },
81                 new MotionValue()
82                 {
83                     //TODO : Tizen_7.0에 pitch, yaw, roll patch 추가하기
84                     //PropertyValue = new PropertyValue(new Rotation(new Radian(pitch), new Radian(yaw), new Radian(roll))),
85                 }
86             );
87             //avatar.SetMotionData(motionData);
88         }
89
90         private void SetJointMotion(string keyValue, MotionTransformIndex.TransformTypes type, Rotation rotation)
91         {
92             var motionData = new MotionData();
93             motionData.Add(
94                 new MotionTransformIndex()
95                 {
96                     ModelNodeId = new PropertyKey(keyValue),
97                     TransformType = type,
98                 },
99                 new MotionValue()
100                 {
101                     PropertyValue = new PropertyValue(rotation),
102                 }
103             );
104             //avatar.SetMotionData(motionData);
105         }
106     }
107 }