Vec2<T> class¶
<oceansdk/math/vec2.h>
Description¶
This class allows manipulating 2D vectors and passing them through the SDK Interface functions
Namespace¶
This class is in the root namespace
Public members¶
-
template<typename T>
class Vec2¶ - Template Parameters
T – The underlying numeric type, should be
float
ordouble
-
Vec2()¶
Constructs a Vec2 with uninitialized values
-
const T &operator[](int i) const¶
Returns a const reference to the ith coordinate. i should be 0, 1 or 2
-
Vec2<T> &operator+=(const Vec2<T> &other) const¶
Adds other to this vector and returns a reference to this vector
-
Vec2<T> &operator*=(T scalar) const¶
Multiplies this vector by scalar and returns a reference to this vector
-
bool operator!=(const Vec2<T> &other) const¶
Returns true if this and other have not all coordinates equal, false otherwise
-
bool operator==(const Vec2<T> &other) const¶
Returns true if this and other have all coordinates equal, false otherwise
-
bool isFinite() const¶
Returns true if this vector coordinates are all finite (not NaN or inf)
-
template<typename U>
Vec2<U> toVec2() const¶ Converts a Vec2<T> to a Vec2<U> by casting coordinates from T to U
-
std::string toString() const¶
Converts the vector to a string with space separated values