You've already forked godot
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:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user