PhysicsUtility Class Reference

Utility class for Physics2D. More...

List of all members.

Static Public Member Functions

static uint UnpackIdx1 (uint val)
 Get one of the pair index, totalIndex -> index1.
static uint UnpackIdx2 (uint val)
 Get one of the pair index, totalIndex -> index2.
static uint PackIdx (uint val1, uint val2)
 Pack two indices to one index by shifting and summing.
static uint SwapIdx (uint val)
 Swap index1 and index2.
static float GetRadian (float angle)
 angle in degree -> radian conversion
static float GetRadianMod (float angle)
 angle-> rearranged to [-Pi, Pi] conversion

Public Attributes

const float Pi = 3.14159265f
 Internal Pi used for Physics2D simulation.
const float FltMax = 1E+37f
 Internal FltMax used for Physics2D simulation.

Detailed Description

Utility class for Physics2D.


Member Function Documentation

static float GetRadian ( float  angle) [static]

angle in degree -> radian conversion

Parameters:
anglegiven angle in degree
static float GetRadianMod ( float  angle) [static]

angle-> rearranged to [-Pi, Pi] conversion

Parameters:
anglegiven angle in radian
static uint PackIdx ( uint  val1,
uint  val2 
) [static]

Pack two indices to one index by shifting and summing.

Parameters:
val1given first index
val2given second index
Returns:
totalIndex
static uint SwapIdx ( uint  val) [static]

Swap index1 and index2.

Parameters:
valgiven totalIndex of PhysicsSolverPair etc
Returns:
totalIndex by swapping
static uint UnpackIdx1 ( uint  val) [static]

Get one of the pair index, totalIndex -> index1.

Parameters:
valgiven totalIndex of PhysicsSolverPair etc
Returns:
index1
static uint UnpackIdx2 ( uint  val) [static]

Get one of the pair index, totalIndex -> index2.

Parameters:
valgiven totalIndex of PhysicsSolverPair etc
Returns:
index2