Merge branch 'pr/82'
This commit is contained in:
commit
4de37bf9fa
|
|
@ -8,6 +8,7 @@
|
||||||
#define NAZARA_VECTOR2_HPP
|
#define NAZARA_VECTOR2_HPP
|
||||||
|
|
||||||
#include <Nazara/Core/String.hpp>
|
#include <Nazara/Core/String.hpp>
|
||||||
|
#include <functional>
|
||||||
|
|
||||||
namespace Nz
|
namespace Nz
|
||||||
{
|
{
|
||||||
|
|
@ -119,6 +120,11 @@ template<typename T> std::ostream& operator<<(std::ostream& out, const Nz::Vecto
|
||||||
template<typename T> Nz::Vector2<T> operator*(T scale, const Nz::Vector2<T>& vec);
|
template<typename T> Nz::Vector2<T> operator*(T scale, const Nz::Vector2<T>& vec);
|
||||||
template<typename T> Nz::Vector2<T> operator/(T scale, const Nz::Vector2<T>& vec);
|
template<typename T> Nz::Vector2<T> operator/(T scale, const Nz::Vector2<T>& vec);
|
||||||
|
|
||||||
|
namespace std
|
||||||
|
{
|
||||||
|
template<class T> struct hash<Nz::Vector2<T>>;
|
||||||
|
}
|
||||||
|
|
||||||
#include <Nazara/Math/Vector2.inl>
|
#include <Nazara/Math/Vector2.inl>
|
||||||
|
|
||||||
#endif // NAZARA_VECTOR2_HPP
|
#endif // NAZARA_VECTOR2_HPP
|
||||||
|
|
|
||||||
|
|
@ -1057,6 +1057,29 @@ Nz::Vector2<T> operator/(T scale, const Nz::Vector2<T>& vec)
|
||||||
return Nz::Vector2<T>(scale / vec.x, scale / vec.y);
|
return Nz::Vector2<T>(scale / vec.x, scale / vec.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace std
|
||||||
|
{
|
||||||
|
template<class T>
|
||||||
|
struct hash<Nz::Vector2<T>>
|
||||||
|
{
|
||||||
|
/*!
|
||||||
|
* \brief Specialisation of std to hash
|
||||||
|
* \return Result of the hash
|
||||||
|
*
|
||||||
|
* \param v Vector2 to hash
|
||||||
|
*/
|
||||||
|
std::size_t operator()(const Nz::Vector2<T>& v) const
|
||||||
|
{
|
||||||
|
std::size_t seed {};
|
||||||
|
|
||||||
|
Nz::HashCombine(seed, v.x);
|
||||||
|
Nz::HashCombine(seed, v.y);
|
||||||
|
|
||||||
|
return seed;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
#undef F
|
#undef F
|
||||||
|
|
||||||
#include <Nazara/Core/DebugOff.hpp>
|
#include <Nazara/Core/DebugOff.hpp>
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@
|
||||||
#define NAZARA_VECTOR3_HPP
|
#define NAZARA_VECTOR3_HPP
|
||||||
|
|
||||||
#include <Nazara/Core/String.hpp>
|
#include <Nazara/Core/String.hpp>
|
||||||
|
#include <functional>
|
||||||
|
|
||||||
namespace Nz
|
namespace Nz
|
||||||
{
|
{
|
||||||
|
|
@ -141,6 +142,11 @@ template<typename T> std::ostream& operator<<(std::ostream& out, const Nz::Vecto
|
||||||
template<typename T> Nz::Vector3<T> operator*(T scale, const Nz::Vector3<T>& vec);
|
template<typename T> Nz::Vector3<T> operator*(T scale, const Nz::Vector3<T>& vec);
|
||||||
template<typename T> Nz::Vector3<T> operator/(T scale, const Nz::Vector3<T>& vec);
|
template<typename T> Nz::Vector3<T> operator/(T scale, const Nz::Vector3<T>& vec);
|
||||||
|
|
||||||
|
namespace std
|
||||||
|
{
|
||||||
|
template<class T> struct hash<Nz::Vector3<T>>;
|
||||||
|
}
|
||||||
|
|
||||||
#include <Nazara/Math/Vector3.inl>
|
#include <Nazara/Math/Vector3.inl>
|
||||||
|
|
||||||
#endif // NAZARA_VECTOR3_HPP
|
#endif // NAZARA_VECTOR3_HPP
|
||||||
|
|
|
||||||
|
|
@ -1347,6 +1347,31 @@ Nz::Vector3<T> operator/(T scale, const Nz::Vector3<T>& vec)
|
||||||
return Nz::Vector3<T>(scale / vec.x, scale / vec.y, scale / vec.z);
|
return Nz::Vector3<T>(scale / vec.x, scale / vec.y, scale / vec.z);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace std
|
||||||
|
{
|
||||||
|
template<class T>
|
||||||
|
struct hash<Nz::Vector3<T>>
|
||||||
|
{
|
||||||
|
/*!
|
||||||
|
* \brief Specialisation of std to hash
|
||||||
|
* \return Result of the hash
|
||||||
|
*
|
||||||
|
* \param v Vector3 to hash
|
||||||
|
*/
|
||||||
|
|
||||||
|
std::size_t operator()(const Nz::Vector3<T>& v) const
|
||||||
|
{
|
||||||
|
std::size_t seed {};
|
||||||
|
|
||||||
|
Nz::HashCombine(seed, v.x);
|
||||||
|
Nz::HashCombine(seed, v.y);
|
||||||
|
Nz::HashCombine(seed, v.z);
|
||||||
|
|
||||||
|
return seed;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
#undef F
|
#undef F
|
||||||
|
|
||||||
#include <Nazara/Core/DebugOff.hpp>
|
#include <Nazara/Core/DebugOff.hpp>
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@
|
||||||
#define NAZARA_VECTOR4_HPP
|
#define NAZARA_VECTOR4_HPP
|
||||||
|
|
||||||
#include <Nazara/Core/String.hpp>
|
#include <Nazara/Core/String.hpp>
|
||||||
|
#include <functional>
|
||||||
|
|
||||||
namespace Nz
|
namespace Nz
|
||||||
{
|
{
|
||||||
|
|
@ -117,6 +118,11 @@ template<typename T> std::ostream& operator<<(std::ostream& out, const Nz::Vecto
|
||||||
template<typename T> Nz::Vector4<T> operator*(T scale, const Nz::Vector4<T>& vec);
|
template<typename T> Nz::Vector4<T> operator*(T scale, const Nz::Vector4<T>& vec);
|
||||||
template<typename T> Nz::Vector4<T> operator/(T scale, const Nz::Vector4<T>& vec);
|
template<typename T> Nz::Vector4<T> operator/(T scale, const Nz::Vector4<T>& vec);
|
||||||
|
|
||||||
|
namespace std
|
||||||
|
{
|
||||||
|
template<class T> struct hash<Nz::Vector4<T>>;
|
||||||
|
}
|
||||||
|
|
||||||
#include <Nazara/Math/Vector4.inl>
|
#include <Nazara/Math/Vector4.inl>
|
||||||
|
|
||||||
#endif // NAZARA_VECTOR4_HPP
|
#endif // NAZARA_VECTOR4_HPP
|
||||||
|
|
|
||||||
|
|
@ -1120,6 +1120,31 @@ Nz::Vector4<T> operator/(T scale, const Nz::Vector4<T>& vec)
|
||||||
return Nz::Vector4<T>(scale / vec.x, scale / vec.y, scale / vec.z, scale / vec.w);
|
return Nz::Vector4<T>(scale / vec.x, scale / vec.y, scale / vec.z, scale / vec.w);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace std
|
||||||
|
{
|
||||||
|
template<class T>
|
||||||
|
struct hash<Nz::Vector4<T>>
|
||||||
|
{
|
||||||
|
/*!
|
||||||
|
* \brief Specialisation of std to hash
|
||||||
|
* \return Result of the hash
|
||||||
|
*
|
||||||
|
* \param v Vector4 to hash
|
||||||
|
*/
|
||||||
|
std::size_t operator()(const Nz::Vector4<T>& v) const
|
||||||
|
{
|
||||||
|
std::size_t seed {};
|
||||||
|
|
||||||
|
Nz::HashCombine(seed, v.x);
|
||||||
|
Nz::HashCombine(seed, v.y);
|
||||||
|
Nz::HashCombine(seed, v.z);
|
||||||
|
Nz::HashCombine(seed, v.w);
|
||||||
|
|
||||||
|
return seed;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
#undef F
|
#undef F
|
||||||
|
|
||||||
#include <Nazara/Core/DebugOff.hpp>
|
#include <Nazara/Core/DebugOff.hpp>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue