OGLplus (0.52.0) a C++ wrapper for OpenGL

oglplus::VectorBase< T, N > Class Template Reference

Common base class for vectors. More...

#include </home/chochlik/devel/oglplus/include/oglplus/math/vector.hpp>

Inheritance diagram for oglplus::VectorBase< T, N >:

Public Member Functions

TData (void)
 Pointer to the components of this vector.
 
const TData (void) const
 Pointer to the components of this vector.
 
T At (std::size_t i) const
 Access to the i-th component of this vector. More...
 
T At (std::size_t i, T fallback) const
 Access to the i-th component of this vector with a fallback. More...
 
Toperator[] (std::size_t i)
 Access to the i-th component of this vector. More...
 
const Toperator[] (std::size_t i) const
 Const access to the i-th component of this vector. More...
 
void Add (const VectorBase &v)
 Adds v to this vector.
 
void Subtract (const VectorBase &v)
 Subtracts v from this vector.
 
void Multiply (T v)
 Multiplies this vector by a scalar value.
 
void Multiply (const VectorBase &that)
 Multiplies the elements of this and that vector.
 
void Divide (T v)
 Divides this vector by a scalar value.
 
void Divide (const VectorBase &that)
 Divides the elements of this and that vector.
 
T Length (void) const
 Returns the lenght of this vector.
 
bool IsNormal (T eps=T(0)) const
 Returns true if the vector is normal.
 
void Normalize (void)
 Normalizes this vector.
 

Static Public Member Functions

static std::size_t Size (void)
 The size (the number of components) of this vector.
 
static T DotProduct (const VectorBase &a, const VectorBase &b)
 Computes the dot product of vectors a and b.
 

Friends

bool Equal (const VectorBase &a, const VectorBase &b)
 Equality comparison.
 

Detailed Description

template<typename T, std::size_t N>
class oglplus::VectorBase< T, N >

Common base class for vectors.

Member Function Documentation

template<typename T, std::size_t N>
T oglplus::VectorBase< T, N >::At ( std::size_t  i) const

Access to the i-th component of this vector.

Precondition
(i < Size())
template<typename T, std::size_t N>
T oglplus::VectorBase< T, N >::At ( std::size_t  i,
T  fallback 
) const

Access to the i-th component of this vector with a fallback.

Similar to At(i), but returns fallback if i is greater than or equal to Size().

template<typename T, std::size_t N>
T& oglplus::VectorBase< T, N >::operator[] ( std::size_t  i)

Access to the i-th component of this vector.

Precondition
(i < Size())
template<typename T, std::size_t N>
const T& oglplus::VectorBase< T, N >::operator[] ( std::size_t  i) const

Const access to the i-th component of this vector.

Precondition
(i < Size())

The documentation for this class was generated from the following file:
  • /home/chochlik/devel/oglplus/include/oglplus/math/vector.hpp

Copyright © 2010-2014 Matúš Chochlík, University of Žilina, Žilina, Slovakia.
<matus.chochlik -at- fri.uniza.sk>
<chochlik -at -gmail.com>
Documentation generated on Mon Sep 22 2014 by Doxygen (version 1.8.6).