Comment

Comment by xeonmc

This would be great for Rally racing games, since it's all about reacting to unknown terrain.

Also, it would be better if mouse steering is damping impulse based, i.e. every frame the steering position exponentially decays, mouse position resets to center and the change is added as impulse on the steering position.

  sensitivity = max_ang / ( screenwidth/2 )
  decay_rate = 6.0

  frame(dt){
    dx = mouse.x - center_pos
    mouse.reset()
    steer_ang += dx*sensitivity
    steer_ang.clamp(-max_ang,max_ang)
    steer_ang *= exp(-decay_rate * dt)
  }
parent xeonmc 4 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton