179 return m_x * _v.m_x +
m_y * _v.m_y;
void operator*=(Real _v) noexcept
multiply this Vec2 components by a scalar
Real & operator[](int _i) noexcept
[] index operator to access the index component of the Vec2
simple Vec2 encapsulates a 3 float object like glsl Vec2 but not maths use the Vec2 class for maths a...
bool operator==(const Vec2 &_v) const noexcept
check for equality uses FCompare (from Util.h) as float values
Vec2 operator/(Real _v) const noexcept
divide Vec2 components by a scalar
Vec2 operator+(const Vec2 &_v) const noexcept
operator add Vec2+Vec2
Vec2 & operator=(const Vec2 &_v) noexcept
assignment operator set the current Vec2 to rhs
Real m_x
x component of the Vec2
Real dot(const Vec2 &_b) const noexcept
return this dotted with _b
implementation files for RibExport class
PRECISION Real
create a variable called Real which is the main data type we use (GLfloat for most cases) ...
encapsulates a 4d Homogenous Point / Vector object
#define FCompare(a, b)
FCompare macro used for floating point comparision functions.
void set(Real _x, Real _y) noexcept
sets the Vec2 component from 3 values
a simple 2 tuple container for compatibility with glsl
Real m_y
y component of the Vec2
void normalize() noexcept
Normalize the vector using .
void operator/=(Real _v) noexcept
divide this Vec2 components by a scalar
void operator+=(const Vec2 &_v) noexcept
+= operator add Vec2 v to current Vec2
Vec2(const Vec2 &_v) noexcept
copy ctor
bool operator!=(const Vec2 &_v) const noexcept
not equal check
void operator-=(const Vec2 &_v) noexcept
-= operator this-=v
#define NGL_ASSERT(X)
re-define the standard assert to work for ngl first check to see if assert is defined and undef it th...
Vec2 operator-() const noexcept
negate the Vec2 components
Real lengthSquared() const noexcept
returns the length squared of the vector (no sqrt so quicker)
Real length() const noexcept
returns the length of the vector
Vec2 operator*(const Real &_i) const noexcept
this * i for each element
re impliment asserts so we don't exit on failure
void null() noexcept
clears the Vec2 to 0,0,0