Public Types | Public Member Functions | Public Attributes | Friends

GEO::VectorN< elemCount > Struct Template Reference

Base type of all vectors. More...

#include <GeoBases.h>

List of all members.

Public Types

typedef MatrixN< elemCount > MatrixType
 associated matrix type
typedef MatrixN< elemCount+1 > GreaterMatrixType
 associated matrix type with one extra dimension

Public Member Functions

nuint ElementCount () const
 The number of elements in the vector.
 VectorN ()
 ctor
 VectorN (const float *array)
 ctor
 VectorN (float c)
 ctor
float & operator[] (nuint index)
 access an element by index with []
const float & operator[] (nuint index) const
 access an element by index with []
VectorN operator* (const VectorN &o) const
 per-element scale
VectorN operator* (const float &o) const
 scale by a value
VectorN operator/ (const VectorN &o) const
 per-element divide
VectorN operator/ (const float &o) const
 divide elements by a value
VectorN operator+ (const VectorN &o) const
 add
VectorN operator+ (const float &o) const
 add
VectorN operator- (const VectorN &o) const
 subtract
VectorN operator- (const float &o) const
 subtract
void operator*= (const VectorN &o)
 per-element scale
void operator*= (const float &o)
 scale by a value
void operator/= (const VectorN &o)
 per-element divide
void operator/= (const float &o)
 divide elements by a value
void operator+= (const VectorN &o)
 add
void operator+= (const float &o)
 add
void operator-= (const VectorN &o)
 subtract
void operator-= (const float &o)
 subtract
VectorN operator- () const
 negation
float LengthSquared () const
 the vector length, squared
float Length () const
 the vector length
VectorN Normal () const
 get a normalized version of the vector
void Normalize ()
 normalize this vector
float Dot (const VectorN &o) const
 dot product
float AngleBetween (const VectorN &o) const
 angle between vectors
void Transform (const MatrixType &m) const
 transform (multiply) this vector with a matrix
 operator const std::string () const
 human readable string representation

Public Attributes

float elements [elemCount]
 Elements of the vector.

Friends

VectorN operator* (const float &o, const VectorN &me)
 scale by a value
bool operator== (const VectorN &v1, const VectorN &v2)
 comparison
bool operator== (const VectorN &v, const float &c)
 comparison
bool operator!= (const VectorN &v1, const VectorN &v2)
 comparison
bool operator!= (const VectorN &v, const float &c)
 comparison

Detailed Description

template<nuint elemCount>
struct GEO::VectorN< elemCount >

Base type of all vectors.


The documentation for this struct was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends