Main Page | Class Hierarchy | Class List | Class Members

DVR::Math::MathUtil Class Reference

List of all members.

Static Public Member Functions

float DegreesToRadians (float degrees)
float RadiansToDegrees (float radians)
float Sin (float angle)
Matrix4 BuildReflectionMatrix (Plane plane)
Vector4 CalculateFaceNormal (Vector3 v1, Vector3 v2, Vector3 v3)
Vector3 CalculateTangentSpaceVector (Vector3 position1, Vector3 position2, Vector3 position3, float u1, float v1, float u2, float v2, float u3, float v3)
float Cos (float angle)
float ACos (float angle)
float ASin (float angle)
float InvSqrt (float number)
float Sqrt (float number)
float Abs (float number)
bool FloatEqual (float a, float b)
bool FloatEqual (float a, float b, float tolerance)
float Tan (float angle)
float Max (float value1, float value2)
float Min (float value1, float value2)
float RangeRandom (float min, float max)
float UnitRandom ()
float SymmetricRandom ()
Pair Intersects (Ray ray, AxisAlignedBox box)
Intersection Intersects (AxisAlignedBox boxA, AxisAlignedBox boxB)

Public Attributes

const float PI = (float)System.Math.PI
const float TWO_PI = (float)System.Math.PI * 2.0f
const float RADIANS_PER_DEGREE = PI / 180.0f
const float DEGREES_PER_RADIAN = 180.0f / PI

Detailed Description

This is a class which exposes static methods for various common math functions. Currently, the methods simply wrap the methods of the System.Math class (with the exception of a few added extras). This is in case the implementation needs to be swapped out with a faster C++ implementation, if deemed that the System.Math methods are not up to far speed wise. TODO: Add overloads for all methods for all instrinsic data types (i.e. float, short, etc).


Member Function Documentation

float DVR::Math::MathUtil::Abs float  number  )  [inline, static]
 

Returns the absolute value of the supplied number.

float DVR::Math::MathUtil::ACos float  angle  )  [inline, static]
 

Returns the arc cosine of the angle.

float DVR::Math::MathUtil::ASin float  angle  )  [inline, static]
 

Returns the arc sine of the angle.

Matrix4 DVR::Math::MathUtil::BuildReflectionMatrix Plane  plane  )  [inline, static]
 

Builds a reflection matrix for the specified plane.

Vector4 DVR::Math::MathUtil::CalculateFaceNormal Vector3  v1,
Vector3  v2,
Vector3  v3
[inline, static]
 

Calculate a face normal, including the w component which is the offset from the origin.

Vector3 DVR::Math::MathUtil::CalculateTangentSpaceVector Vector3  position1,
Vector3  position2,
Vector3  position3,
float  u1,
float  v1,
float  u2,
float  v2,
float  u3,
float  v3
[inline, static]
 

Calculates the tangent space vector for a given set of positions / texture coords. Adapted from bump mapping tutorials at: http://www.paulsprojects.net/tutorials/simplebump/simplebump.html author : paul.baker@univ.ox.ac.uk

float DVR::Math::MathUtil::Cos float  angle  )  [inline, static]
 

Returns the cosine of the angle.

float DVR::Math::MathUtil::DegreesToRadians float  degrees  )  [inline, static]
 

Converts degrees to radians.

bool DVR::Math::MathUtil::FloatEqual float  a,
float  b,
float  tolerance
[inline, static]
 

Compares float values for equality, taking into consideration that floating point values should never be directly compared using ==. 2 floats could be conceptually equal, but vary by a .000001 which would fail in a direct comparison. To circumvent that, a tolerance value is used to see if the difference between the 2 floats is less than the desired amount of accuracy.

Intersection DVR::Math::MathUtil::Intersects AxisAlignedBox  boxA,
AxisAlignedBox  boxB
[inline, static]
 

Tests an intersection between two boxes. The primary box. The box to test intersection with boxA. None - There was no intersection between the 2 boxes. Contains - boxA is fully within boxB. Partial - boxA is partially intersecting with boxB. Submitted by: romout

Pair DVR::Math::MathUtil::Intersects Ray  ray,
AxisAlignedBox  box
[inline, static]
 

Tests an intersection between a ray and a box. A Pair object containing whether the intersection occurred, and the distance between the 2 objects.

float DVR::Math::MathUtil::InvSqrt float  number  )  [inline, static]
 

Inverse square root.

float DVR::Math::MathUtil::Max float  value1,
float  value2
[inline, static]
 

Used to quickly determine the greater value between two values.

float DVR::Math::MathUtil::Min float  value1,
float  value2
[inline, static]
 

Used to quickly determine the lesser value between two values.

float DVR::Math::MathUtil::RadiansToDegrees float  radians  )  [inline, static]
 

Converts radians to degrees.

float DVR::Math::MathUtil::RangeRandom float  min,
float  max
[inline, static]
 

Returns a random value between the specified min and max values. Minimum value. Maximum value. A random value in the range [min,max].

float DVR::Math::MathUtil::Sin float  angle  )  [inline, static]
 

Returns the sine of the angle.

float DVR::Math::MathUtil::Sqrt float  number  )  [inline, static]
 

Returns the square root of a number. This is one of the more expensive math operations. Avoid when possible.

float DVR::Math::MathUtil::SymmetricRandom  )  [inline, static]
 

float DVR::Math::MathUtil::Tan float  angle  )  [inline, static]
 

Returns the tangent of the angle.

float DVR::Math::MathUtil::UnitRandom  )  [inline, static]
 


The documentation for this class was generated from the following file:
Generated on Tue Nov 30 22:19:44 2004 for DirectVolumeRenderer by doxygen 1.3.6