Functions | Variables

C:/Development/LoM/client/src/Utility/Common.cpp File Reference

#include "Common.h"

Functions

bool isPointInRect (int pointX, int pointY, int rectX, int rectY, int rectW, int rectH)
bool isRectInRect (int aX, int aY, int aX2, int aY2, int bX, int bY, int bX2, int bY2)
bool isRectInRect (Recti a, Recti b)
std::string toLowercase (const string &str)
std::string toUppercase (const string &str)
void system_launch (const string &cmd)
float degToRad (float degree)
float radToDeg (float rad)
float angleFromPoints (float x, float y, float x2, float y2)
Vec2f getDirectionVector (float angle)
int clamp (int x, int a, int b)
float clamp (float x, float a, float b)

Variables

const std::string VERSION_STRING = "v0.0.8xx"
 Program internal version string.
const float PI = 3.14159265f
const float PI_2 = PI * 2
const float DEG2RAD = PI / 180.0f
const float RAD2DEG = 180 / PI

Function Documentation

float angleFromPoints ( float  x,
float  y,
float  x2,
float  y2 
)

Gets the angle of a line in degrees given two points.

int clamp ( int  x,
int  a,
int  b 
)

Clamps an int value to a specified range.

Parameters:
x Value to clamp.
a Minimum value to clamp to.
b Maximum value to clamp to.
float clamp ( float  x,
float  a,
float  b 
)

Clamps an float value to a specified range.

Parameters:
x Value to clamp.
a Minimum value to clamp to.
b Maximum value to clamp to.
float degToRad ( float  degree  ) 

Gets an angle in radians from degrees.

Vec2f getDirectionVector ( float  angle  ) 

Gets a directional vector from an angle in degrees.

bool isPointInRect ( int  pointX,
int  pointY,
int  rectX,
int  rectY,
int  rectW,
int  rectH 
)
bool isRectInRect ( int  aX,
int  aY,
int  aX2,
int  aY2,
int  bX,
int  bY,
int  bX2,
int  bY2 
)
bool isRectInRect ( Recti  a,
Recti  b 
)
float radToDeg ( float  rad  ) 

Gets an angle in degrees from radians.

void system_launch ( const string &  cmd  ) 

Utility function that executes a system command (typically for launching another program).

Parameters:
cmd System command to execute.
std::string toLowercase ( const string &  str  ) 
std::string toUppercase ( const string &  str  ) 

Variable Documentation

const float DEG2RAD = PI / 180.0f
const float PI = 3.14159265f
const float PI_2 = PI * 2
const float RAD2DEG = 180 / PI
VERSION_STRING = "v0.0.8xx"

Program internal version string.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines