Sam Hocevar
155ae65a4e
Start working on the header-only part of the framework.
This implies creating a trimmed down branch that contains almost
nothing. It will then be usable by projects that do not need the
complex build system, and by the engine itself as a submodule from
the same repository.
преди 5 години
Sam Hocevar
b5de2bd6e6
math: implement <<(ostream &, real).
преди 5 години
Sam Hocevar
9a73325d68
math: fix a bug in hex display of reals.
преди 5 години
Sam Hocevar
2bf54ebcb0
math: use std::string logic rather than printf() for real number formatting.
преди 5 години
Sam Hocevar
5814dd4cf0
math: fix a bug in real::cbrt() that completely broke the function.
преди 6 години
Sam Hocevar
1388625308
input: remove dead code and more cleanup.
преди 6 години
Sam Hocevar
67a5138718
math: use std::vector instead of lol::array.
преди 6 години
Sam Hocevar
a407c5d5c4
math: add lol::real to 64-bit integer conversions and clean up code.
преди 6 години
Sam Hocevar
c826bbd6f0
Fix several compilation warnings.
преди 7 години
Sam Hocevar
6281145d9d
Implement real::erf() with reasonable precision.
преди 7 години
Sam Hocevar
80823faac6
Make fast real factorial more generic.
This new version allows to compute odd and even double factorials
without harming performance for the standard factorial.
преди 7 години
Sam Hocevar
e0795e91ad
Implement real(int64_t) and real(uint64_t).
преди 7 години
Sam Hocevar
3025ea2207
Implement real::R_INF and real::R_NAN.
преди 7 години
Sam Hocevar
d89a4c9e02
Implement real::is_negative().
преди 7 години
Sam Hocevar
74f174b6d7
Implement real::is_zero and a few others for code clarity.
преди 7 години
Sam Hocevar
c7c34312fe
Handle real::DEFAULT_BIGIT_COUNT changes a bit better.
Most operators do not yet handle reals of different sizes, but
this change fixes the most glaring bugs.
преди 7 години
Sam Hocevar
359c6fc4c4
Make the real number size a global variable (yuck).
преди 7 години
Sam Hocevar
74fc7c1f58
Fix real construction from long doubles.
It was hard to avoid some of the compiler optimisations caused by our
intermediate conversion to double, so we hide them behind the actual
real object. Also, this commit fixes a potential exponent overflow.
преди 7 години
Sam Hocevar
8ffc3ccae2
Fix issues in real::sqrt() and other methods.
Now that the exponent is no longer biased, it is a signed number, and we
need to account for that when dividing it and expecting rounding rules to
behave in a certain way.
преди 7 години
Sam Hocevar
1c27691ef9
Temporary fix for real::sqrt() which I broke recently.
преди 7 години
Sam Hocevar
dd140fd9e1
Refactor real numbers so that they can have a dynamic size.
Some checks are failing, I probably messed up several functions.
преди 7 години
Sam Hocevar
783fdbab98
Implement Franke’s function and Matlab’s peaks for reals.
преди 7 години
Sam Hocevar
0239617197
Various compilation and warning fixes.
преди 7 години
Sam Hocevar
1733d0ffd8
math: tweak the real number printing routine.
By adding a bias we ensure that 1.999… will be displayed as 2.0 as long as we
do not ask for too many digits, and that rounding is reasonable for most values.
Note that our need for proper rounding is not as high as for IEEE floats since
we have an insane amount of digits at our disposal.
Also we now get rid of trailing zeroes when printing reals.
преди 7 години
Sam Hocevar
17db5be5c8
math: remove some hardcoded stuff from the real numbers implementation.
преди 7 години
Sam Hocevar
df7454b36a
math: add real::R_MIN and real::R_MAX and get rid of real::ulp().
преди 7 години
Sam Hocevar
60ee86f908
ufiodsfiodsifods
преди 7 години
Sam Hocevar
5d62baaaae
math: parse hexadecimal reals as per C standard, 6.4.4.2.
преди 7 години
Sam Hocevar
7b9d98109b
math: use exponentiation by squaring for real::pow().
преди 7 години
Sam Hocevar
10f244192c
math: allow to create real numbers from long doubles
преди 8 години
Sam Hocevar
c7567975e3
math: add τ (tau) to the list of maths constants.
преди 9 години
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.
преди 9 години
Sam Hocevar
efe8e1d051
math: allow to build real numbers from 64-bit integers.
преди 10 години
Sam Hocevar
cd988786b9
build: reorganise includes so that we can use precompiled headers later.
преди 10 години
Sam Hocevar
ad9a388e80
misc: remove 100% of the "using namespace std;" madness.
преди 10 години
Sam Hocevar
fe665f85b4
base: strip core.h from its contents and put it in public/private headers.
преди 10 години
Sam Hocevar
cdfb4e7abf
math: fix a few compilation warnings.
преди 10 години
Sam Hocevar
8443733a08
math: add GLSL-inherited degrees() and radians() conversion functions.
преди 11 години
Sam Hocevar
6faf4ee067
base: roll our own constants because it’s always a pain in the ass
to get M_PI from the platform headers and cast it to float.
преди 12 години
Sam Hocevar
33f2199903
math: minor improvements to the Remez exchange algorithm.
преди 12 години
Sam Hocevar
4678b4cb75
math: fix a signed integer overflow issue in the fast factorial
computation function.
преди 12 години
Sam Hocevar
16d53895fa
math: remove coercion rules in the vector classes, they increase the
compilation time for very little benefit and maybe even confusion.
преди 12 години
Benjamin ‘Touky’ Huet
c7219ff1dd
New year copyright update.
преди 12 години
Sam Hocevar
d6634da83f
build: fix the WTFPL site URL in all code comments.
преди 12 години
Sam Hocevar
d4c0c005d6
math: refactor real number constant declarations so that they are only
computed on demand with static initialisation.
преди 12 години
Sam Hocevar
688c046414
math: add an sprintf() method to real numbers, and ensure they are always
fully initialised.
преди 12 години
Sam Hocevar
28728814cc
core: replace usage of sin() or std::sin() with lol::sin() where appropriate.
преди 12 години
Sam Hocevar
ade0514b15
math: add min(), max() and clamp() for half, real and vector types.
преди 13 години
Sam Hocevar
56e4332597
build: reorganise math files in a single "math" directory, and get rid of the
"shader" source directory since we have "gpu".
преди 13 години
Sam Hocevar
60a2e83d54
xbox: start working on an Xbox/Direct3D port.
преди 13 години