The Nebula Device 3: Math::vector Class Reference

The Nebula Device 3

Math::vector Class Reference

#include <vector.h>

Inheritance diagram for Math::vector:

Math::float4


Detailed Description

A vector in homogenous space. A vector describes a direction and length in 3d space and always has a w component of 0.0.

(C) 2007 Radon Labs GmbH

A vector in homogenous space. A point describes a direction and length in 3d space and always has a w component of 0.0.

(C) 2007 Radon Labs GmbH

Public Member Functions

 vector ()
 default constructor
 vector (scalar x, scalar y, scalar z)
 construct from components
 vector (const float4 &rhs)
 construct from float4
 vector (const vector &rhs)
 copy constructor
void operator= (const vector &rhs)
 assignment operator
vector operator- () const
 flip sign
void operator+= (const vector &rhs)
 add vector inplace
void operator-= (const vector &rhs)
 subtract vector inplace
void operator *= (scalar s)
 scale vector inplace
vector operator+ (const vector &rhs) const
 add 2 vectors
vector operator- (const vector &rhs) const
 subtract 2 vectors
vector operator * (scalar s) const
 scale vector
bool operator== (const vector &rhs) const
 equality operator
bool operator!= (const vector &rhs) const
 inequality operator
void set (scalar x, scalar y, scalar z)
 set components

Static Public Member Functions

static vector nullvec ()
 return the null vector
static vector upvec ()
 return the standard up vector (0, 1, 0)