BLI: Add hash function to quaternion type
Just reuse the 4D vector hash. This allows creating a CPPType for math::Quaternion.
This commit is contained in:
parent
04422064fb
commit
65d8cfd82d
@ -162,6 +162,11 @@ template<typename T> struct QuaternionBase {
|
|||||||
return (a.w == b.w) && (a.x == b.x) && (a.y == b.y) && (a.z == b.z);
|
return (a.w == b.w) && (a.x == b.x) && (a.y == b.y) && (a.z == b.z);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint64_t hash() const
|
||||||
|
{
|
||||||
|
return VecBase<T, 4>(*this).hash();
|
||||||
|
}
|
||||||
|
|
||||||
friend std::ostream &operator<<(std::ostream &stream, const QuaternionBase &rot)
|
friend std::ostream &operator<<(std::ostream &stream, const QuaternionBase &rot)
|
||||||
{
|
{
|
||||||
return stream << "Quaternion" << static_cast<VecBase<T, 4>>(rot);
|
return stream << "Quaternion" << static_cast<VecBase<T, 4>>(rot);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user