diff options
| author | Kelly Thomas | 2018-05-17 21:31:14 +0800 |
|---|---|---|
| committer | Hein-Pieter van Braam | 2018-06-01 17:46:38 +0200 |
| commit | 8461d6b5f94a55ee13276dd27b3885c6bc6fb851 (patch) | |
| tree | 2d3761284a39fd2fc396b40b5513b39f87ec90c3 | |
| parent | 0febfa9eea37909f5a16c246a6f0b4d508c14176 (diff) | |
| download | godot-8461d6b5f94a55ee13276dd27b3885c6bc6fb851.tar.gz godot-8461d6b5f94a55ee13276dd27b3885c6bc6fb851.tar.zst godot-8461d6b5f94a55ee13276dd27b3885c6bc6fb851.zip | |
| -rw-r--r-- | modules/mono/glue/cs_files/Basis.cs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/modules/mono/glue/cs_files/Basis.cs b/modules/mono/glue/cs_files/Basis.cs index 929b13d70..270f3b80a 100644 --- a/modules/mono/glue/cs_files/Basis.cs +++ b/modules/mono/glue/cs_files/Basis.cs @@ -446,6 +446,26 @@ namespace Godot _z = new Vector3(xz - wy, yz + wx, 1.0f - (xx + yy)); } + public Basis(Vector3 euler) + { + real_t c; + real_t s; + + c = Mathf.Cos(euler.x); + s = Mathf.Sin(euler.x); + var xmat = new Basis((real_t)1.0, (real_t)0.0, (real_t)0.0, (real_t)0.0, c, -s, (real_t)0.0, s, c); + + c = Mathf.Cos(euler.y); + s = Mathf.Sin(euler.y); + var ymat = new Basis(c, (real_t)0.0, s, (real_t)0.0, (real_t)1.0, (real_t)0.0, -s, (real_t)0.0, c); + + c = Mathf.Cos(euler.z); + s = Mathf.Sin(euler.z); + var zmat = new Basis(c, -s, (real_t)0.0, s, c, (real_t)0.0, (real_t)0.0, (real_t)0.0, (real_t)1.0); + + this = ymat * xmat * zmat; + } + public Basis(Vector3 axis, real_t phi) { var axis_sq = new Vector3(axis.x * axis.x, axis.y * axis.y, axis.z * axis.z); |
