Mainly a convenience function in case you want to compute sin and cos of
the same, potentially longer expression, and you don't want to have
repeated code or temporary variables. On some architectures might use
faster instruction that computes both values in one shot.
- Use explicit conversion to `T`
- Use `std::` for `acos, cos, sin` to avoid use of double only functions
- Do not mutate variables in math code to avoid confusion
Signed-off-by: Squareys <Squareys@googlemail.com>
Should help people understand the code and counteracts the unreadability
caused by the optimization commit at least a bit.
Signed-off-by: Squareys <Squareys@googlemail.com>
Optimized with simple code tricks, some very complex math (like `2*0.5=1`),
and principal of locality. Things the compiler would probably do for me
anyway. Was able to remove about 6 useless float multiplications.
Signed-off-by: Squareys <Squareys@googlemail.com>
Clang 3.7 complained that it would prevent copy elision optimizations.
Thanks, Clang! On the other hand, I have a weird feeling that this would
break the build somewhere else...
Now works both ways. The base class works with virtually any combination
that is supported by the underlying types, so e.g. Dual<Matrix3<T>>
could be multiplied/divided with Vector3<T> (result is Vector3<T>), with
Matrix3<T> (result is Matrix3<T>) or with T (result is Matrix3<T>).
The macros, on the other hand, because they are there only to help with
implementation of *my* subclasses, restrict that to the two only cases I
need (i.e. multiplication with Dual<T> and Dual<T::Type> and nothing
else). Could be extended in the future if it needs to be.
When PlayableGroup.h is used without Playable.h, the compiler spits out a
very unintuitive error message, which would probably confuse unfamiliar
users.
This change fixes that error message appearing.
Signed-off-by: Squareys <Squareys@googlemail.com>
In some cases the GL context creation might success without error, but
the created version is one that we don't want (e.g. software GDI
rasterizer on Windows). Previously the Context class constructor just
exited the application and it was impossible to react on that from the
application side (for example reducing some context feature
requirements).
Now there is Platform::Context::tryCreate(), which returns either
created instance or `nullptr` if the instance creation failed with some
error. That is now used in all Platform::*Application implementations.
Both GCC and Clang don't warn if deprecated function is used from inside
another deprecated function (as one would expect). However, MSVC is
doing that and producing a lot of noise. Even worse, when trying to
compile the code under new WindowsStore/WindowsPhone SDKs, the project
files now by default treat these warnings as errors, making the code
uncompilable (unless deprecated API is turned off by disabling
BUILD_DEPRECATED in CMake).
Mesa needs at least GL 3.1 to create core contexts and it creates
context with highest possible version. Great. Requesting that on binary
NV drivers will force the version to 3.1, which is, to say it mildly,
useless.
Thus, when binary NV drivers are detected, the core context is destroyed
and we're starting over, requesting compatibility 2.1 context, which
properly returns GL 4.5. Uhh.
Should be obvious and are positioned above each other, so getting to the
getter from the setter vice versa should be easy.
Signed-off-by: Squareys <Squareys@googlemail.com>
Listener manages position, orientation and gain of the OpenAL listener and
provides a method to update mutliple PlayableGroups efficiently aswell
as making sure there is at most one active Listener used at any given time
(since OpenAL only supports the notion of exactly one listener).
Signed-off-by: Squareys <Squareys@googlemail.com>
Playable manages the position, orientation and gain of an
`Magnum::Audio::Source`. PlayableGroup is its corresponding FeatureGroup,
which enables playing/pausing/stopping multiple sounds sources, aswell as
setting a common gain and sound transformation for them.
Signed-off-by: Squareys <Squareys@googlemail.com>