Vladimír Vondruš
78b52627c4
Platform: fix warning about undeclared function.
13 years ago
Vladimír Vondruš
d6d69c40ad
Fix comma at the end of enumeration list.
...
I know C99/C++11 allows this, but for me this is as bad as wrong
whitespaces or superfluous `;` characters.
13 years ago
Vladimír Vondruš
fa7665d63e
Platform: no need to include GL headers just for GL_TRUE.
...
It is, always was and always will be defined as 1, so why bother.
13 years ago
Vladimír Vondruš
b7771de0a3
Set both TARGET_NACL and MAGNUM_TARGET_NACL in CMakeLists.
...
Being consistent with all other options, all of them are both
unprexfixed and prefixed in CMake (and then only prefixed versions are
saved into `magnumConfigure.h` file).
13 years ago
Vladimír Vondruš
f490fc8149
DebugTools: no need to prefix the test so much.
13 years ago
Vladimír Vondruš
83bda8bbe6
Math: fixed test for denormalize<UnsignedLong, long double>().
...
Amazing what single forgotten literal can do.
13 years ago
Vladimír Vondruš
35eb876303
Various other compilation fixes for OpenGL ES target.
13 years ago
Vladimír Vondruš
ba0f56fa51
No need to use Double type in tests so extensively.
...
Makes porting to OpenGL ES easier.
13 years ago
Vladimír Vondruš
b28261d269
Math: fix compilation of tests with OpenGL ES.
...
Double precision is not supported there, mention that for skipped test
cases.
13 years ago
Vladimír Vondruš
14c6790701
Shaders: set default values for VertexColorShader uniforms.
...
Default value for matrix uniform would be zero uniform which would cause
"black screen of death".
13 years ago
Vladimír Vondruš
127910d537
Shaders: minor tweaks.
...
Non-matching number of opening and closing braces confused editors with
code folding feature.
13 years ago
Vladimír Vondruš
be5c872c8a
Math: fixed two typos in the test.
...
They resulted in fact that the test case didn't actually test anything.
Spotted by Clang.
13 years ago
Vladimír Vondruš
66a3f1177d
GCC 4.6 compatibility: disable `-pedantic` warning.
...
The compiler doesn't like list-initialization of array of classes
(RectangularMatrix constructors). It is perfectly legal C++11 and both
GCC 4.7 and Clang accept it without notice.
13 years ago
Vladimír Vondruš
fcb756e42a
Revert "GCC 4.6 compatibility: can't list-initialize array of classes."
...
It does too much harm on GCC 4.6 (all these constexpr constructors are
not constexpr now). We can disable that `-pedantic` warning for GCC 4.6
only and live with that.
This reverts commit 2d92d497d9 .
13 years ago
Vladimír Vondruš
dd788285dc
Various code cleanup.
13 years ago
Vladimír Vondruš
39eed3f7d6
Code cleanup: shorter angle initializers.
13 years ago
Vladimír Vondruš
38ec076eda
Minor code cleanup (unused parameters).
13 years ago
Vladimír Vondruš
e76543703f
Trade: don't define MeshData constructor etc. in header.
...
The class has heavy construction/destruction due to all the vectors.
13 years ago
Vladimír Vondruš
5db0861b82
Trade: don't define AbstractImporter constructors in header.
...
They are heavier than it seems due to inheritance and virtual
functions.
13 years ago
Vladimír Vondruš
4bb919e138
Don't define Query constructors & destructors in header.
...
AbstractQuery is virtual class, thus the constructors & destructors are
heavier than it looks.
13 years ago
Vladimír Vondruš
2d92d497d9
GCC 4.6 compatibility: can't list-initialize array of classes.
...
Awesome bug. In GCC 4.6 it throws plenty of ungoogleable `-pedantic`
warnings and in GCC 4.5 it fails directly with "error: bad array
initializer". Fallback to initialization using for-cycle.
Hello, performance? You can go home now.
13 years ago
Vladimír Vondruš
999b7d55c0
GCC 4.6 compatibility: no delegating constructors.
...
Don't know why the corresponding conversion operator can't be constexpr.
13 years ago
Vladimír Vondruš
7bb580e03b
GCC 4.6 compatibility: this can't be constexpr, don't know why.
13 years ago
Vladimír Vondruš
ba105b1cf6
Math: test constexpr vector conversion.
13 years ago
Vladimír Vondruš
7b140db3ed
Properly test swizzle() constexpr.
...
Removed constExpressions() test case and merged it to others, reducing
duplicate code.
13 years ago
Vladimír Vondruš
a60f35a026
Fixed a few typos in docs (ahem).
13 years ago
Vladimír Vondruš
8b7c21cef9
Better README with catchy design goals and stuff.
13 years ago
Vladimír Vondruš
fe3a73aab2
SceneGraph: add DualQuaternionTransformation::rotate[XYZ]() overloads.
...
They only pass the arguments to original implementation but return
proper type to avoid weird issues with different method chaining order.
13 years ago
Vladimír Vondruš
ce6f999904
Math: better isNormalized() implementation.
...
Comparing squared length to 1 is not sufficient to compare within range
[1 - epsilon, 1 + epsilon], as e.g. Quaternion with dot() = 1 + 1e-7
when converted to matrix has column vectors with dot() = 1 + 1e-6, which
is just above 1 + epsilon. Thus it's needed to compare sqrt(dot()) in
range [1 - epsilon, 1 + epsilon] or dot() in range [1 - 2*epsilon +
epsilon^2, 1 + 2*epsilon + epsilon^2]. Because epsilon^2 is way off
machine precision, it's omitted, thus dot() in all isNormalized()
implementations is now compared this way:
abs(dot() - 1) < 2*epsilon;
13 years ago
Vladimír Vondruš
f4f44d9d90
Math: allow creating DualComplex/DualQuaternion from real part only.
...
Useful when creating transformation from rotation only.
13 years ago
Vladimír Vondruš
4744b631bb
Math: test pow() constexpr.
13 years ago
Vladimír Vondruš
7cb79b145e
Math: test Constants constexpr.
13 years ago
Vladimír Vondruš
b28b90a9df
Math: merged constExpressions() test cases into other test cases.
...
Simplifies the code and reduces duplicates.
13 years ago
Vladimír Vondruš
3e0e91d7db
Math: renamed {rotationAngle, rotationAxis}() -> {rotation, angle, axis}().
...
DualQuaternion and DualComplex has now only rotation() which returns
full rotation part, rotationAngle() and rotationAxis() on Quaternion and
Complex were renamed to angle() and axis().
13 years ago
Vladimír Vondruš
73a4e9b18a
Math: doc++
13 years ago
Vladimír Vondruš
b349eaf753
SceneGraph: new class DualQuaternionTransformation.
...
Uses dual quaternions for 3D transformation.
13 years ago
Vladimír Vondruš
85abf5767e
SceneGraph: new class DualComplexTransformation.
...
Uses dual complex numbers for 2D transformation.
13 years ago
Vladimír Vondruš
e9b3228943
SceneGraph: minor code cleanup.
13 years ago
Vladimír Vondruš
da2bbac104
Math: simplified Matrix::isOrthogonal().
...
No need to call std::abs() when comparing with zero, as dot() should
always be positive.
13 years ago
Vladimír Vondruš
b00554fd7f
Math: added convenience {Quaternion,DualQuaternion}::isNormalized().
13 years ago
Vladimír Vondruš
1790f37295
Math: added convenience functions {Complex,DualComplex}::isNormalized().
13 years ago
Vladimír Vondruš
3db2aa13c4
Math: added convenience function Vector::isNormalized().
13 years ago
Vladimír Vondruš
0d5f234f64
SceneGraph: public setTransformation() and transform() for RigidMT*D.
...
Now it is nearly similar to MatrixTransformation*D except for scaling.
Public functions setTransformation() and transform() assert that the
matrix represents rigid transformation.
13 years ago
Vladimír Vondruš
e4f14c4163
SceneGraph: assert proper matrix type in RigidMatrixTransformation*D.
13 years ago
Vladimír Vondruš
332e4cdb71
SceneGraph: added AbstractTransformation::resetTransformation().
...
It was doable in subclasses, but not via any interface, making some
things impossible.
13 years ago
Vladimír Vondruš
8548a2e08b
SceneGraph: renamed {Euclidean -> Rigid}MatrixTransformation{2,3}D.
...
It's shorter, following changes in Math (Matrix*::invertedRigid(),
Matrix*::isRigidTransformation()).
13 years ago
Vladimír Vondruš
da93b2ad6a
Math: ability to create Quaternion and DualQuaternion from matrix.
13 years ago
Vladimír Vondruš
9128820e35
Math: ability to create Complex and DualComplex from matrix.
13 years ago
Vladimír Vondruš
33058aa5b0
Math: Matrix::invertedOrthogonal(), Matrix{3,4}::invertedRigid().
...
Renamed original invertedEuclidean() functions to invertedRigid() and
simplified them using isRigidTransformation().
13 years ago
Vladimír Vondruš
dfe2571047
Math: added Matrix{3,4}::isRigidTransformation().
13 years ago