The LARC Game Engine
A Simple Game Engine from the Laboratory for Recreational Computing
Functions
Controller.cpp File Reference

Code for the XBox 360 controller class LXBoxController. More...

#include "Controller.h"

Functions

Vector2 normalize (Vector2 v)
 

Function Documentation

◆ normalize()

Vector2 normalize ( Vector2  v)

Helper function that normalizes a vector representing a thumb stick's position to [-1.0, 1.0]^2, clipping at the maximum value and adjusting for a dead zone at the middle position.

Parameters
vVector to be normalized.
Returns
Normalized vector.