27 : v{ other[0], other[1], other[2] } {}
45 return (v[0] + v[1] + v[2]) / 3._f;
50 const Vector v12 = v[2] - v[1];
51 const Vector v02 = v[2] - v[0];
57 const Vector v12 = v[2] - v[1];
58 const Vector v02 = v[2] - v[0];
64 for (
Size i = 0; i < 3; ++i) {
74 const Vector v12 = v[2] - v[1];
75 const Vector v02 = v[2] - v[0];
INLINE bool isReal(const AntisymmetricTensor &t)
#define SPH_ASSERT(x,...)
Object representing a three-dimensional axis-aligned box.
uint32_t Size
Integral type used to index arrays (by default).
double Float
Precision used withing the code. Use Float instead of float or double where precision is important.
constexpr INLINE T sqr(const T &f) noexcept
Return a squared value.
#define INLINE
Macros for conditional compilation based on selected compiler.
#define NAMESPACE_SPH_END
INLINE Float getLength(const Vector &v)
Returns the length of the vector. Enabled only for vectors of floating-point precision.
INLINE Float getSqrLength(const Vector &v)
INLINE BasicVector< float > cross(const BasicVector< float > &v1, const BasicVector< float > &v2)
Cross product between two vectors.
INLINE float dot(const BasicVector< float > &v1, const BasicVector< float > &v2)
Make sure the vector is trivially constructible and destructible, needed for fast initialization of a...
INLINE Vector getNormalized(const Vector &v)
Helper object defining three-dimensional interval (box).
INLINE void extend(const Vector &v)
Enlarges the box to contain the vector.
Array with fixed number of allocated elements.
Triangle(const Vector &v1, const Vector &v2, const Vector &v3)
INLINE const Vector & operator[](const Size idx) const
INLINE Vector & operator[](const Size idx)
Triangle(const Triangle &other)
INLINE bool isValid() const
Triangle & operator=(const Triangle &other)
INLINE Box getBBox() const
INLINE Vector normal() const
INLINE Vector center() const
INLINE Float area() const