diff options
Diffstat (limited to 'source/blender/gpu/GPU_matrix.h')
-rw-r--r-- | source/blender/gpu/GPU_matrix.h | 31 |
1 files changed, 24 insertions, 7 deletions
diff --git a/source/blender/gpu/GPU_matrix.h b/source/blender/gpu/GPU_matrix.h index 6f7d25dafa7..61622c40ff0 100644 --- a/source/blender/gpu/GPU_matrix.h +++ b/source/blender/gpu/GPU_matrix.h @@ -96,21 +96,38 @@ void GPU_matrix_perspective_set(float fovy, float aspect, float near, float far) /* 3D Projection between Window and World Space */ +struct GPUMatrixUnproject_Precalc { + float model_inverted[4][4]; + float view[4]; + bool is_persp; + /** Result of 'projmat_dimensions'. */ + struct { + float xmin, xmax; + float ymin, ymax; + float zmin, zmax; + } dims; +}; + +bool GPU_matrix_unproject_precalc(struct GPUMatrixUnproject_Precalc *unproj_precalc, + const float model[4][4], + const float proj[4][4], + const int view[4]); + void GPU_matrix_project(const float world[3], const float model[4][4], const float proj[4][4], const int view[4], - float win[3]); + float r_win[3]); + bool GPU_matrix_unproject(const float win[3], const float model[4][4], const float proj[4][4], const int view[4], - float world[3]); -void GPU_matrix_unproject_model_inverted(const float win[3], - const float model_inverted[4][4], - const float proj[4][4], - const int view[4], - float world[3]); + float r_world[3]); + +void GPU_matrix_unproject_with_precalc(const struct GPUMatrixUnproject_Precalc *unproj_precalc, + const float win[3], + float r_world[3]); /* 2D Projection Matrix */ |