comparison tests/test_gltf.nim @ 1306:7be3628298f5

did: reworked locked mouse
author sam <sam@basx.dev>
date Wed, 07 Aug 2024 20:58:11 +0700
parents 21c4e598d820
children 385dbd68a947
comparison
equal deleted inserted replaced
1305:21c4e598d820 1306:7be3628298f5
156 var lastT = getMonoTime() 156 var lastT = getMonoTime()
157 while ((getMonoTime() - start).inMilliseconds().int / 1000) < time and updateInputs(): 157 while ((getMonoTime() - start).inMilliseconds().int / 1000) < time and updateInputs():
158 let dt = ((getMonoTime() - lastT).inNanoseconds().int / 1_000_000_000).float32 158 let dt = ((getMonoTime() - lastT).inNanoseconds().int / 1_000_000_000).float32
159 lastT = getMonoTime() 159 lastT = getMonoTime()
160 160
161 camYaw -= mouseMove().x / 1000 161 camYaw += mouseMove().x.float32 / 1000'f32
162 camPitch -= mouseMove().y / 1000 162 camPitch += mouseMove().y.float32 / 1000'f32
163 var 163 var
164 forward = 0'f32 164 forward = 0'f32
165 sideward = 0'f32 165 sideward = 0'f32
166 if keyIsDown(W): forward += 2 166 if keyIsDown(W): forward += 2
167 if keyIsDown(S): forward -= 2 167 if keyIsDown(S): forward -= 2