VXNTedits / Flowstate

We're bulding a game from scratch.
3 stars 0 forks source link

ADS mechanic #6

Open VXNTedits opened 3 months ago

VXNTedits commented 3 months ago

Implement ADS mechanic such that the end of the arm is centered on the screen.

VXNTedits commented 3 months ago

The arm must be rotated non-linearly depending upon the camera's pitch and yaw. It is insufficient to set the arm model to map the pitch and yaw directly due to the shoulder-to-camera offset. A translation system must be calculated and implemented, which shifts the end of the arm (the hand) to the center of the screen (the camera view direction). Thereafter a right_hand_model_matrix corrector must be implemented, which rotates the right hand model matrix to lerp to point along the camera's pitch and yaw.