Skip to content

Commit 7e0f6c7

Browse files
author
Aaron Ma
committed
close to lvbh
1 parent fc6eaa2 commit 7e0f6c7

23 files changed

Lines changed: 619 additions & 199 deletions

File tree

Pasted image (2).png

164 KB
Loading

Pasted image.png

195 KB
Loading
283 KB
Loading

examples/27_obj_viewer/main.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ function M.update()
103103
local idx = sw:acquire_next_image(image_available_sem)
104104
if idx == nil then return end
105105

106-
input.tick(); local speed = 10.0; local rot_speed = 0.03; local keys = sdl.SDL_GetKeyboardState(nil)
106+
local speed = 10.0; local rot_speed = 0.03; local keys = sdl.SDL_GetKeyboardState(nil)
107107
if keys[80] ~= 0 then M.cam_yaw = M.cam_yaw + rot_speed end
108108
if keys[79] ~= 0 then M.cam_yaw = M.cam_yaw - rot_speed end
109109
if keys[82] ~= 0 then M.cam_pitch = clamp(M.cam_pitch + rot_speed, -1.5, 1.5) end

examples/28_voxel_world/main.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ function M.update()
8383
local idx = sw:acquire_next_image(image_available)
8484
if idx == nil then return end
8585

86-
input.tick(); M.current_time = M.current_time + 0.016
86+
M.current_time = M.current_time + 0.016
8787
if input.key_down(input.SCANCODE_W) then
8888
M.cam_pos[1] = M.cam_pos[1] + math.sin(M.cam_yaw) * 0.5
8989
M.cam_pos[3] = M.cam_pos[3] + math.cos(M.cam_yaw) * 0.5

examples/29_magic_sandbox/main.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ function M.update()
145145
vk.vkResetFences(device, 1, ffi.new("VkFence[1]", {frame_fence}))
146146
local idx = sw:acquire_next_image(image_available)
147147
if idx == nil then return end
148-
input.tick(); M.current_time = M.current_time + 0.016; M.frame_count = M.frame_count + 1
148+
M.current_time = M.current_time + 0.016; M.frame_count = M.frame_count + 1
149149

150150
local speed = 4 * M.zoom -- Slow down camera movement for zoomed view
151151
if input.key_down(input.SCANCODE_W) then M.cam_y = M.cam_y - speed end

examples/30_sponza_gltf/main.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ end
138138
function M.update()
139139
vk.vkWaitForFences(device, 1, ffi.new("VkFence[1]", {frame_fence}), vk.VK_TRUE, 0xFFFFFFFFFFFFFFFFULL); vk.vkResetFences(device, 1, ffi.new("VkFence[1]", {frame_fence}))
140140
local idx = sw:acquire_next_image(image_available); if idx == nil then return end
141-
input.tick(); M.current_time = M.current_time + 0.016
141+
M.current_time = M.current_time + 0.016
142142
local speed, look_speed = (input.key_down(input.SCANCODE_LSHIFT) and 10.0 or 3.0) * 0.016, 1.5 * 0.016
143143
if input.key_down(input.SCANCODE_A) then M.cam_rot[1] = M.cam_rot[1] + look_speed end; if input.key_down(input.SCANCODE_D) then M.cam_rot[1] = M.cam_rot[1] - look_speed end
144144
local fwd_x, fwd_z = math.sin(M.cam_rot[1]), -math.cos(M.cam_rot[1])

examples/31_neuro_symbolic_mesh/main.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ end
165165
function M.update()
166166
vk.vkWaitForFences(device, 1, ffi.new("VkFence[1]", {frame_fence}), vk.VK_TRUE, 0xFFFFFFFFFFFFFFFFULL); vk.vkResetFences(device, 1, ffi.new("VkFence[1]", {frame_fence}))
167167
local idx = sw:acquire_next_image(image_available); if idx == nil then return end
168-
input.tick(); M.current_time = M.current_time + 0.016; M.frame_count = M.frame_count + 1
168+
M.current_time = M.current_time + 0.016; M.frame_count = M.frame_count + 1
169169
local speed, look_speed = (input.key_down(input.SCANCODE_LSHIFT) and 15.0 or 5.0) * 0.016, 1.5 * 0.016
170170
if input.key_down(input.SCANCODE_A) then M.cam_rot[1] = M.cam_rot[1] + look_speed end; if input.key_down(input.SCANCODE_D) then M.cam_rot[1] = M.cam_rot[1] - look_speed end
171171
local fwd_x, fwd_z = math.sin(M.cam_rot[1]), -math.cos(M.cam_rot[1])

examples/32_cellular_automata/main.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ function M.update()
167167
vk.vkResetFences(device, 1, ffi.new("VkFence[1]", {frame_fence}))
168168
local idx = sw:acquire_next_image(image_available)
169169
if idx == nil then return end
170-
input.tick(); M.current_time = M.current_time + 0.016; M.frame_count = M.frame_count + 1
170+
M.current_time = M.current_time + 0.016; M.frame_count = M.frame_count + 1
171171

172172
local speed = 4 * M.zoom -- Slow down camera movement for zoomed view
173173
if input.key_down(input.SCANCODE_W) then M.cam_y = M.cam_y - speed end

examples/43_forward_plus/main.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ function M.update()
176176
vk.vkWaitForFences(device, 1, ffi.new("VkFence[1]", {frame_fence}), vk.VK_TRUE, 0xFFFFFFFFFFFFFFFFULL)
177177
vk.vkResetFences(device, 1, ffi.new("VkFence[1]", {frame_fence}))
178178
local idx = sw:acquire_next_image(image_available); if idx == nil then return end
179-
input.tick(); M.current_time = M.current_time + 0.016
179+
M.current_time = M.current_time + 0.016
180180
M.frame_count = M.frame_count + 1
181181
if M.frame_count % 60 == 0 then
182182
local now = os.clock()

0 commit comments

Comments
 (0)