Game Accessibility Library logo SourceForge.net Logo
Game Accessibility Suite: CAT/CATUtil.h File Reference

CATUtil.h File Reference


Detailed Description

Defines basic utility functions.

Copyright (c) 2003-2008 by Michael Ellison. See COPYING.txt for the Game Accessibility Suite [GAS] License (MIT License).

Definition in file CATUtil.h.

#include <limits.h>
#include <math.h>

Go to the source code of this file.

Enumerations

enum  CATVALUE_TYPE {
  CATVALUE_LINEAR,
  CATVALUE_DB
}

Functions

template<class T>
T const & CATMin (T const &a, T const &b)
 CATMin returns the minimum of two values. Types must be the same.
template<class T>
T const & CATMax (T const &a, T const &b)
 CATMax returns the maximum of two values. Types must be the same.
template<class T>
void CATSwap (T &a, T &b)
 CATSwap swaps to values of the same type.
template<class T>
CATAbs (T const &a)
 CATAbs finds the absolute value.
template<class T>
CATAbsDiff (T const &a, T const &b)
 CATAbsDiff returns the absolute difference between values.
CATInt32 CATRound (CATFloat32 floatVal)
CATInt32 CATRound (CATFloat64 dblVal)
CATFloat32 CATConstrainAngle (CATFloat32 angle)
CATFloat64 CATConstrainAngle (CATFloat64 angle)
CATFloat32 CATModFloat (CATFloat32 modFloat, CATUInt32 modBase)
CATFloat64 CATModFloat (CATFloat64 modFloat, CATUInt32 modBase)
CATUInt32 CATGreatestCommonDenominator (CATUInt32 a, CATUInt32 b)
CATInt32 CATGreatestCommonDenominator (CATInt32 a, CATInt32 b)
CATUInt32 CATLowestCommonMultiple (CATUInt32 a, CATUInt32 b)
CATInt32 CATLowestCommonMultiple (CATInt32 a, CATInt32 b)
CATInt32 CATSwapLittleEndian (CATInt32 a)
 Swap endian of value if and only if we're on a little-endian machine.
CATUInt32 CATSwapLittleEndian (CATUInt32 a)
CATUInt16 CATSwapLittleEndian (CATUInt16 a)

Variables

const CATFloat32 kCATPI = (CATFloat32)(3.1415926535897932384626433832795)
const CATFloat32 kCATPI_2 = kCATPI/2
const CATFloat32 kCAT2_PI = kCATPI*2
const CATFloat32 kCATDEGTORAD = (CATFloat32)(kCATPI / 180.0)
const CATFloat32 kCATRADTODEG = (CATFloat32)(180.0 / kCATPI)
const CATFloat32 kCATINV2PI = (CATFloat32)(1.0 / ( 8 * 0.78539816339744830961566084581988))


Generated on Mon Feb 11 04:10:04 2008 for Game Accessibility Suite by doxygen 1.5.4