diff options
| author | jpbruyere <jp.bruyere@hotmail.com> | 2017-01-24 12:46:43 +0100 |
|---|---|---|
| committer | jpbruyere <jp.bruyere@hotmail.com> | 2017-01-24 12:46:43 +0100 |
| commit | d8acaa909ce73e150827db9846cd8690fb93d68e (patch) | |
| tree | c22aab77a5851aad79505a49dc6ac91ca4b0a106 /Tests/OpenGL/Extensions.cs | |
| parent | e39ac936765e88382d858ee6922293315a18b60d (diff) | |
| parent | 1a4fe8bd37ed4a3e3324a134df4f90c14b315918 (diff) | |
Merge branch 'master' into CrowIDE
Diffstat (limited to 'Tests/OpenGL/Extensions.cs')
| -rw-r--r-- | Tests/OpenGL/Extensions.cs | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/Tests/OpenGL/Extensions.cs b/Tests/OpenGL/Extensions.cs index 17fe6086..0dd1cca6 100644 --- a/Tests/OpenGL/Extensions.cs +++ b/Tests/OpenGL/Extensions.cs @@ -35,30 +35,7 @@ namespace Crow public static bool IsInBetween(this int v, int min, int max){ return v >= min & v <= max; } - public static Vector4 UnProject(ref Matrix4 projection, ref Matrix4 view, int[] viewport, Vector2 mouse) - { - Vector4 vec; - vec.X = 2.0f * mouse.X / (float)viewport[2] - 1; - vec.Y = -(2.0f * mouse.Y / (float)viewport[3] - 1); - vec.Z = 0f; - vec.W = 1.0f; - - Matrix4 viewInv = Matrix4.Invert(view); - Matrix4 projInv = Matrix4.Invert(projection); - - Vector4.Transform(ref vec, ref projInv, out vec); - Vector4.Transform(ref vec, ref viewInv, out vec); - - if (vec.W > float.Epsilon || vec.W < float.Epsilon) - { - vec.X /= vec.W; - vec.Y /= vec.W; - vec.Z /= vec.W; - } - - return vec; - } } } |