Kochol Game Engine  0.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
kge::math Namespace Reference

Mathematics classes. More...

Classes

class  AABB
class  Frustum
class  Matrix
class  Plane
class  Quat
struct  Ray
class  Shape
class  Sphere
struct  Triangle
class  Vector
class  Vector2
 2D Vector More...

Typedefs

typedef Vector2< float > Vector2F
typedef Vector2< int > Vector2I

Enumerations

enum  FrustumSide {
  EFS_Right = 0, EFS_Left = 1, EFS_Bottom = 2, EFS_Top = 3,
  EFS_Far = 4, EFS_Near = 5
}
enum  CollisionType {
  ECT_Out, ECT_In, ECT_Front, ECT_Behind,
  ECT_Intersect, ECT_NotIntersect
}
 The collision type of objects. More...
enum  KGE_SHAPES { KGE_SHAPE_AABB = 0, KGE_SHAPE_SPHERE, KGE_SHAPE_CAPSULE }

Functions

float DegToRad (float Degree)
 Darage ra be radian tabdil mikone.
float RadToDeg (float Radian)
 Radian ra be darage tabdil mikone.
float abs (float Number)
int pow (int x, int y)
 power x ^ y
float Max (float A, float B)
float Min (float A, float B)
bool SweptSpherePlaneIntersect (float &t0, float &t1, const Plane &plane, const Sphere &sphere, const Vector &sweepDir)
 this function tests if the projection of a bounding sphere along the light direction intersects the view frustum
void Transpose (Matrix &mat)
 Transposes this matrix.
float KGE_API RandomFloat (float lowerBound, float upperBound)
 This function returns a random floating-point number between lower and upper bounds.
Vector KGE_API RandomVector ()
 This function returns a random normalized vector.
bool KGE_API AlmostEqual (float x, float y)
 This function returns true if two numbers are almost equal.
void KGE_API BezierCurve (Vector &result, const Vector *points, int num, float t)
void KGE_API CatmullRom (Vector &result, const Vector &p1, const Vector &p2, const Vector &p3, const Vector &p4, float t)

Variables

const float PI = 3.141592654f
 P number.
const float TwoPI = 6.283185307f
const float PiOver2 = 1.570796326f
const float fDegToRad = 0.0174532925f
const float fRadToDeg = 57.295779513f
const float fEpsilon = 0.000001f

Detailed Description

Mathematics classes.

Typedef Documentation

typedef Vector2<float> kge::math::Vector2F

Definition at line 260 of file Vector.h.

Definition at line 261 of file Vector.h.

Enumeration Type Documentation

The collision type of objects.

Enumerator:
ECT_Out 

The Object is outside of somthing like a frustum.

ECT_In 

The Object is inside of somthing like a frustum.

ECT_Front 

The Object is front of somthing like a plane.

ECT_Behind 

The Object is behind of somthing like a plane.

ECT_Intersect 

The Object is intersecting with another object.

ECT_NotIntersect 

The Object is not intersecting with another object.

Definition at line 19 of file math.h.

Enumerator:
EFS_Right 

The RIGHT side of the frustum.

EFS_Left 

The LEFT side of the frustum.

EFS_Bottom 

The BOTTOM side of the frustum.

EFS_Top 

The TOP side of the frustum.

EFS_Far 

The far side of the frustum.

EFS_Near 

The near side of the frustum.

Definition at line 16 of file Frustum.h.

Enumerator:
KGE_SHAPE_AABB 
KGE_SHAPE_SPHERE 
KGE_SHAPE_CAPSULE 

Definition at line 13 of file Shape.h.

Function Documentation

float kge::math::abs ( float  Number)
inline

Definition at line 63 of file math.h.

bool KGE_API kge::math::AlmostEqual ( float  x,
float  y 
)

This function returns true if two numbers are almost equal.

void KGE_API kge::math::BezierCurve ( Vector &  result,
const Vector *  points,
int  num,
float  t 
)
void KGE_API kge::math::CatmullRom ( Vector &  result,
const Vector &  p1,
const Vector &  p2,
const Vector &  p3,
const Vector &  p4,
float  t 
)
float kge::math::DegToRad ( float  Degree)
inline

Darage ra be radian tabdil mikone.

Parameters
DegreeZaviye bar hasbe daraje.
Returns
Zaviye bar hasbe radian.

Definition at line 45 of file math.h.

References fDegToRad.

float kge::math::Max ( float  A,
float  B 
)
inline

Definition at line 85 of file math.h.

float kge::math::Min ( float  A,
float  B 
)
inline

Definition at line 92 of file math.h.

int kge::math::pow ( int  x,
int  y 
)
inline

power x ^ y

Definition at line 72 of file math.h.

float kge::math::RadToDeg ( float  Radian)
inline

Radian ra be darage tabdil mikone.

Parameters
RadianZaviye bar hasbe radian.
Returns
Zaviye bar hasbe darage.

Definition at line 57 of file math.h.

References PI.

float KGE_API kge::math::RandomFloat ( float  lowerBound,
float  upperBound 
)

This function returns a random floating-point number between lower and upper bounds.

Vector KGE_API kge::math::RandomVector ( )

This function returns a random normalized vector.

bool kge::math::SweptSpherePlaneIntersect ( float &  t0,
float &  t1,
const Plane &  plane,
const Sphere &  sphere,
const Vector &  sweepDir 
)

this function tests if the projection of a bounding sphere along the light direction intersects the view frustum

void kge::math::Transpose ( Matrix &  mat)

Transposes this matrix.

Variable Documentation

const float kge::math::fDegToRad = 0.0174532925f

Definition at line 35 of file math.h.

Referenced by DegToRad().

const float kge::math::fRadToDeg = 57.295779513f

Definition at line 36 of file math.h.

const float kge::math::PI = 3.141592654f

P number.

Definition at line 31 of file math.h.

Referenced by RadToDeg().

const float kge::math::PiOver2 = 1.570796326f

Definition at line 33 of file math.h.

Referenced by kge::sn::TPCamera::GetPhi().

const float kge::math::TwoPI = 6.283185307f

Definition at line 32 of file math.h.