diff options
| author | raysan5 <[email protected]> | 2020-09-01 21:08:45 +0200 |
|---|---|---|
| committer | raysan5 <[email protected]> | 2020-09-01 21:08:45 +0200 |
| commit | 05cdaf7d0153c8847a651334265eafd67fff21b2 (patch) | |
| tree | f941d212c770de8e8fb724c0b9b861587ffbb92d /src/rlgl.h | |
| parent | a1422ba1c16c74a39793f95f73f1228eeca71f38 (diff) | |
| download | raylib-05cdaf7d0153c8847a651334265eafd67fff21b2.tar.gz raylib-05cdaf7d0153c8847a651334265eafd67fff21b2.zip | |
MOVED: rlUnproject() [rlgl] -> Vector3Unproject() [raymath]
Diffstat (limited to 'src/rlgl.h')
| -rw-r--r-- | src/rlgl.h | 24 |
1 files changed, 0 insertions, 24 deletions
@@ -526,7 +526,6 @@ RLAPI bool rlCheckBufferLimit(int vCount); // Check internal buffer o RLAPI void rlSetDebugMarker(const char *text); // Set debug marker for analysis RLAPI void rlSetBlendMode(int glSrcFactor, int glDstFactor, int glEquation); // // Set blending mode factor and equation (using OpenGL factors) RLAPI void rlLoadExtensions(void *loader); // Load OpenGL extensions -RLAPI Vector3 rlUnproject(Vector3 source, Matrix proj, Matrix view); // Get world coordinates from screen coordinates // Textures data management RLAPI unsigned int rlLoadTexture(void *data, int width, int height, int format, int mipmapCount); // Load texture in GPU @@ -1907,29 +1906,6 @@ void rlLoadExtensions(void *loader) #endif } -// Get world coordinates from screen coordinates -Vector3 rlUnproject(Vector3 source, Matrix proj, Matrix view) -{ - Vector3 result = { 0.0f, 0.0f, 0.0f }; - - // Calculate unproject matrix (multiply view patrix by projection matrix) and invert it - Matrix matViewProj = MatrixMultiply(view, proj); - matViewProj = MatrixInvert(matViewProj); - - // Create quaternion from source point - Quaternion quat = { source.x, source.y, source.z, 1.0f }; - - // Multiply quat point by unproject matrix - quat = QuaternionTransform(quat, matViewProj); - - // Normalized world points in vectors - result.x = quat.x/quat.w; - result.y = quat.y/quat.w; - result.z = quat.z/quat.w; - - return result; -} - // Convert image data to OpenGL texture (returns OpenGL valid Id) unsigned int rlLoadTexture(void *data, int width, int height, int format, int mipmapCount) { |
