Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/intern/draw_manager_data.c
| Show First 20 Lines • Show All 1,545 Lines • ▼ Show 20 Lines | static void draw_view_matrix_state_update(DRWViewUboStorage *storage, | ||||
| const float viewmat[4][4], | const float viewmat[4][4], | ||||
| const float winmat[4][4]) | const float winmat[4][4]) | ||||
| { | { | ||||
| /* If only one the matrices is negative, then the | /* If only one the matrices is negative, then the | ||||
| * polygon winding changes and we don't want that. | * polygon winding changes and we don't want that. | ||||
| * By convention, the winmat is negative because | * By convention, the winmat is negative because | ||||
| * looking through the -Z axis. So this inverse the | * looking through the -Z axis. So this inverse the | ||||
| * changes the test for the winmat. */ | * changes the test for the winmat. */ | ||||
| BLI_assert(is_negative_m4(viewmat) == !is_negative_m4(winmat)); | /* TODO: this needs to be correct for v2d as well | ||||
| * BLI_assert(is_negative_m4(viewmat) == * !is_negative_m4(winmat)); */ | |||||
| copy_m4_m4(storage->viewmat, viewmat); | copy_m4_m4(storage->viewmat, viewmat); | ||||
| invert_m4_m4(storage->viewinv, storage->viewmat); | invert_m4_m4(storage->viewinv, storage->viewmat); | ||||
| copy_m4_m4(storage->winmat, winmat); | copy_m4_m4(storage->winmat, winmat); | ||||
| invert_m4_m4(storage->wininv, storage->winmat); | invert_m4_m4(storage->wininv, storage->winmat); | ||||
| mul_m4_m4m4(storage->persmat, winmat, viewmat); | mul_m4_m4m4(storage->persmat, winmat, viewmat); | ||||
| ▲ Show 20 Lines • Show All 370 Lines • Show Last 20 Lines | |||||