Skip to content

Collection of single-header libraries for various game and graphics related mathematics

License

Notifications You must be signed in to change notification settings

vallentin/GameMath

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GameMath Release License

GameMath is a collection of single-header libraries for various game and graphics related mathematics.

Library Latest Version Description
gm_math.hpp 1.0.0 Like math.h but for gamedev specific functions
gm_color.hpp 1.2.0 Contains functionality for converting between color models and changing colorfulness
gm_easing.hpp 1.0.0 Contains simple easing functions

GameMath is compatible with both C and C++. Files denoted with .h is compatible with both C and C++, whereas files denoted with .hpp is only compatible with C++.

Libraries

Math (gm_math.hpp)

If you're developing on Windows and have any Windows headers included. Then macros min and max might have been defined. This will (at least) break gm_math.hpp (as well as gm_linear.hpp).

To counteract this either #undef min and max or #define NOMINMAX before including any Windows headers.

Color (gm_color.hpp)

HSL & RGB Conversion

Depending on the software HSL is represented in different ranges. Hue, Saturation and Lightness (or brightness) is usually represented as a range between [0;240]. As HSL is also visually represented as a cylinder, H, S, L is thereby usually represented as Hue being an angle from [0;360] and Saturation and Lightness being a percentage [0;100%].

For ease of use the library's HSL and RGB converter takes and outputs in the range of [0;1].

Reporting Bugs & Requests

Feel free to use the issue tracker, for reporting bugs, submitting patches or requesting features.

Before submitting bugs, make sure that you're using the latest version of GameMath.

License

Copyright (c) 2012-2016 Christian Vallentin <mail@vallentinsource.com>

This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.

Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:

1. The origin of this software must not be misrepresented; you must not
   claim that you wrote the original software. If you use this software
   in a product, an acknowledgment in the product documentation would be
   appreciated but is not required.

2. Altered source versions must be plainly marked as such, and must not
   be misrepresented as being the original software.

3. This notice may not be removed or altered from any source
   distribution.

About

Collection of single-header libraries for various game and graphics related mathematics

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages