Added linear interpolation (Lerp) to math module
Former-commit-id: 5920e21f25d42701a1895734eca492fdf5351669
This commit is contained in:
@@ -20,28 +20,28 @@ class NzCube
|
||||
NzCube(const T cube[6]);
|
||||
NzCube(const NzRect<T>& rect);
|
||||
NzCube(const NzVector3<T>& vec1, const NzVector3<T>& vec2);
|
||||
template<typename U> explicit NzCube(const NzCube<U>& rect);
|
||||
NzCube(const NzCube& rect) = default;
|
||||
template<typename U> explicit NzCube(const NzCube<U>& cube);
|
||||
NzCube(const NzCube& cube) = default;
|
||||
~NzCube() = default;
|
||||
|
||||
bool Contains(T X, T Y, T Z) const;
|
||||
bool Contains(const NzVector3<T>& point) const;
|
||||
bool Contains(const NzCube& rect) const;
|
||||
bool Contains(const NzCube& cube) const;
|
||||
|
||||
void ExtendTo(const NzVector3<T>& point);
|
||||
void ExtendTo(const NzCube& rect);
|
||||
void ExtendTo(const NzCube& cube);
|
||||
|
||||
NzVector3<T> GetCenter() const;
|
||||
|
||||
bool Intersect(const NzCube& rect, NzCube* intersection = nullptr) const;
|
||||
bool Intersect(const NzCube& cube, NzCube* intersection = nullptr) const;
|
||||
|
||||
bool IsValid() const;
|
||||
|
||||
void Set(T X, T Y, T Z, T Width, T Height, T Depth);
|
||||
void Set(const T rect[6]);
|
||||
void Set(const T cube[6]);
|
||||
void Set(const NzRect<T>& rect);
|
||||
void Set(const NzVector3<T>& vec1, const NzVector3<T>& vec2);
|
||||
template<typename U> void Set(const NzCube<U>& rect);
|
||||
template<typename U> void Set(const NzCube<U>& cube);
|
||||
|
||||
NzString ToString() const;
|
||||
|
||||
@@ -50,6 +50,8 @@ class NzCube
|
||||
T& operator[](unsigned int i);
|
||||
T operator[](unsigned int i) const;
|
||||
|
||||
static NzCube Lerp(const NzCube& from, const NzCube& to, T interpolation);
|
||||
|
||||
T x, y, z, width, height, depth;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user