1 |
using System; |
2 |
|
3 |
namespace Oni.Dae |
4 |
{ |
5 |
internal class TransformScale : Transform |
6 |
{ |
7 |
private static readonly string[] valueNames = new[] { "X", "Y", "Z" }; |
8 |
|
9 |
public TransformScale() |
10 |
: base(3) |
11 |
{ |
12 |
} |
13 |
|
14 |
public TransformScale(string sid, Vector3 scale) |
15 |
: base(sid, 3) |
16 |
{ |
17 |
Scale = scale; |
18 |
} |
19 |
|
20 |
public Vector3 Scale |
21 |
{ |
22 |
get { return new Vector3(Values); } |
23 |
set { value.CopyTo(Values); } |
24 |
} |
25 |
|
26 |
public override Matrix ToMatrix() => Matrix.CreateScale(Scale); |
27 |
|
28 |
public override int ValueNameToValueIndex(string name) => Array.FindIndex(valueNames, x => string.Equals(x, name, StringComparison.OrdinalIgnoreCase)); |
29 |
public override string ValueIndexToValueName(int index) => valueNames[index]; |
30 |
} |
31 |
} |