Visualization Library v1.0.3A lightweight C++ OpenGL middleware for 2D/3D graphics |
[Download] [Tutorials] [All Classes] [Grouped Classes] |
The Vector2 class is a template class that implements a generic 2 components vector, see also vl::fvec2, vl::dvec2, vl::uvec2, vl::ivec2, vl::svec2, vl::usvec2, vl::bvec2, vl::ubvec2. More...
#include <Vector2.hpp>
Public Types | |
typedef T_Scalar | scalar_type |
Public Member Functions | |
Vector2 (const Vector2 &other) | |
Vector2 () | |
template<class T > | |
Vector2 (const T &other) | |
Vector2 (T_Scalar x, T_Scalar y) | |
T_Scalar * | ptr () |
const T_Scalar * | ptr () const |
const T_Scalar & | x () const |
const T_Scalar & | y () const |
T_Scalar & | x () |
T_Scalar & | y () |
const T_Scalar & | r () const |
const T_Scalar & | g () const |
T_Scalar & | r () |
T_Scalar & | g () |
const T_Scalar & | s () const |
const T_Scalar & | t () const |
T_Scalar & | s () |
T_Scalar & | t () |
Vector2 | operator+ (const Vector2 &other) const |
Vector2 | operator- (const Vector2 &other) const |
Vector2 | operator* (const Vector2 &other) const |
Vector2 | operator/ (const Vector2 &other) const |
Vector2 | operator+ (T_Scalar val) const |
Vector2 | operator- (T_Scalar val) const |
Vector2 | operator* (T_Scalar val) const |
Vector2 | operator/ (T_Scalar val) const |
Vector2 | operator- () const |
Vector2 & | operator+= (const Vector2 &other) |
Vector2 & | operator-= (const Vector2 &other) |
Vector2 & | operator*= (const Vector2 &other) |
Vector2 & | operator/= (const Vector2 &other) |
Vector2 & | operator+= (T_Scalar val) |
Vector2 & | operator-= (T_Scalar val) |
Vector2 & | operator*= (T_Scalar val) |
Vector2 & | operator/= (T_Scalar val) |
Vector2 & | operator= (const Vector2 &other) |
Vector2 & | operator= (T_Scalar val) |
bool | operator== (const Vector2 &other) const |
bool | operator!= (const Vector2 &other) const |
bool | operator< (const Vector2 &other) const |
T_Scalar & | operator[] (unsigned i) |
const T_Scalar & | operator[] (unsigned i) const |
T_Scalar | length () const |
T_Scalar | lengthSquared () const |
bool | isNull () const |
const Vector2 & | normalize (T_Scalar *len=NULL) |
template<> | |
half | length () const |
template<> | |
half | lengthSquared () const |
Static Public Attributes | |
static const int | scalar_count = 2 |
Protected Attributes | |
T_Scalar | mScalar [scalar_count] |
The Vector2 class is a template class that implements a generic 2 components vector, see also vl::fvec2, vl::dvec2, vl::uvec2, vl::ivec2, vl::svec2, vl::usvec2, vl::bvec2, vl::ubvec2.
Definition at line 97 of file Vector2.hpp.
typedef T_Scalar vl::Vector2< T_Scalar >::scalar_type |
Definition at line 100 of file Vector2.hpp.
vl::Vector2< T_Scalar >::Vector2 | ( | const Vector2< T_Scalar > & | other ) | [inline] |
Definition at line 102 of file Vector2.hpp.
vl::Vector2< T_Scalar >::Vector2 | ( | ) | [inline] |
Definition at line 103 of file Vector2.hpp.
Referenced by vl::Vector2< int >::operator*(), vl::Vector2< int >::operator+(), vl::Vector2< int >::operator-(), and vl::Vector2< int >::operator/().
vl::Vector2< T_Scalar >::Vector2 | ( | const T & | other ) | [inline, explicit] |
Definition at line 106 of file Vector2.hpp.
vl::Vector2< T_Scalar >::Vector2 | ( | T_Scalar | x, |
T_Scalar | y | ||
) | [inline, explicit] |
Definition at line 112 of file Vector2.hpp.
T_Scalar* vl::Vector2< T_Scalar >::ptr | ( | ) | [inline] |
Definition at line 118 of file Vector2.hpp.
Referenced by vl::PatchParameter::apply(), vl::Array< bvec2, GLbyte, 2, GL_BYTE >::getAsVec2(), vl::Uniform::getUniform(), vl::GLSLProgram::getUniform(), and vl::Uniform::setUniform().
const T_Scalar* vl::Vector2< T_Scalar >::ptr | ( | ) | const [inline] |
Definition at line 119 of file Vector2.hpp.
const T_Scalar& vl::Vector2< T_Scalar >::x | ( | ) | const [inline] |
Definition at line 121 of file Vector2.hpp.
Referenced by vl::abs(), vl::acos(), vl::acosh(), vl::RectF::addPoint(), vl::all(), vl::any(), vl::asin(), vl::asinh(), vl::atan(), vl::atanh(), vl::ceil(), vl::Geometry::computeTangentSpace(), vl::Image::copySubImage(), vl::cos(), vl::cosh(), vl::degrees(), vl::dot(), vl::GhostCameraManipulator::enableEvent(), vl::equal(), vl::exp(), vl::exp2(), vl::floor(), vl::Matrix3< T_Scalar >::getScaling(), vl::Matrix3< T_Scalar >::getT(), vl::Matrix3< T_Scalar >::getTranslation(), vl::Matrix3< T_Scalar >::getX(), vl::Matrix3< T_Scalar >::getY(), vl::greaterThan(), vl::greaterThanEqual(), vl::inversesqrt(), vl::isinf(), vl::isnan(), vl::Vector2< int >::isNull(), vl::Vector2< int >::length(), vl::Vector2< int >::lengthSquared(), vl::lessThan(), vl::lessThanEqual(), vl::log(), vl::log10(), vl::log2(), vl::max(), vl::min(), vl::mix(), vl::modf(), vl::TrackballManipulator::mouseDownEvent(), vl::FlatManipulator::mouseDownEvent(), vl::TrackballManipulator::mouseMoveEvent(), vl::GhostCameraManipulator::mouseMoveEvent(), vl::FlatManipulator::mouseMoveEvent(), vl::notEqual(), vl::Vector2< int >::operator*(), vl::operator*(), vl::Vector2< int >::operator+(), vl::Vector2< int >::operator-(), vl::Vector2< int >::operator/(), vl::Vector2< int >::operator<(), vl::Vector2< int >::operator=(), vl::Vector2< int >::operator==(), vl::pow(), vl::radians(), vl::Text::rawboundingRect(), vl::CoreText::rawboundingRect(), vl::DrawPixels::render_Implementation(), vl::Text::renderText(), vl::CoreText::renderText(), vl::round(), vl::roundEven(), vl::Matrix3< T_Scalar >::scale(), vl::Matrix3< T_Scalar >::setT(), vl::Matrix3< T_Scalar >::setX(), vl::Matrix3< T_Scalar >::setY(), vl::sign(), vl::sin(), vl::sinh(), vl::smoothstep(), vl::sqrt(), vl::step(), vl::tan(), vl::tanh(), vl::TrackballManipulator::trackballRotation(), vl::trunc(), vl::Vector2< int >::Vector2(), vl::Vector3< int >::Vector3(), vl::Vector4< unsigned int >::Vector4(), and vl::vlx_toValue().
const T_Scalar& vl::Vector2< T_Scalar >::y | ( | ) | const [inline] |
Definition at line 122 of file Vector2.hpp.
Referenced by vl::abs(), vl::acos(), vl::acosh(), vl::RectF::addPoint(), vl::all(), vl::any(), vl::asin(), vl::asinh(), vl::atan(), vl::atanh(), vl::ceil(), vl::Geometry::computeTangentSpace(), vl::Image::copySubImage(), vl::cos(), vl::cosh(), vl::degrees(), vl::dot(), vl::equal(), vl::exp(), vl::exp2(), vl::floor(), vl::Matrix3< T_Scalar >::getScaling(), vl::Matrix3< T_Scalar >::getT(), vl::Matrix3< T_Scalar >::getTranslation(), vl::Matrix3< T_Scalar >::getX(), vl::Matrix3< T_Scalar >::getY(), vl::greaterThan(), vl::greaterThanEqual(), vl::inversesqrt(), vl::isinf(), vl::isnan(), vl::Vector2< int >::isNull(), vl::Vector2< int >::length(), vl::Vector2< int >::lengthSquared(), vl::lessThan(), vl::lessThanEqual(), vl::log(), vl::log10(), vl::log2(), vl::max(), vl::min(), vl::mix(), vl::modf(), vl::TrackballManipulator::mouseDownEvent(), vl::FlatManipulator::mouseDownEvent(), vl::TrackballManipulator::mouseMoveEvent(), vl::FlatManipulator::mouseMoveEvent(), vl::notEqual(), vl::Vector2< int >::operator*(), vl::operator*(), vl::Vector2< int >::operator+(), vl::Vector2< int >::operator-(), vl::Vector2< int >::operator/(), vl::Vector2< int >::operator<(), vl::Vector2< int >::operator=(), vl::Vector2< int >::operator==(), vl::pow(), vl::radians(), vl::Text::rawboundingRect(), vl::CoreText::rawboundingRect(), vl::DrawPixels::render_Implementation(), vl::Text::renderText(), vl::CoreText::renderText(), vl::round(), vl::roundEven(), vl::Matrix3< T_Scalar >::scale(), vl::Matrix3< T_Scalar >::setT(), vl::Matrix3< T_Scalar >::setX(), vl::Matrix3< T_Scalar >::setY(), vl::sign(), vl::sin(), vl::sinh(), vl::smoothstep(), vl::sqrt(), vl::step(), vl::tan(), vl::tanh(), vl::TrackballManipulator::trackballRotation(), vl::trunc(), vl::Vector2< int >::Vector2(), vl::Vector3< int >::Vector3(), vl::Vector4< unsigned int >::Vector4(), and vl::vlx_toValue().
T_Scalar& vl::Vector2< T_Scalar >::x | ( | ) | [inline] |
Definition at line 124 of file Vector2.hpp.
T_Scalar& vl::Vector2< T_Scalar >::y | ( | ) | [inline] |
Definition at line 125 of file Vector2.hpp.
const T_Scalar& vl::Vector2< T_Scalar >::r | ( | ) | const [inline] |
Definition at line 127 of file Vector2.hpp.
const T_Scalar& vl::Vector2< T_Scalar >::g | ( | ) | const [inline] |
Definition at line 128 of file Vector2.hpp.
T_Scalar& vl::Vector2< T_Scalar >::r | ( | ) | [inline] |
Definition at line 130 of file Vector2.hpp.
T_Scalar& vl::Vector2< T_Scalar >::g | ( | ) | [inline] |
Definition at line 131 of file Vector2.hpp.
const T_Scalar& vl::Vector2< T_Scalar >::s | ( | ) | const [inline] |
Definition at line 133 of file Vector2.hpp.
Referenced by vl::makeGrid(), vl::A3DSVertex::operator<(), and vl::A3DSLoader::read_TRIANGULAR_MESH().
const T_Scalar& vl::Vector2< T_Scalar >::t | ( | ) | const [inline] |
Definition at line 134 of file Vector2.hpp.
Referenced by vl::makeGrid(), vl::A3DSVertex::operator<(), and vl::A3DSLoader::read_TRIANGULAR_MESH().
T_Scalar& vl::Vector2< T_Scalar >::s | ( | ) | [inline] |
Definition at line 136 of file Vector2.hpp.
T_Scalar& vl::Vector2< T_Scalar >::t | ( | ) | [inline] |
Definition at line 137 of file Vector2.hpp.
Vector2 vl::Vector2< T_Scalar >::operator+ | ( | const Vector2< T_Scalar > & | other ) | const [inline] |
Definition at line 139 of file Vector2.hpp.
Vector2 vl::Vector2< T_Scalar >::operator- | ( | const Vector2< T_Scalar > & | other ) | const [inline] |
Definition at line 143 of file Vector2.hpp.
Vector2 vl::Vector2< T_Scalar >::operator* | ( | const Vector2< T_Scalar > & | other ) | const [inline] |
Definition at line 147 of file Vector2.hpp.
Vector2 vl::Vector2< T_Scalar >::operator/ | ( | const Vector2< T_Scalar > & | other ) | const [inline] |
Definition at line 151 of file Vector2.hpp.
Vector2 vl::Vector2< T_Scalar >::operator+ | ( | T_Scalar | val ) | const [inline] |
Definition at line 155 of file Vector2.hpp.
Vector2 vl::Vector2< T_Scalar >::operator- | ( | T_Scalar | val ) | const [inline] |
Definition at line 159 of file Vector2.hpp.
Vector2 vl::Vector2< T_Scalar >::operator* | ( | T_Scalar | val ) | const [inline] |
Definition at line 163 of file Vector2.hpp.
Vector2 vl::Vector2< T_Scalar >::operator/ | ( | T_Scalar | val ) | const [inline] |
Definition at line 167 of file Vector2.hpp.
Vector2 vl::Vector2< T_Scalar >::operator- | ( | ) | const [inline] |
Definition at line 171 of file Vector2.hpp.
Vector2& vl::Vector2< T_Scalar >::operator+= | ( | const Vector2< T_Scalar > & | other ) | [inline] |
Definition at line 175 of file Vector2.hpp.
Vector2& vl::Vector2< T_Scalar >::operator-= | ( | const Vector2< T_Scalar > & | other ) | [inline] |
Definition at line 180 of file Vector2.hpp.
Vector2& vl::Vector2< T_Scalar >::operator*= | ( | const Vector2< T_Scalar > & | other ) | [inline] |
Definition at line 185 of file Vector2.hpp.
Vector2& vl::Vector2< T_Scalar >::operator/= | ( | const Vector2< T_Scalar > & | other ) | [inline] |
Definition at line 190 of file Vector2.hpp.
Vector2& vl::Vector2< T_Scalar >::operator+= | ( | T_Scalar | val ) | [inline] |
Definition at line 195 of file Vector2.hpp.
Vector2& vl::Vector2< T_Scalar >::operator-= | ( | T_Scalar | val ) | [inline] |
Definition at line 200 of file Vector2.hpp.
Vector2& vl::Vector2< T_Scalar >::operator*= | ( | T_Scalar | val ) | [inline] |
Definition at line 205 of file Vector2.hpp.
Vector2& vl::Vector2< T_Scalar >::operator/= | ( | T_Scalar | val ) | [inline] |
Definition at line 210 of file Vector2.hpp.
Vector2& vl::Vector2< T_Scalar >::operator= | ( | const Vector2< T_Scalar > & | other ) | [inline] |
Definition at line 215 of file Vector2.hpp.
Vector2& vl::Vector2< T_Scalar >::operator= | ( | T_Scalar | val ) | [inline] |
Definition at line 221 of file Vector2.hpp.
bool vl::Vector2< T_Scalar >::operator== | ( | const Vector2< T_Scalar > & | other ) | const [inline] |
Definition at line 226 of file Vector2.hpp.
Referenced by vl::Vector2< int >::operator!=().
bool vl::Vector2< T_Scalar >::operator!= | ( | const Vector2< T_Scalar > & | other ) | const [inline] |
Definition at line 230 of file Vector2.hpp.
bool vl::Vector2< T_Scalar >::operator< | ( | const Vector2< T_Scalar > & | other ) | const [inline] |
Definition at line 234 of file Vector2.hpp.
T_Scalar& vl::Vector2< T_Scalar >::operator[] | ( | unsigned | i ) | [inline] |
Definition at line 241 of file Vector2.hpp.
const T_Scalar& vl::Vector2< T_Scalar >::operator[] | ( | unsigned | i ) | const [inline] |
Definition at line 242 of file Vector2.hpp.
T_Scalar vl::Vector2< T_Scalar >::length | ( | ) | const [inline] |
Definition at line 243 of file Vector2.hpp.
Referenced by vl::length(), and vl::Vector2< int >::normalize().
T_Scalar vl::Vector2< T_Scalar >::lengthSquared | ( | ) | const [inline] |
Definition at line 244 of file Vector2.hpp.
bool vl::Vector2< T_Scalar >::isNull | ( | ) | const [inline] |
Definition at line 245 of file Vector2.hpp.
const Vector2& vl::Vector2< T_Scalar >::normalize | ( | T_Scalar * | len = NULL ) |
[inline] |
Definition at line 246 of file Vector2.hpp.
Referenced by vl::normalize().
half vl::Vector2< half >::length | ( | ) | const [inline] |
Definition at line 608 of file half.hpp.
References vl::sqrt().
half vl::Vector2< half >::lengthSquared | ( | ) | const [inline] |
const int vl::Vector2< T_Scalar >::scalar_count = 2 [static] |
Definition at line 101 of file Vector2.hpp.
T_Scalar vl::Vector2< T_Scalar >::mScalar[scalar_count] [protected] |
Definition at line 257 of file Vector2.hpp.
Referenced by vl::Vector2< int >::g(), vl::Vector2< int >::operator[](), vl::Vector2< int >::ptr(), vl::Vector2< int >::r(), vl::Vector2< int >::s(), vl::Vector2< int >::t(), vl::Vector2< int >::Vector2(), vl::Vector2< int >::x(), and vl::Vector2< int >::y().