1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-09 12:50:35 +00:00

mono: add Slerp method to vector classes, expose Cross method for Vector2, and fix unnecessary casts in Basis

This commit is contained in:
Kelly Thomas
2018-05-20 18:29:54 +08:00
parent 5b11d16f21
commit b335274bcd
4 changed files with 17 additions and 5 deletions

View File

@@ -62,7 +62,7 @@ namespace Godot
}
}
private real_t Cross(Vector2 b)
public real_t Cross(Vector2 b)
{
return x * b.y - y * b.x;
}
@@ -210,6 +210,12 @@ namespace Godot
x = v.x;
y = v.y;
}
public Vector2 Slerp(Vector2 b, real_t t)
{
real_t theta = AngleTo(b);
return Rotated(theta * t);
}
public Vector2 Slide(Vector2 n)
{