syBR::Core::MathHelpers Class Reference

Mathematical helpers operations class. More...

#include <MathHelpers.hpp>

List of all members.

Static Public Member Functions

static float calculateAbsoluteValue (const float value)
 Calculate the absolute value of a number.
static Vector3D calculateFaceNormal (const Vector3D &vec1, const Vector3D &vec2, const Vector3D &vec3)
 Calculate the normal of a face.
static Vector3D calculateFaceNormal (const Vector3D vec[3])
 Calculate the normal of a face.
static float calculateDistance (const Vector3D &vec1, const Vector3D &vec2)
 Calculate the distance between 2 vectors.
static bool calculatePlanesIntersection (const Plane &pln1, const Plane &pln2, const Plane &pln3, Vector3D &result)
 Calculate the intersection of three planes.

Private Member Functions

 MathHelpers ()
 Private constructor which is only used to prevent the instanciation of the MathHelper class.


Detailed Description

Mathematical helpers operations class.

It contains only static methods and doesn't require to be instanciated (it CANNOT be instanciated).


Constructor & Destructor Documentation

syBR::Core::MathHelpers::MathHelpers (  )  [private]

Private constructor which is only used to prevent the instanciation of the MathHelper class.


Member Function Documentation

float syBR::Core::MathHelpers::calculateAbsoluteValue ( const float  value  )  [static]

Calculate the absolute value of a number.

Parameters:
value Number for which the absolute value must be calculated
Returns:
Number containing the absolute value of the specified number
Note:
This has been optimized in order to use a substraction instead of a multiplication.

Vector3D syBR::Core::MathHelpers::calculateFaceNormal ( const Vector3D vec1,
const Vector3D vec2,
const Vector3D vec3 
) [static]

Calculate the normal of a face.

Parameters:
vec1 Vector #1 of the face
vec2 Vector #2 of the face
vec3 Vector #3 of the face
Returns:
Normalized vector containing the normal of the face
Note:
The 3 vectors must define the face in clockwise order.

Vector3D syBR::Core::MathHelpers::calculateFaceNormal ( const Vector3D  vec[3]  )  [static]

Calculate the normal of a face.

Parameters:
vec Array containing the 3 vectors
Returns:
Normalized vector containing the normal of the face
Note:
The 3 vectors must define the face in clockwise order.

float syBR::Core::MathHelpers::calculateDistance ( const Vector3D vec1,
const Vector3D vec2 
) [static]

Calculate the distance between 2 vectors.

Parameters:
vec1 Vector #1
vec2 Vector #2
Returns:
Distance between these vectors

bool syBR::Core::MathHelpers::calculatePlanesIntersection ( const Plane pln1,
const Plane pln2,
const Plane pln3,
Vector3D result 
) [static]

Calculate the intersection of three planes.

Parameters:
pln1 Plane #1
pln2 Plane #1
pln3 Plane #1
result Vector which will contain the intersection of the three planes if they are not parallel
Returns:
One of these:
  • true if there is an intersection between the three vectors
  • false otherwise


The documentation for this class was generated from the following files:

Copyright © 2008 by Sebastien Frippiat
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License.
Last modified Tue Dec 30 17:57:33 2008