Skip to content

Commit

Permalink
Missed variables in window_to_world method (#46)
Browse files Browse the repository at this point in the history
* fix: Missed variables

* ref: Unused variable
  • Loading branch information
u546342 authored Aug 15, 2021
1 parent 3368a9c commit 1d8da83
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion orthographic/camera.lua
Original file line number Diff line number Diff line change
Expand Up @@ -727,6 +727,10 @@ function M.window_to_world(camera_id, window)
local view = camera.view or MATRIX4
local projection = camera.projection or MATRIX4
local viewport = camera.viewport or VECTOR4
local viewport_width = viewport.z * DISPLAY_WIDTH / WINDOW_WIDTH
local viewport_height = viewport.w * DISPLAY_HEIGHT / WINDOW_HEIGHT
local viewport_left = viewport.x * DISPLAY_WIDTH / WINDOW_WIDTH
local viewport_bottom = viewport.y * DISPLAY_HEIGHT / WINDOW_HEIGHT
local scale_x = window.x * dpi_ratio * DISPLAY_WIDTH / WINDOW_WIDTH
local scale_y = window.y * dpi_ratio * DISPLAY_HEIGHT / WINDOW_HEIGHT

Expand Down Expand Up @@ -823,7 +827,6 @@ function M.screen_to_world_bounds(camera_id)
local camera = cameras[camera_id]
local view = camera.view or MATRIX4
local projection = camera.projection or MATRIX4
local viewport = camera.viewport or VECTOR4
local inv = vmath.inv(projection * view)
local bl_x, bl_y = unproject_xyz(inv, 0, 0, 0)
local br_x, br_y = unproject_xyz(inv, DISPLAY_WIDTH, 0, 0)
Expand Down

0 comments on commit 1d8da83

Please sign in to comment.