move imgui property code and Pysics Actor code to a single file
This commit is contained in:
@ -29,6 +29,29 @@ namespace Prism
|
||||
Y = Mathf.Clamp(Y, min.Y, max.Y);
|
||||
}
|
||||
|
||||
public float LengthSquared()
|
||||
{
|
||||
return X * X + Y * Y;
|
||||
}
|
||||
|
||||
public float Length()
|
||||
{
|
||||
return (float)Math.Sqrt(X * X + Y * Y);
|
||||
}
|
||||
|
||||
public Vec2 Normalized()
|
||||
{
|
||||
float length = Length();
|
||||
return new Vec2(X / length, Y / length);
|
||||
}
|
||||
|
||||
public void Normalize()
|
||||
{
|
||||
float length = Length();
|
||||
X = X / length;
|
||||
Y = Y / length;
|
||||
}
|
||||
|
||||
public static Vec2 operator -(Vec2 l, Vec2 r)
|
||||
{
|
||||
return new Vec2(l.X - r.X, l.Y - r.Y);
|
||||
|
||||
@ -60,6 +60,11 @@ namespace Prism
|
||||
Z = Mathf.Clamp(Z, min.Z, max.Z);
|
||||
}
|
||||
|
||||
public float LengthSquared()
|
||||
{
|
||||
return X * X + Y * Y + Z * Z;
|
||||
}
|
||||
|
||||
public float Length()
|
||||
{
|
||||
return (float)Math.Sqrt(X * X + Y * Y + Z * Z);
|
||||
|
||||
Reference in New Issue
Block a user