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/Vector3.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/Vector3.cs')
-rw-r--r-- | modules/mono/glue/cs_files/Vector3.cs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/modules/mono/glue/cs_files/Vector3.cs b/modules/mono/glue/cs_files/Vector3.cs index 57e4494f7e..085a4f0043 100644 --- a/modules/mono/glue/cs_files/Vector3.cs +++ b/modules/mono/glue/cs_files/Vector3.cs @@ -242,6 +242,12 @@ namespace Godot z = v.z; } + public Vector3 Slerp(Vector3 b, real_t t) + { + real_t theta = AngleTo(b); + return Rotated(Cross(b), theta * t); + } + public Vector3 Slide(Vector3 n) { return this - n * Dot(n); |