Version control and raycast

 Author: Daniel Jackson


    Our game requires the player character look towards the mouse in order to shoot in the game world correctly. This is done by using a raycast from the mouse position down into the world and rotating the player to face that position in the world. This appeared to work fine on startup but if the window was resized at any time in any way the raycast was skewed and would constantly be separated from the mouse position. 

    This has been a recurring issue unrelated to the actual raycast code. The code itself is set to base the raycast's position relative to the size of the window. The raycast itself works fine however, when it grabs the size of the window, its only saving one size. To fix the issue I changed a separate function to get the current size of the window when the function is called instead of getting the size of the window on startup. I've done this fix before however at some point during integration the fix had been lost in the mix again.





Comments

Popular posts from this blog

Adding assets to every enemy -- Owen Meyers

Sphere to AABB collision