From 19e9cbd5ac2394b302a9e79b15cad8faf071b6e1 Mon Sep 17 00:00:00 2001 From: John Tsiombikas Date: Sun, 3 Jan 2016 15:46:08 +0200 Subject: [PATCH] readme and license --- LICENSE | 20 ++++++++++++++++++++ README.md | 25 +++++++++++++++++++++++++ src/gmath.h | 9 +++++++++ src/matrix.h | 9 +++++++++ src/quat.cc | 9 +++++++++ src/quat.h | 9 +++++++++ src/quat.inl | 9 +++++++++ src/ray.h | 9 +++++++++ src/swizzle.h | 9 +++++++++ src/vector.cc | 9 +++++++++ src/vector.h | 9 +++++++++ src/vector2.inl | 9 +++++++++ src/vector3.inl | 9 +++++++++ src/vector4.inl | 9 +++++++++ 14 files changed, 153 insertions(+) create mode 100644 LICENSE create mode 100644 README.md diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..536e666 --- /dev/null +++ b/LICENSE @@ -0,0 +1,20 @@ +Copyright (C) 2016 John Tsiombikas + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..8d4e872 --- /dev/null +++ b/README.md @@ -0,0 +1,25 @@ +gph-math: graphene math library +=============================== + +About +----- +Gph-math is a C++ math library for graphics programs. It's been written as part +of the [graphene 3d engine](http://github.com/MutantStargoat/graphene) project, +but it's really a standalone reusable math library with no further ties to +graphene other than the namespace "gph". + +I intend to use this library for all my C++ graphics projects from now on, +superseding [libvmath](http://github.com/jtsiomb/libvmath), which I've been +using and evolving since the start of the century. + +Inspired by other modern math libraries like glm, gph-math follows the GLSL +conventions wherever it makes sense, and doesn't clash with my code style, +including the very elegant swizzle mechanism for conversions between vector +types. + +License +------- +Copyright (C) 2016 John Tsiombikas + +This program is free software. Feel free to use, modify, and/or redistribute it +under the terms of the MIT/X11 license. See LICENSE for details. diff --git a/src/gmath.h b/src/gmath.h index 14d5eb0..7c05bdc 100644 --- a/src/gmath.h +++ b/src/gmath.h @@ -1,3 +1,12 @@ +/* +gph-math - math library for graphics programs +Copyright (C) 2016 John Tsiombikas + +This program is free software. Feel free to use, modify, and/or redistribute +it under the terms of the MIT/X11 license. See LICENSE for details. +If you intend to redistribute parts of the code without the LICENSE file +replace this paragraph with the full contents of the LICENSE file. +*/ #ifndef GMATH_H_ #define GMATH_H_ diff --git a/src/matrix.h b/src/matrix.h index f5dbaa9..535eb2e 100644 --- a/src/matrix.h +++ b/src/matrix.h @@ -1,3 +1,12 @@ +/* +gph-math - math library for graphics programs +Copyright (C) 2016 John Tsiombikas + +This program is free software. Feel free to use, modify, and/or redistribute +it under the terms of the MIT/X11 license. See LICENSE for details. +If you intend to redistribute parts of the code without the LICENSE file +replace this paragraph with the full contents of the LICENSE file. +*/ #ifndef GMATH_MATRIX_H_ #define GMATH_MATRIX_H_ diff --git a/src/quat.cc b/src/quat.cc index 595943f..7b82ac0 100644 --- a/src/quat.cc +++ b/src/quat.cc @@ -1,3 +1,12 @@ +/* +gph-math - math library for graphics programs +Copyright (C) 2016 John Tsiombikas + +This program is free software. Feel free to use, modify, and/or redistribute +it under the terms of the MIT/X11 license. See LICENSE for details. +If you intend to redistribute parts of the code without the LICENSE file +replace this paragraph with the full contents of the LICENSE file. +*/ #include "quat.h" namespace gph { diff --git a/src/quat.h b/src/quat.h index a03ae70..aabf2c2 100644 --- a/src/quat.h +++ b/src/quat.h @@ -1,3 +1,12 @@ +/* +gph-math - math library for graphics programs +Copyright (C) 2016 John Tsiombikas + +This program is free software. Feel free to use, modify, and/or redistribute +it under the terms of the MIT/X11 license. See LICENSE for details. +If you intend to redistribute parts of the code without the LICENSE file +replace this paragraph with the full contents of the LICENSE file. +*/ #ifndef QUATERNION_H_ #define QUATERNION_H_ diff --git a/src/quat.inl b/src/quat.inl index 46606d0..5f9a4c5 100644 --- a/src/quat.inl +++ b/src/quat.inl @@ -1,3 +1,12 @@ +/* +gph-math - math library for graphics programs +Copyright (C) 2016 John Tsiombikas + +This program is free software. Feel free to use, modify, and/or redistribute +it under the terms of the MIT/X11 license. See LICENSE for details. +If you intend to redistribute parts of the code without the LICENSE file +replace this paragraph with the full contents of the LICENSE file. +*/ inline Quaternion operator -(const Quaternion &q) { return Quaternion(-q.x, -q.y, -q.z, -q.w); diff --git a/src/ray.h b/src/ray.h index 72dfc26..95f6438 100644 --- a/src/ray.h +++ b/src/ray.h @@ -1,3 +1,12 @@ +/* +gph-math - math library for graphics programs +Copyright (C) 2016 John Tsiombikas + +This program is free software. Feel free to use, modify, and/or redistribute +it under the terms of the MIT/X11 license. See LICENSE for details. +If you intend to redistribute parts of the code without the LICENSE file +replace this paragraph with the full contents of the LICENSE file. +*/ #ifndef GMATH_RAY_H_ #define GMATH_RAY_H_ diff --git a/src/swizzle.h b/src/swizzle.h index 66d27d5..a572710 100644 --- a/src/swizzle.h +++ b/src/swizzle.h @@ -1,3 +1,12 @@ +/* +gph-math - math library for graphics programs +Copyright (C) 2016 John Tsiombikas + +This program is free software. Feel free to use, modify, and/or redistribute +it under the terms of the MIT/X11 license. See LICENSE for details. +If you intend to redistribute parts of the code without the LICENSE file +replace this paragraph with the full contents of the LICENSE file. +*/ // the only function of this file is to hide the swizzle-macro eyesore // swizzle macros for Vector2 diff --git a/src/vector.cc b/src/vector.cc index 9532ccf..6861648 100644 --- a/src/vector.cc +++ b/src/vector.cc @@ -1,3 +1,12 @@ +/* +gph-math - math library for graphics programs +Copyright (C) 2016 John Tsiombikas + +This program is free software. Feel free to use, modify, and/or redistribute +it under the terms of the MIT/X11 license. See LICENSE for details. +If you intend to redistribute parts of the code without the LICENSE file +replace this paragraph with the full contents of the LICENSE file. +*/ #include "vector.h" #include "matrix.h" diff --git a/src/vector.h b/src/vector.h index da3b09b..e0f642c 100644 --- a/src/vector.h +++ b/src/vector.h @@ -1,3 +1,12 @@ +/* +gph-math - math library for graphics programs +Copyright (C) 2016 John Tsiombikas + +This program is free software. Feel free to use, modify, and/or redistribute +it under the terms of the MIT/X11 license. See LICENSE for details. +If you intend to redistribute parts of the code without the LICENSE file +replace this paragraph with the full contents of the LICENSE file. +*/ #ifndef GMATH_VEC_H_ #define GMATH_VEC_H_ diff --git a/src/vector2.inl b/src/vector2.inl index 64aa0c4..0e91585 100644 --- a/src/vector2.inl +++ b/src/vector2.inl @@ -1,3 +1,12 @@ +/* +gph-math - math library for graphics programs +Copyright (C) 2016 John Tsiombikas + +This program is free software. Feel free to use, modify, and/or redistribute +it under the terms of the MIT/X11 license. See LICENSE for details. +If you intend to redistribute parts of the code without the LICENSE file +replace this paragraph with the full contents of the LICENSE file. +*/ inline void Vector2::normalize() { float len = (float)sqrt(x * x + y * y); diff --git a/src/vector3.inl b/src/vector3.inl index 8f6167c..03c8efe 100644 --- a/src/vector3.inl +++ b/src/vector3.inl @@ -1,3 +1,12 @@ +/* +gph-math - math library for graphics programs +Copyright (C) 2016 John Tsiombikas + +This program is free software. Feel free to use, modify, and/or redistribute +it under the terms of the MIT/X11 license. See LICENSE for details. +If you intend to redistribute parts of the code without the LICENSE file +replace this paragraph with the full contents of the LICENSE file. +*/ inline void Vector3::normalize() { float len = (float)sqrt(x * x + y * y + z * z); diff --git a/src/vector4.inl b/src/vector4.inl index c37eed1..8c5709a 100644 --- a/src/vector4.inl +++ b/src/vector4.inl @@ -1,3 +1,12 @@ +/* +gph-math - math library for graphics programs +Copyright (C) 2016 John Tsiombikas + +This program is free software. Feel free to use, modify, and/or redistribute +it under the terms of the MIT/X11 license. See LICENSE for details. +If you intend to redistribute parts of the code without the LICENSE file +replace this paragraph with the full contents of the LICENSE file. +*/ inline void Vector4::normalize() { float len = (float)sqrt(x * x + y * y + z * z + w * w); -- 1.7.10.4