forked from Nivekk/KOS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVesselVelocity.cs
37 lines (31 loc) · 1.06 KB
/
VesselVelocity.cs
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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace kOS
{
public class VesselVelocity : SpecialValue
{
Vector orbitVelocity;
Vector surfaceVelocity;
float velocityHeading;
public VesselVelocity(Vessel v)
{
orbitVelocity = new Vector(v.obt_velocity);
surfaceVelocity = new Vector(v.srf_velocity);
velocityHeading = VesselUtils.GetVelocityHeading(v);
}
public override object GetSuffix(string suffixName)
{
if (suffixName == "ORBIT") return orbitVelocity;
if (suffixName == "SURFACE") return surfaceVelocity;
// I created this one for debugging purposes only, at some point I'll make a function to transform vectors to headings in a more eloquent way
if (suffixName == "SURFACEHEADING") return velocityHeading;
return base.GetSuffix(suffixName);
}
public override string ToString()
{
return orbitVelocity.ToString();
}
}
}