diff options
author | Kelly Thomas <kelly.thomas@hotmail.com.au> | 2018-05-20 18:29:54 +0800 |
---|---|---|
committer | Kelly Thomas <kelly.thomas@hotmail.com.au> | 2018-05-22 08:27:49 +0800 |
commit | b335274bcd6df9ad7e4ba381574fd1607f2b3437 (patch) | |
tree | 38cc772b9aeaf769fcca63efad004b8f73f47006 /modules/mono/glue/cs_files/Vector2.cs | |
parent | 5b11d16f219ff5741365cda8569297c0d39fee7a (diff) |
mono: add Slerp method to vector classes, expose Cross method for Vector2, and fix unnecessary casts in Basis
Diffstat (limited to 'modules/mono/glue/cs_files/Vector2.cs')
-rw-r--r-- | modules/mono/glue/cs_files/Vector2.cs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/modules/mono/glue/cs_files/Vector2.cs b/modules/mono/glue/cs_files/Vector2.cs index 9bc40cf8df..c274364895 100644 --- a/modules/mono/glue/cs_files/Vector2.cs +++ b/modules/mono/glue/cs_files/Vector2.cs @@ -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) { |