Aetheria/Assets/Plugins/MIConvexHull/Vertex2.cs
Reinier Vens dbc522a224 Weapos Rejiggered
Modified weapon scripts to eliminate specialized projectile behavior - allows charged weapons to have projectiles and modify weapon stats when charged
Added machine gun weapon & VFX
Moved third party code to Plugins folder to improve compile times
2021-01-31 03:52:32 +00:00

38 lines
710 B
C#

using System;
using UnityEngine;
using System.Collections;
using MIConvexHull;
public class Vertex2 : IVertex
{
public double[] Position => new[] {(double) StoredPosition.x, StoredPosition.y};
public Vector2 StoredPosition;
public float x { get { return StoredPosition.x; } }
public float y { get { return StoredPosition.y; } }
public Vertex2(float x, float y)
{
StoredPosition = new Vector2(x, y);
}
public Vertex2(Vector2 pos)
{
StoredPosition = pos;
}
public Vector2 ToVector2() {
return StoredPosition;
}
public Vector3 ToVector3() {
return StoredPosition;
}
public double Distance(Vertex2 v)
{
return Math.Sqrt((v.x - x) * (v.x - x) + (v.y - y) * (v.y - y));
}
}