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
>
classVec2
¶ - 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 tothis
vector
-
Vec2<T> &
operator*=
(T scalar) const¶ Multiplies
this
vector byscalar
and returns a reference tothis
vector
-
bool
operator!=
(const Vec2<T> &other) const¶ Returns
true
ifthis
andother
have not all coordinates equal,false
otherwise
-
bool
operator==
(const Vec2<T> &other) const¶ Returns
true
ifthis
andother
have all coordinates equal,false
otherwise
-
bool
isFinite
() const¶ Returns
true
ifthis
vector coordinates are all finite (not NaN or inf)
-
template<typename
U
>
Vec2<U>toVec2
() const¶ Converts a
Vec2<T>
to aVec2<U>
by casting coordinates fromT
toU
-
std::string
toString
() const¶ Converts the vector to a string with space separated values