DSC
 All Classes Namespaces Files Functions Variables Typedefs Friends Macros
Public Member Functions | List of all members
CGLA::Vec2f Class Reference

2D floating point vector More...

#include <Vec2f.h>

Inheritance diagram for CGLA::Vec2f:
CGLA::ArithVec2Float< float, Vec2f > CGLA::ArithVecFloat< float, Vec2f, 2 > CGLA::ArithVec< float, Vec2f, N >

Public Member Functions

 Vec2f (float _a, float _b)
 
template<class T , class V , unsigned int N>
 Vec2f (const ArithVec< T, V, N > &v)
 
 Vec2f (float a)
 
- Public Member Functions inherited from CGLA::ArithVec2Float< float, Vec2f >
 ArithVec2Float (floata, floatb)
 Construct a 2D float vector.
 
 ArithVec2Float ()
 Construct a 2D float vector.
 
- Public Member Functions inherited from CGLA::ArithVecFloat< float, Vec2f, 2 >
 ArithVecFloat (floata) noexcept
 
 ArithVecFloat (floata, floatb) noexcept
 
 ArithVecFloat (floata, floatb, floatc) noexcept
 
 ArithVecFloat (floata, floatb, floatc, floatd) noexcept
 
float length () const
 Compute Euclidean length.
 
void normalize ()
 Normalize vector.
 
void cond_normalize ()
 Conditionally normalize vector. The condition being that the vector has non-zero length.
 
- Public Member Functions inherited from CGLA::ArithVec< float, Vec2f, N >
void set (float_a, float_b)
 Set all coordinates of a 2D vector.
 
void set (float_a, float_b, float_c)
 Set all coordinates of a 3D vector.
 
void set (float_a, float_b, float_c, float_d)
 Set all coordinates of a 4D vector.
 
const float & operator[] (unsigned int i) const
 Const index operator.
 
float & operator[] (unsigned int i)
 Non-const index operator.
 
const float & operator() (unsigned int i) const
 Const index operator.
 
float & operator() (unsigned int i)
 Non-const index operator.
 
float * get ()
 
const float * get () const
 
bool operator== (const Vec2f &v) const
 Equality operator.
 
bool operator== (floatk) const
 Equality wrt scalar. True if all coords are equal to scalar.
 
bool operator!= (const Vec2f &v) const
 Inequality operator.
 
bool operator!= (floatk) const
 Inequality wrt scalar. True if any coord not equal to scalar.
 
bool all_l (const Vec2f &v) const
 
bool all_le (const Vec2f &v) const
 
bool all_g (const Vec2f &v) const
 
bool all_ge (const Vec2f &v) const
 
const Vec2foperator*= (floatk)
 Assignment multiplication with scalar.
 
const Vec2foperator*= (const Vec2f &v)
 
const Vec2foperator/= (floatk)
 Assignment division with scalar.
 
const Vec2foperator/= (const Vec2f &v)
 Assigment division with vector. Each coord divided independently.
 
const Vec2foperator+= (floatk)
 Assignment addition with scalar. Adds scalar to each coordinate.
 
const Vec2foperator+= (const Vec2f &v)
 Assignmment addition with vector.
 
const Vec2foperator-= (floatk)
 Assignment subtraction with scalar. Subtracts scalar from each coord.
 
const Vec2foperator-= (const Vec2f &v)
 Assignment subtraction with vector.
 
const Vec2f operator- () const
 Negate vector.
 
const Vec2f operator- (const Vec2f &v1) const
 Subtract two vectors.
 
const Vec2f operator* (const Vec2f &v1) const
 
const Vec2f operator* (floatk) const
 Multiply scalar onto vector.
 
const Vec2f operator+ (const Vec2f &v1) const
 Add two vectors.
 
const Vec2f operator/ (const Vec2f &v1) const
 Divide two vectors. Each coord separately.
 
const Vec2f operator/ (floatk) const
 Divide vector by scalar.
 
const float min_coord () const
 Return the smallest coordinate of the vector.
 
const float max_coord () const
 Return the largest coordinate of the vector.
 

Additional Inherited Members

- Public Types inherited from CGLA::ArithVec< float, Vec2f, N >
typedef float ScalarType
 For convenience we define a more meaningful name for the scalar type.
 
typedef Vec2f VectorType
 A more meaningful name for vector type.
 
- Static Public Member Functions inherited from CGLA::ArithVec< float, Vec2f, N >
static unsigned int get_dim ()
 Return dimension of vector.
 
- Protected Member Functions inherited from CGLA::ArithVec< float, Vec2f, N >
 ArithVec ()
 Construct uninitialized vector.
 
 ArithVec (float_a)
 Construct a vector where all coordinates are identical.
 
 ArithVec (float_a, float_b)
 Construct a 2D vector.
 
 ArithVec (float_a, float_b, float_c)
 Construct a 3D vector.
 
 ArithVec (float_a, float_b, float_c, float_d)
 Construct a 4D vector.
 
- Protected Attributes inherited from CGLA::ArithVec< float, Vec2f, N >
float data [N]
 The actual contents of the vector.
 

Detailed Description

2D floating point vector


The documentation for this class was generated from the following file: