1
0
mirror of https://github.com/Halofreak1990/XFXFramework synced 2024-12-26 13:49:34 +01:00
XFXFramework/include/MathHelper.h
Halofreak1990 e7a47c8ed9 Revamped the List class so that it can (properly) handle pointers as well
Added 'ValueTypes' Single and Double
Added some components in the new System::Net namespace
Added the Console class, which can be used to output text to the screen
Updated a bunch of structs to include the IComparable and IEquatable interfaces, and inheritance from Object to allow better interoperability between container classes and other types
Replaced all exception handling code with a report to stdout.txt - this will, I hope, eventually be reversed, but as of yet, there is no support for exceptions.

BEWARE! Even though all libraries correctly compile, you cannot use any class/structure that inherits from a template class, because stupid G++ wants to include exception handling for each template.
2011-11-07 01:29:50 +00:00

42 lines
1.4 KiB
C++

/********************************************************
* MathHelper.h *
* *
* XFX MathHelper definition file *
* Copyright © XFX Team. All Rights Reserved *
********************************************************/
#ifndef _SYSTEM_MATHHELPER_
#define _SYSTEM_MATHHELPER_
namespace XFX
{
// Contains commonly used precalculated values.
class MathHelper
{
private:
MathHelper(); // Private constructor to prevent instantiation.
public:
static const float E;
static const float Log10E;
static const float Log2E;
static const float Pi;
static const float PiOver2;
static const float PiOver4;
static const float TwoPi;
static float Baricentric(float value1, float value2, float value3, float amount1, float amount2);
static float CatmullRom(float value1, float value2, float value3, float value4, float amount);
static float Clamp(float value, float min, float max);
static float Distance(float value1, float value2);
static float Hermite(float value1, float tangent1, float value2, float tangent2, float amount);
static float Lerp(float value1, float value2, float amount);
static float Max(float value1, float value2);
static float Min(float value1, float value2);
static float SmoothStep(float value1, float value2, float amount);
static float ToDegrees(float radians);
static float ToRadians(float degrees);
};
}
#endif //_SYSTEM_MATHHELPER_