Sam Hocevar
2bf4cb668b
math: add a uniform scaling matrix constructor.
13 роки тому
Sam Hocevar
222ae90ba8
core: use "f128" as the long double prefix for vectors, even if it's
not always really a 128-bit type.
13 роки тому
Sam Hocevar
d4c0c005d6
math: refactor real number constant declarations so that they are only
computed on demand with static initialisation.
13 роки тому
Lolbot
23807ea88e
fixed 23 files out of 277:
- fixed 1270 CR characters
- fixed 56 trailing spaces
- fixed 5085 tabs
13 роки тому
Benjamin ‘Touky’ Huet
2f85ae6d0a
13 роки тому
Sam Hocevar
5c5abfa53c
math: improve slerp implementation.
13 роки тому
jeunathe
cbd842b21a
Added Slerp method to Quat
13 роки тому
Sam Hocevar
f2c269cb1e
math: add dot() for quaternions, plus the relevant unit test.
13 роки тому
Sam Hocevar
688c046414
math: add an sprintf() method to real numbers, and ensure they are always
fully initialised.
13 роки тому
Sam Hocevar
28728814cc
core: replace usage of sin() or std::sin() with lol::sin() where appropriate.
13 роки тому
Sam Hocevar
8375f3443d
build: fix the PS3 port by using our trig.h everywhere instead of stdlib
functions; also remove a lot of idiotic "using namespace std" from the
codebase.
13 роки тому
Sam Hocevar
c035a1c2b7
core: fix a few build warnings and remove useless operators from the
"half" class. The build is now 3% faster.
13 роки тому
Sam Hocevar
a71562bd83
core: rename f64vec4 to dvec4 etc. for consistency with GLSL.
14 роки тому
Sam Hocevar
bd5ff72507
math: declare some HLSL-compliant types.
14 роки тому
Sam Hocevar
59ba6e6c87
core: no longer deactivate std::ostream features on Android.
14 роки тому
Sam Hocevar
43b55669a4
math: workaround for an apparent Visual Studio compiler bug in
template specialisation order.
14 роки тому
Sam Hocevar
b1d9c511bf
core: some clang and g++ 4.7 compilation fixes.
14 роки тому
Sam Hocevar
4770daf4ac
math: replace len(vec) with length(vec) to match the GLSL naming.
14 роки тому
Sam Hocevar
f30105e675
math: implement all Euler conversions for 3×3 matrices.
14 роки тому
Sam Hocevar
552dfee5b1
math: implement quaternion creation from true Euler angles (as opposed
to the Tait-Bryan angles we had for now). Also, change quaternion storage
order to wxyz in order to match the constructors.
14 роки тому
Sam Hocevar
da6062de06
core: add methods to set the camera's view matrix.
14 роки тому
Sam Hocevar
e1d0beae1a
math: support all Tait-Bryan angle combinations in quaternions.
14 роки тому
Sam Hocevar
c276dbb1ff
math: allow to write 1.f / q to take a quaternion's inverse.
14 роки тому
Sam Hocevar
2d34fd8358
core: reduce compilation time by about 30% by playing with namespaces
and avoid cluttering the compiler's symbol table.
14 роки тому
Sam Hocevar
ecda7cd569
math: replace mat3::rotate(quat) with an explicit constructor, and add
more unit tests for the quaternion to 3×3 matrix conversion.
14 роки тому
Sam Hocevar
5ff96967a0
math: add Quat::transform() to directly apply a quaternion to a vector.
14 роки тому
Sam Hocevar
e91c326f57
math: add methods to convert from a quaternion to Euler angles and from
Euler angles to a rotation matrix. Also fix quat::rotate() which was not
building the correct quaternion.
14 роки тому
Sam Hocevar
fceeaf1c74
math: add quat::fromeuler static constructor for quaternions.
14 роки тому
Sam Hocevar
1bc2a7d705
build: fix compilation on Windows by undefining the min and max macros
that WinDef.h insists on shoving down our throats.
14 роки тому
Sam Hocevar
ade0514b15
math: add min(), max() and clamp() for half, real and vector types.
14 роки тому
Sam Hocevar
8325d8889c
math: chage quaternion constructor to wxyz order because it matches the
mathematical writing, and add static constructors to create quaternions
from a rotation.
14 роки тому
Sam Hocevar
e1070c3b3c
debug: do not use std::abort() on the PS3.
14 роки тому
Sam Hocevar
bed2d554c1
math: new mat3::scale() and mat4::scale() methods.
14 роки тому
Sam Hocevar
3e3b254423
math: implement rotate() for mat3 in addition to mat4.
14 роки тому
Sam Hocevar
9dad69c630
math: allow to easily create a 4x4 matrix from a 3x3 matrix, and so on.
14 роки тому
Sam Hocevar
f1c0e3ba4e
gpu: add methods to send mat2 and mat3 matrices to the shader.
14 роки тому
Sam Hocevar
be4935c19c
math: add code to build the normal matrix from a transformation matrix.
14 роки тому
Sam Hocevar
eb51928415
math: add inversion code for 2×2 and 3×3 matrices, and transposition
code for all matrices.
14 роки тому
Sam Hocevar
8da2f504a8
debug: use std::abort() instead of a custom idiocy.
14 роки тому
Sam Hocevar
4e4d5a8e06
build: fix GCC build; it doesn't like to have a local file called debug/debug.h.
14 роки тому
Sam Hocevar
b34088e5bd
math: add mat2 and mat3 types; they'll be useful.
14 роки тому
Sam Hocevar
64da211c62
math: do not use #pragma diagnostic push for GCC prior to 4.6.
14 роки тому
Sam Hocevar
5d2ddbdb6f
math: use size_t instead of int for vector subscript to avoid torrents
of compiler warnings in 64-bit mode when sizeof(foo) is used as the
argument for the array subscript operator. No need to care about the
non-signedness since only positive indices work.
14 роки тому
Sam Hocevar
d9f600f7e3
math: disable vectors of halfs until we find a way to speed up the build
time, for now the .h takes 17 seconds to compile for each file!
14 роки тому
Sam Hocevar
33a3897b06
math: add vectors of "half" to vector.h.
14 роки тому
Sam Hocevar
2d3307c6b2
math: move cross product out of the .cpp file.
14 роки тому
Sam Hocevar
89c3b3a60f
ps3: fix PS3 build after the Queue refactoring.
14 роки тому
Sam Hocevar
8bea4cf189
math: ensure real::fabs() is never chosen over std::fabs() for arguments
that are not explicitly real, even with namespace mistakes.
14 роки тому
Sam Hocevar
7867c6ea3e
math: fix minor warnings in half.h and vector.h.
14 роки тому
Sam Hocevar
b4610706c0
math: move half.h into the public headers.
14 роки тому