dhpoware logo
home products source demos contact us
navbar navbar
box top left corner box top right corner
3D Math Library.

This is the math library that we currently use in all of our internal projects. Many of our demos use this library. The main files that make up this math library are: mathlib.h, mathlib.cpp, collision.h, and collision.cpp. All other files are part of the testing framework used to test the library.

The core math classes include: Math, Vector2, Vector3, Vector4, Matrix3, Matrix4, Quaternion, and MatrixStack.
The collision classes include: BoundingBox, BoundingSphere, BoundingVolume, Plane, Frustum, and Ray.

zip file Download source, and Visual C++ 2010 solution files.

Change History:

10 July 2010.
Added missing .vcxproj.filters file to the project.

13 June 2010.
Updated solution to Microsoft Visual Studio 2010.

20 December 2009.
mathlib.h: Added new class MatrixStack.

mathlib.cpp: Added initial implementation of the MatrixStack class.

test_core.cpp: Added new function DoMatrixStackTest().

30 March 2009.
mathlib.h: Added Matrix3::createMirror() method. Added Matrix4::createMirror() method.

mathlib.cpp: Added implementation of the Matrix3::createMirror() method. Added implementation of the Matrix4::createMirror() method.

5 July 2008.
mathlib.h: Added Vector4 class. Updated Matrix4 by adding an overloaded operator* method to multiply Vector4 objects with Matrix4 objects. Added new class methods to the Matrix3 class: createFromAxes(), createFromAxesTransposed(), createFromHeadPitchRoll(), createOrient(), createRotate(), and createScale(). Added new class methods to the Matrix4 class: createFromAxes(), createFromAxesTransposed(), createFromHeadPitchRoll(), createOrient(), createRotate(), createScale(), and createTranslate().

test_core.cpp: Added DoVector4Test().

2 February 2008.
Updated solution to Microsoft Visual Studio 2008.

29 January 2007.
mathlib.h: Added Math::smoothstep() method.
test_core.cpp: Added test cases for Math::smoothstep() method in DoCommonTest() function.

12 November 2006.
Removed the use of precompiled headers from the Visual C++ 2005 solution. This should increase the library's portability to other platforms and compilers.

Added Vector2::orthogonalize() method.
Added Vector3::orthogonalize() method.

Added test 15 to the DoVector2Test() function to test the Vector2::orthogonalize() method.
Added test 16 and 17 to the DoVector3Test() to test the Vector3::orthogonalize() method.
Updated all error messages to follow same common format.

23 September 2006.
mathlib.h: Added Quaternion::slerp() method.
test_core.cpp: Added test 14 to the DoQuaternionTest() function to test the Quaternion::slerp() method.

21 September 2006.
mathlib.h: Added 4 new overloaded constructors to the Quaternion class.
test_core.cpp: Added test 13 to the DoQuaternionTest() function. This demonstrates the rotation of a point in 3D using quaternions.

30 August 2006.
mathlib.h: Fixed a bug in Math::isPower2() method where zero was being incorrectly identified as being a power of 2.

box bottom left corner content box box bottom right corner
logo logo