Files
RobustToolbox/SS14.Client/Utility/GodotConversions.cs
Pieter-Jan Briers c058c2e3d4 Outlines & Custom non-entity drawing. (#592)
* Shader work WiP

* Probably implement basic shader param support.

* Really rough and hacky version

* Fix dumb exception.

* Custom fullscreen drawing API prototype.

* Significantly optimize debug colliders drawing.

* Fix drawdepths on clothing & overlays.

* Re-add license to outline shader.

* Update .editorconfig for .gdsl files.

* Fix unit tests.
2018-06-03 14:38:56 +02:00

58 lines
1.7 KiB
C#

using SS14.Shared.Maths;
namespace SS14.Client.Utility
{
public static class GodotConversions
{
public static Vector2 Convert(this Godot.Vector2 vector2)
{
return new Vector2(vector2.x, vector2.y);
}
public static Godot.Vector2 Convert(this Vector2 vector2)
{
return new Godot.Vector2(vector2.X, vector2.Y);
}
public static Vector3 Convert(this Godot.Vector3 vector3)
{
return new Vector3(vector3.x, vector3.y, vector3.z);
}
public static Godot.Vector3 Convert(this Vector3 vector3)
{
return new Godot.Vector3(vector3.X, vector3.Y, vector3.Z);
}
public static Color Convert(this Godot.Color color)
{
return new Color(color.r, color.g, color.b, color.a);
}
public static Godot.Color Convert(this Color color)
{
return new Godot.Color(color.R, color.G, color.B, color.A);
}
public static Godot.Rect2 Convert(this Box2 box)
{
return new Godot.Rect2(box.Left, box.Top, box.Width, box.Height);
}
public static Box2 Convert(this Godot.Rect2 rect)
{
return new Box2(rect.Position.x, rect.Position.y, rect.End.x, rect.End.y);
}
public static Godot.Transform2D Convert(this Matrix3 matrix)
{
return new Godot.Transform2D
{
o = new Godot.Vector2(matrix.R0C2, matrix.R1C2),
x = new Godot.Vector2(matrix.R0C0, matrix.R0C1),
y = new Godot.Vector2(matrix.R1C0, matrix.R1C1),
};
}
}
}