12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- #pragma once
- #include <Mathematics/Vector.h>
- namespace WwiseGTE
- {
- template <int N, typename Real>
- class Hypersphere
- {
- public:
-
-
- Hypersphere()
- :
- radius((Real)1)
- {
- center.MakeZero();
- }
- Hypersphere(Vector<N, Real> const& inCenter, Real inRadius)
- :
- center(inCenter),
- radius(inRadius)
- {
- }
-
- Vector<N, Real> center;
- Real radius;
- public:
-
- bool operator==(Hypersphere const& hypersphere) const
- {
- return center == hypersphere.center && radius == hypersphere.radius;
- }
- bool operator!=(Hypersphere const& hypersphere) const
- {
- return !operator==(hypersphere);
- }
- bool operator< (Hypersphere const& hypersphere) const
- {
- if (center < hypersphere.center)
- {
- return true;
- }
- if (center > hypersphere.center)
- {
- return false;
- }
- return radius < hypersphere.radius;
- }
- bool operator<=(Hypersphere const& hypersphere) const
- {
- return !hypersphere.operator<(*this);
- }
- bool operator> (Hypersphere const& hypersphere) const
- {
- return hypersphere.operator<(*this);
- }
- bool operator>=(Hypersphere const& hypersphere) const
- {
- return !operator<(hypersphere);
- }
- };
-
- template <typename Real>
- using Circle2 = Hypersphere<2, Real>;
- template <typename Real>
- using Sphere3 = Hypersphere<3, Real>;
- }
|