Sam Hocevar
10f244192c
math: allow to create real numbers from long doubles
9 vuotta sitten
Sam Hocevar
c7567975e3
math: add τ (tau) to the list of maths constants.
10 vuotta sitten
Sam Hocevar
078751a820
math: all API functions dealing with angles now use radians.
We already have the convenient degrees() and radians() functions to convert
between angle formats. This commit involves a lot of refactoring here and
there and I may have missed some places where conversions were needed. But
hopefully there aren’t may such places.
10 vuotta sitten
Sam Hocevar
45b57cc102
math: rename re() to inverse() in all classes.
The name “re” came from “reciprocal” but since we have “inverse” for
matrices, I thought it would be nice to make everything consistent.
10 vuotta sitten
Sam Hocevar
861568b146
misc: some cleanup in files, including UTF-8 BOM.
10 vuotta sitten
Sam Hocevar
441a20af99
misc: fix copyright information here and there.
10 vuotta sitten
Sam Hocevar
38733fade7
math: move the matrix-to-quaternion code to a global header.
This lets us use the code for non-float variable types. I also got
rid of the mat4-to-quat code so that users are forced to use the
mat3-to-quat code and possibly discover places where their code is
suboptimal.
10 vuotta sitten
Sam Hocevar
977049a7b3
math: make the matrix-to-quaternion code shorter.
10 vuotta sitten
Sam Hocevar
d64b117b8d
build: fix license and copyright information.
10 vuotta sitten
Sam Hocevar
70edc0d38e
misc: carry on with the lowercase rampage.
Using “Array” instead of “array” is now fully deprecated, and I replaced
the Log::Debug() etc. functions with msg::debug() etc. because log:: was
unavailable due to being a maths function.
Added up-to-date copyright notice and BOM to modified files, just in case.
10 vuotta sitten
Sam Hocevar
03c17fcae4
base: clean up and refactor containers.
The containers no longer force the user to use the ptrdiff_t type for
size information. For convenience, size() now always returns an int,
and the size_s() method offers a way to handle arrays with more than
2 billion elements. Internally, we still use ptrdiff_t, though.
Since so much code had to be changed, I took the opportunity to get
rid of capitalised accessors for classes that are lowercase.
10 vuotta sitten
Sam Hocevar
f791b672ed
misc: lots of compilation fixes for Visual Studio (related to mediocre
support for enable_if and other template metaprogramming techniques),
for Clang (related to static const template class member initialisation)
and for GCC (related to forward declaration of non-int enum classes).
11 vuotta sitten
Sam Hocevar
a07844682e
build: remove dead PS3 code.
11 vuotta sitten
Sam Hocevar
efe8e1d051
math: allow to build real numbers from 64-bit integers.
11 vuotta sitten
Sam Hocevar
cd988786b9
build: reorganise includes so that we can use precompiled headers later.
11 vuotta sitten
Sam Hocevar
97cdc17ae1
math: add outer product for matrices and vectors.
11 vuotta sitten
Sam Hocevar
a46afd6ed5
math: make cofactor computation and matrix inversion simpler and more generic.
11 vuotta sitten
Sam Hocevar
f7a8d5079b
math: disable a few unused operators (for integer quaternions, for instance).
11 vuotta sitten
Sam Hocevar
62f7068516
math: move code from vector.cpp to matrix.cpp and transform.cpp.
11 vuotta sitten
Sam Hocevar
ffa21ed0d0
misc: disable all 16-bit float vectors when using Visual Studio.
11 vuotta sitten
Sam Hocevar
4f28047fc4
math: refactor more shit, I have no idea what I’m doing.
11 vuotta sitten
Sam Hocevar
52cd11358e
math: finish renaming matrix<> to mat<>.
11 vuotta sitten
Sam Hocevar
7a28671dee
math: get rid of the base_vec* classes (thanks to relaxed unions), rename
MASK to SWIZZLE in the vector templates, rename matrix<> to mat<> for
consistency, implement transposition for all matrix sizes, make matrix
columns private and only accessible through operator[].
11 vuotta sitten
Sam Hocevar
ad9a388e80
misc: remove 100% of the "using namespace std;" madness.
11 vuotta sitten
Sam Hocevar
12aaff89e3
base: huge refactor in vector.h; GCC compilation times down by 50%.
11 vuotta sitten
Sam Hocevar
fe665f85b4
base: strip core.h from its contents and put it in public/private headers.
11 vuotta sitten
Benjamin ‘Touky’ Huet
60887138ff
Added tostring to vectors, similar to printf, but with tostring.
11 vuotta sitten
Benjamin ‘Touky’ Huet
5f12e3ebc1
operator bis repetitas ....
11 vuotta sitten
Benjamin ‘Touky’ Huet
115bd31b0e
Learn your fucking operators, you dumbass !!!!!
11 vuotta sitten
Sam Hocevar
cdfb4e7abf
math: fix a few compilation warnings.
11 vuotta sitten
Benjamin ‘Touky’ Huet
fd4cb5e350
Added debug stuff
11 vuotta sitten
Sam Hocevar
76740f77bc
math: remove some vector constants that were a bit too specific.
12 vuotta sitten
Benjamin ‘Touky’ Huet
98eb66b6c8
geomerty cleanup & tweak
12 vuotta sitten
Benjamin ‘Touky’ Huet
c753233291
geom tweaks
12 vuotta sitten
Benjamin ‘Touky’ Huet
b2bdb1972f
Several name tweaks here and there.
12 vuotta sitten
Sam Hocevar
cb62b52ce6
math: add quat::axis() and quat::angle() to retrieve axis and angle from a
quaternion, improve quat::rotate(vec3, vec3) to gracefully handle corner
cases, and add unit tests for all of these.
12 vuotta sitten
Benjamin ‘Touky’ Huet
b7fc1953ab
Some names tweaks
Added workbench, for personnal experimentation.
12 vuotta sitten
Sam Hocevar
8443733a08
math: add GLSL-inherited degrees() and radians() conversion functions.
12 vuotta sitten
Benjamin ‘Touky’ Huet
03474adceb
Added custom vector constants for more usefulness
12 vuotta sitten
Benjamin ‘Touky’ Huet
88a4859287
Added Test Point in Frustum
12 vuotta sitten
Sam Hocevar
2bbc0d965a
math: fix broken translation in lookat() function.
12 vuotta sitten
Sam Hocevar
7cf2a85ae0
math: make mat4::lookat nicer to read.
12 vuotta sitten
Sam Hocevar
2291ce5d1e
math: add mat2::identity, etc. as global constants.
12 vuotta sitten
Sam Hocevar
3b62246ef8
math: minor rework in the Euler angles conversion.
12 vuotta sitten
Benjamin ‘Touky’ Huet
747da72c44
Input : Small refactor, for clarity, easiness and beautification.
Constants : Added minus one.
12 vuotta sitten
Benjamin ‘Touky’ Huet
2b4dc175ee
Vector classes : added one (for consistency)
SceneSetup : Added ClearColor command
EZMesh : Added Dup[ ... ] command && cgs command syntax refactor
MViewer : Tweak & dictionnary.js updates
12 vuotta sitten
Sam Hocevar
5f3ad5cc15
math: add constant vectors vec2::zero, vec2::axis_x, etc.
12 vuotta sitten
Benjamin ‘Touky’ Huet
0a7dc44a67
Added MessageService : Basic & Naive Message logging.
Camera & vector.cpp : Fixed shifted_perspective crash with almost zero FOV.
12 vuotta sitten
Sam Hocevar
353d0a4417
math: last pass (hopefully) at the quaternion/euler conversions.
12 vuotta sitten
Sam Hocevar
d5d73330e8
math: more quaternion to Euler angles fixes, plus unit tests.
12 vuotta sitten