SAGE
A Simple Academic Game Engine
Loading...
Searching...
No Matches
SageController.cpp File Reference

Code for the controller class CController.

#include <climits>
#include "SageController.h"
Include dependency graph for SageController.cpp:

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.
Here is the caller graph for this function: