Mathematics classes.
More...
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
Typedef Documentation
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 |
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
-
Degree | Zaviye 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 |
float kge::math::Min |
( |
float |
A, |
|
|
float |
B |
|
) |
| |
|
inline |
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
-
Radian | Zaviye 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.
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 | ) |
|
Variable Documentation
const float kge::math::fDegToRad = 0.0174532925f |
const float kge::math::fEpsilon = 0.000001f |
const float kge::math::fRadToDeg = 57.295779513f |
const float kge::math::PI = 3.141592654f |
const float kge::math::PiOver2 = 1.570796326f |
const float kge::math::TwoPI = 6.283185307f |