71 m_x(_x),m_y(_y),m_z(_z){}
83 void set(
const Vec3& _v) noexcept;
88 void set(
const Vec4& _v) noexcept;
94 Real dot(
const Vec3 &_b )
const noexcept;
103 Real& operator[](
size_t & _i ) noexcept;
116 void normalize() noexcept;
122 Real inner(
const Vec3& _v)
const noexcept;
129 Mat3 outer(
const Vec3 &_v)
const noexcept;
139 Real lengthSquared()
const noexcept;
144 void operator+=(
const Vec3& _v ) noexcept;
149 void operator-=(
const Vec3& _v ) noexcept;
161 Vec3 operator +(
const Vec3 &_v )
const noexcept;
167 Vec3 operator/(
Real _v )
const noexcept;
173 void operator/=(
Real _v ) noexcept;
179 void operator*=(
Real _v ) noexcept;
185 Vec3 operator-(
const Vec3 &_v )
const noexcept;
197 Vec3 &operator =(
const Vec3 &_v )=
default;
203 Vec3 &operator =(
const Vec4 &_v ) noexcept;
209 Vec3 &operator =(
Real _v ) noexcept;
219 Vec3 operator-()
const noexcept;
231 bool operator!=(
const Vec3 &_v )
const noexcept;
237 Vec3 operator/(
const Vec3& _v )
const noexcept;
243 void cross(
const Vec3& _v1,
const Vec3& _v2 ) noexcept;
249 Vec3 cross(
const Vec3& _b )
const noexcept;
255 void clamp(
float _min,
float _max) noexcept;
260 void clamp(
float _max) noexcept;
266 Vec3 reflect(
const Vec3 & _n)
const noexcept;
343 return Vec3(_k*_v.m_x, _k*_v.m_y, _k*_v.m_z);
bool operator==(const ngl::Mat3 &_m1, const ngl::Mat3 &_m2)
Mat3 basic 3x3 matrix for certain glsl ops.
static Vec3 right()
simple static method to return X right vector
simple Vector class for OpenGL graphics, contains overloaded operators for most math functions...
main definition of types and namespace
static Vec3 in()
simple static method to return Z out vector
Vec3()
default ctor use default and set to (0.0f,0.0f,0.0f) as attributes are initialised ...
simple Vec3 encapsulates a 3 float object like glsl vec3 but not maths use the Vec3 class for maths a...
implementation files for RibExport class
Real * openGL() noexcept
accesor to the m_openGL array returns the address of the 0th element
GLuint GLsizei GLsizei * length
PRECISION Real
create a variable called Real which is the main data type we use (GLfloat for most cases) ...
std::array< Real, 3 > m_openGL
array of four floats mapped to the x,y,z,w components of the Vec3 useful for openGL fv data types thi...
static Vec3 left()
simple static method to return X left vector
static Vec3 up()
simple static method to return Y up vector
Vec2 operator*(Real _k, const Vec2 &_v) noexcept
scalar * vector operator
const Real & operator[](size_t &_i) const noexcept
[] index operator to access the index component of the Vec3
static Vec3 zero()
simple static method to return zero vector
static Vec3 out()
simple static method to return Z in vector
static Vec3 down()
simple static method to return Y down vector
Vec3(Real _x, Real _y, Real _z) noexcept
initialise the constructor from 3 floats