59 void set(
Real _x,
Real _y ) noexcept;
65 void set(
const Vec2& _v ) noexcept;
70 void set(
const Vec4& _v) noexcept;
76 void set(
const Vec2* _v) noexcept;
105 void null() noexcept;
110 Real& operator[](
int _i ) noexcept;
123 void operator+=(
const Vec2 &_v ) noexcept;
129 void operator-=(
const Vec2& _v ) noexcept;
146 Real lengthSquared()
const noexcept;
154 Vec2 operator +(
const Vec2 &_v )
const noexcept;
161 Vec2 operator/(
Real _v )
const noexcept;
168 void operator/=(
Real _v ) noexcept;
174 void operator*=(
Real _v ) noexcept;
180 Vec2 operator-(
const Vec2& _v )
const noexcept;
194 Vec2 &operator =(
const Vec2 &_v ) noexcept;
199 Vec2 operator-()
const noexcept;
211 bool operator!=(
const Vec2 &_v )
const noexcept;
217 Vec2 operator/(
const Vec2& _v )
const noexcept;
229 void normalize() noexcept;
235 Real dot(
const Vec2 &_b )
const noexcept;
247 #ifndef BUILDING_DOCS 262 #ifndef BUILDING_DOCS 274 #ifndef BUILDING_DOCS 288 return Vec2(_k*_v.m_x, _k*_v.m_y);
bool operator==(const ngl::Mat3 &_m1, const ngl::Mat3 &_m2)
simple Vec2 encapsulates a 3 float object like glsl Vec2 but not maths use the Vec2 class for maths a...
simple Vector class for OpenGL graphics, contains overloaded operators for most math functions...
main definition of types and namespace
std::array< Real, 2 > m_openGL
array of four floats mapped to the x,y,z,w components of the Vec2 useful for openGL fv data types thi...
Real m_x
x component of the Vec2
Vec2(Real _x=0.0, Real _y=0.0) noexcept
initialise the constructor from 3 or 4 Real
implementation files for RibExport class
GLuint GLsizei GLsizei * length
PRECISION Real
create a variable called Real which is the main data type we use (GLfloat for most cases) ...
Real m_y
y component of the Vec2
Vec2(const Vec2 &_v) noexcept
copy ctor
Vec2(Real _x) noexcept
ctor using a single float all components are set to the value _x
Vec2 operator*(Real _k, const Vec2 &_v) noexcept
scalar * vector operator
Real * openGL() noexcept
accesor to the m_openGL matrix returns the address of the 0th element
const Real & operator[](int _i) const noexcept
[] index operator to access the index component of the Vec2