项目作者: cdgiessen

项目描述 :
Basic graphics oriented math library
高级语言: C++
项目地址: git://github.com/cdgiessen/cml.git
创建时间: 2017-01-20T14:25:12Z
项目社区:https://github.com/cdgiessen/cml

开源协议:

下载


cml

Charles Math Library

Library with common math functions associated with graphics.

Supports Vectors of 2, 3, and 4 components, Matrices of 3x3 and 4x4 with translation, scaling and rotation functions, Quaternions, and common graphics functions like Othrographics and Perspective matrxi calculaion.

Written for the Game Engine Design course.
Named after myself for lack of better inspiration.

Simple example usage

  1. cml::vec3f v1;
  2. cml::vec3f v2(1.0f, 1.0f, 1.0f);
  3. cml::vec3f v3 = v1 + v2; //operator overloads implemented
  4. cml::vec3f vec1 = cml::VEC3_FORWARD; //common directions provided
  5. cml::mat4<float> matA; //can use any user type
  6. matA.setScaleFactor(5);
  7. matA.setToTranslation(cml::vec3<float>(1, 2, 3));
  8. matA.det() //calculates and returns the determinant
  9. cml::mat4<float> matB = matA * v1; //matrix vector multiplication overload
  10. std::cout << matB << "\n"; //includes ostream overloads for easy printing.
  11. cml::quatf quatA = cml::quatf::fromEulerAngles(30,0,180);
  12. cml::quatf::rotate(v1, cml::QUAT_X_90)