-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTransformHandler.cs
More file actions
40 lines (37 loc) · 1.28 KB
/
TransformHandler.cs
File metadata and controls
40 lines (37 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
using EngineLibrary.ECS;
using EngineLibrary.ECS.Components;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace EngineLibrary
{
public sealed class TransformHandler
{
public static void HandlePosition(uint[] ids, float[] xs, float[] ys, float[] zs)
{
int i = 0, count = ids.Length;
for (; i < count; i++)
{
Game.Entities[ids[i]]?.GetComponent<Transform>()?.SetPosition(new Math.Vector3D(xs[i], ys[i], zs[i]), false);
}
}
public static void HandleRotation(uint[] ids, float[] xs, float[] ys, float[] zs, float[] ws)
{
int i = 0, count = ids.Length;
for (; i < count; i++)
{
Game.Entities[ids[i]]?.GetComponent<Transform>()?.SetRotation(new Math.Quaternion(xs[i], ys[i], zs[i], ws[i]), false);
}
}
public static void HandleScale(uint[] ids, float[] xs, float[] ys, float[] zs)
{
int i = 0, count = ids.Length;
for (; i < count; i++)
{
Game.Entities[ids[i]]?.GetComponent<Transform>()?.SetScale(new Math.Vector3D(xs[i], ys[i], zs[i]), false);
}
}
}
}