This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| local cam = require'cam' -- https://github.com/jmiskovic/lovr-cam | |
| local player_pos = Vec3() | |
| local player_vel = Vec3(0, 0, -0.01) | |
| local function getWorldFromScreen(pass) | |
| local w, h = pass:getDimensions() | |
| local clip_from_screen = mat4(-1, -1, 0):scale(2 / w, 2 / h, 1) | |
| local view_pose = mat4(pass:getViewPose(1)) |