We got decent text rendering in world now!
This commit is contained in:
@ -136,15 +136,25 @@ update :: proc( delta_time : f64 ) -> b32
|
||||
|
||||
// Camera Manual Nav
|
||||
{
|
||||
digital_move_speed : f32 = 200.0
|
||||
zoom_sensitiviity : f32 = 0.05
|
||||
cam := & project.workspace.cam
|
||||
|
||||
cam := & project.workspace.cam
|
||||
zoom_delta := input.mouse.vertical_wheel * zoom_sensitiviity
|
||||
// zoom_delta *= f32(delta_time)
|
||||
cam.zoom *= 1 + zoom_delta
|
||||
cam.zoom = clamp( cam.zoom, 0.5, 10.0 )
|
||||
// cam.zoom = 2.0
|
||||
digital_move_speed : f32 = 200.0
|
||||
zoom_sensitivity : f32 = 0.1 // Digital
|
||||
// zoom_sensitivity : f32 = 2.0 // Smooth
|
||||
|
||||
if debug.zoom_target == 0.0 {
|
||||
debug.zoom_target = cam.zoom
|
||||
}
|
||||
|
||||
// Adjust zoom_target based on input, not the actual zoom
|
||||
zoom_delta := input.mouse.vertical_wheel * zoom_sensitivity
|
||||
debug.zoom_target *= 1 + zoom_delta //* f32(delta_time)
|
||||
debug.zoom_target = clamp(debug.zoom_target, 0.5, 10.0)
|
||||
|
||||
// Linearly interpolate cam.zoom towards zoom_target
|
||||
lerp_factor := cast(f32) 4.0 // Adjust this value to control the interpolation speed
|
||||
cam.zoom += (debug.zoom_target - cam.zoom) * lerp_factor * f32(delta_time)
|
||||
cam.zoom = clamp(cam.zoom, 0.5, 10.0) // Ensure cam.zoom stays within bounds
|
||||
|
||||
move_velocity : Vec2 = {
|
||||
- cast(f32) i32(debug_actions.cam_move_left) + cast(f32) i32(debug_actions.cam_move_right),
|
||||
|
Reference in New Issue
Block a user