1
|
using UnityEngine;
|
2
|
|
3
|
namespace DeltaRobotVr
|
4
|
{
|
5
|
public class Single3Utils
|
6
|
{
|
7
|
public const float PositionScale = 0.001f;
|
8
|
|
9
|
public static Vector3 ToVector3(float x, float y, float z)
|
10
|
{
|
11
|
return new Vector3(x, y, -z) * PositionScale;
|
12
|
}
|
13
|
|
14
|
public static Vector3 ToVector3(Single3 point)
|
15
|
{
|
16
|
return ToVector3(point.X, point.Y, point.Z);
|
17
|
}
|
18
|
|
19
|
public static Vector3[] ToVector3(Single3[] curve)
|
20
|
{
|
21
|
var vectors = new Vector3[curve.Length];
|
22
|
for(int i = 0; i < curve.Length; i++)
|
23
|
{
|
24
|
var point = curve[i];
|
25
|
vectors[i] = ToVector3(point);
|
26
|
}
|
27
|
return vectors;
|
28
|
}
|
29
|
}
|
30
|
}
|