Search
  • Max De Sutter

Camera controls

The camera is controlled with the classic wasd keys as well as by moving the cursor near one of the borders. As for zooming the usual scroll wheel will do just fine. With the zooming i decided to move toward the terrain under the cursor instead of just moving the camera downwards toward the terrain. I believe this to give better control about where you want the camera to end up viewing. To prevent the camera from clipping with the terrain when moving forward or sideways a sphere collider was added. The collider will only collide with the terrain layer. To prevent clipping when zooming i first relied on the collider but found that this gave a stutter step effect when colliding the with terrain. So i added a sweeptest when zooming to see if there will be a collision. and only zooming if the way is clear. Next i added a way to change the yaw and pitch of the camera using the cursor and a modifier key. And finally i added a way to reset the rotation of the camera.


2 views0 comments

Recent Posts

See All