diff options
| author | Kelly Thomas | 2018-05-20 18:29:54 +0800 |
|---|---|---|
| committer | Hein-Pieter van Braam | 2018-06-01 18:05:28 +0200 |
| commit | d00926894ee09664dfd638cc43079f03add2051d (patch) | |
| tree | 01f872ef4b482873fbe4e4cb6a3d2d58026e54d6 /modules/mono/glue/cs_files/Vector3.cs | |
| parent | 5d2ad1e5c76604e1fe1afb7960a575d3203dd0d3 (diff) | |
| download | godot-d00926894ee09664dfd638cc43079f03add2051d.tar.gz godot-d00926894ee09664dfd638cc43079f03add2051d.tar.zst godot-d00926894ee09664dfd638cc43079f03add2051d.zip | |
mono: add Slerp method to vector classes, expose Cross method for Vector2, and fix unnecessary casts in Basis
(cherry picked from commit b335274bcd6df9ad7e4ba381574fd1607f2b3437)
Diffstat (limited to '')
| -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 0a71f3fa4..259a8e063 100644 --- a/modules/mono/glue/cs_files/Vector3.cs +++ b/modules/mono/glue/cs_files/Vector3.cs @@ -237,6 +237,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); |
