SA_Maths
Sapphire Suite's C++ Maths Library
Loading...
Searching...
No Matches
TransformRotateAxisFunctor.hpp
Go to the documentation of this file.
1// Copyright (c) 2023 Sapphire Development Team. All Rights Reserved.
2
3#pragma once
4
5#ifndef SAPPHIRE_ENGINE_TRANSFORM_ROTATE_AXIS_FUNCTOR_GUARD
6#define SAPPHIRE_ENGINE_TRANSFORM_ROTATE_AXIS_FUNCTOR_GUARD
7
9
11
13
24namespace SA
25{
31 {
32 public:
42 template <typename T, template <typename> typename... TrArgs>
43 Vec3<T> operator()(const Tr<T, TrArgs...>& _tr, const Vec3<T>& _axis)
44 {
45 if constexpr (TrHasComponent<TrRotation>())
46 return _tr.rotation * _axis;
47 else
48 return _axis;
49 }
50 };
51}
52
53
56#endif // GUARD
Transform Functor base helper definition.
Transform rotation component definition.
Vector 3 type implementation.
Compute rotated axis from transform. Functor implementation.
Definition TransformRotateAxisFunctor.hpp:31
Vec3< T > operator()(const Tr< T, TrArgs... > &_tr, const Vec3< T > &_axis)
Compute rotated axis from transform and input axis.
Definition TransformRotateAxisFunctor.hpp:43
Transform Sapphire's class.
Definition Transform.hpp:33
Vector 3 Sapphire-Maths class.
Definition Vector3.hpp:43