Public Attributes

decDVector4 Class Reference

4 Component Vector. More...

#include <decDVector4.h>

List of all members.

Public Member Functions

Constructors and Destructors
 decDVector4 ()
 Creates a new vector initialized to ( 0,0,0,1 ).
 decDVector4 (float nx, float ny, float nz)
 Creates a new vector with the given values.
 decDVector4 (float nx, float ny, float nz, float nw)
 Creates a new vector with the given values.
 decDVector4 (const decDVector4 &v)
 Creates a new vector with the values of another vector.
 decDVector4 (const decVector4 &v)
 Creates a new vector with the values of another vector.
Management
float Length ()
 Retrieves the length of the vector.
void Normalize ()
 Normalizes the vector.
void SetZero ()
 Sets all components to 0.
void Set (float nx, float ny, float nz, float nw)
 Sets the components to the given values.
decVector4 ToVector4 () const
 Convert to a single precision vector with possible loss of precision.
Operators
decDVector4 operator- ()
 Retrieves the negation of this vector.
decDVector4operator= (const decDVector4 &v)
 Sets the components of this vector to the values of another one.
decDVector4operator+= (const decDVector4 &v)
 Adds the components of another vector to this one.
decDVector4operator-= (const decDVector4 &v)
 Subtracts the components of another vector from this vector.
decDVector4operator*= (float k)
 Multiplies the components of this vector with a value k.
decDVector4operator/= (float k)
 Divides the components of this vector by a value k.
decDVector4 operator+ (const decDVector4 &v) const
 Retrieves a new vector with the sum of this vector with another one.
decDVector4 operator- (const decDVector4 &v) const
 Retrieves a new vector with the difference of this vector to another one.
decDVector4 operator* (float k) const
 Retrieves a new vector with this vector scaled by k.
float operator* (const decDVector4 &v) const
 Calculates the dor product of this vector with another one.
decDVector4 operator/ (float k) const
 Retrieves a new vector with this vector divided by k.
decDVector4 operator% (const decDVector4 &v) const
 Retrieves a new vector with the cross producr of this vector with another one.
bool operator< (const decDVector4 &v) const
 Determines if all the components of this vector are less then the components of another one.
bool operator> (const decDVector4 &v) const
 Determines if all the components of this vector are greater then the components of another one.
bool operator<= (const decDVector4 &v) const
 Determines if all the components of this vector are less then or equal to the components of another one.
bool operator>= (const decDVector4 &v) const
 Determines if all the components of this vector are greater then or equal to the components of another one.

Public Attributes

float w
 W Component of vector.
float x
 X Component of vector.
float y
 Y Component of vector.
float z
 Z Component of vector.

Detailed Description

4 Component Vector.

Author:
Plüss Roland
Version:
1.0
Date:
2008

Constructor & Destructor Documentation

decDVector4::decDVector4 (  ) [inline]

Creates a new vector initialized to ( 0,0,0,1 ).

References w, x, y, and z.

Referenced by operator%(), operator*(), operator+(), operator-(), and operator/().

decDVector4::decDVector4 ( float  nx,
float  ny,
float  nz 
) [inline]

Creates a new vector with the given values.

References w, x, y, and z.

decDVector4::decDVector4 ( float  nx,
float  ny,
float  nz,
float  nw 
) [inline]

Creates a new vector with the given values.

References w, x, y, and z.

decDVector4::decDVector4 ( const decDVector4 v ) [inline]

Creates a new vector with the values of another vector.

References w, x, y, and z.

decDVector4::decDVector4 ( const decVector4 v ) [inline]

Creates a new vector with the values of another vector.

References decVector4::w, w, decVector4::x, x, decVector4::y, y, decVector4::z, and z.


Member Function Documentation

float decDVector4::Length (  )

Retrieves the length of the vector.

void decDVector4::Normalize (  )

Normalizes the vector.

If the length of the vector is 0 an exception is thrown.

decDVector4 decDVector4::operator% ( const decDVector4 v ) const [inline]

Retrieves a new vector with the cross producr of this vector with another one.

References decDVector4(), x, y, and z.

decDVector4 decDVector4::operator* ( float  k ) const [inline]

Retrieves a new vector with this vector scaled by k.

References decDVector4(), x, y, and z.

float decDVector4::operator* ( const decDVector4 v ) const [inline]

Calculates the dor product of this vector with another one.

References x, y, and z.

decDVector4& decDVector4::operator*= ( float  k ) [inline]

Multiplies the components of this vector with a value k.

References x, y, and z.

decDVector4 decDVector4::operator+ ( const decDVector4 v ) const [inline]

Retrieves a new vector with the sum of this vector with another one.

References decDVector4(), x, y, and z.

decDVector4& decDVector4::operator+= ( const decDVector4 v ) [inline]

Adds the components of another vector to this one.

References x, y, and z.

decDVector4 decDVector4::operator- (  ) [inline]

Retrieves the negation of this vector.

References decDVector4(), x, y, and z.

decDVector4 decDVector4::operator- ( const decDVector4 v ) const [inline]

Retrieves a new vector with the difference of this vector to another one.

References decDVector4(), x, y, and z.

decDVector4& decDVector4::operator-= ( const decDVector4 v ) [inline]

Subtracts the components of another vector from this vector.

References x, y, and z.

decDVector4 decDVector4::operator/ ( float  k ) const [inline]

Retrieves a new vector with this vector divided by k.

If k is 0 an exception is thrown.

References decDVector4(), THROW, x, y, and z.

decDVector4& decDVector4::operator/= ( float  k ) [inline]

Divides the components of this vector by a value k.

If the value k is 0 an exception is thrown.

References THROW, x, y, and z.

bool decDVector4::operator< ( const decDVector4 v ) const [inline]

Determines if all the components of this vector are less then the components of another one.

References x, y, and z.

bool decDVector4::operator<= ( const decDVector4 v ) const [inline]

Determines if all the components of this vector are less then or equal to the components of another one.

References x, y, and z.

decDVector4& decDVector4::operator= ( const decDVector4 v ) [inline]

Sets the components of this vector to the values of another one.

References w, x, y, and z.

bool decDVector4::operator> ( const decDVector4 v ) const [inline]

Determines if all the components of this vector are greater then the components of another one.

References x, y, and z.

bool decDVector4::operator>= ( const decDVector4 v ) const [inline]

Determines if all the components of this vector are greater then or equal to the components of another one.

References x, y, and z.

void decDVector4::Set ( float  nx,
float  ny,
float  nz,
float  nw 
) [inline]

Sets the components to the given values.

References w, x, y, and z.

void decDVector4::SetZero (  ) [inline]

Sets all components to 0.

References w, x, y, and z.

decVector4 decDVector4::ToVector4 (  ) const [inline]

Convert to a single precision vector with possible loss of precision.

References w, x, y, and z.


Member Data Documentation

W Component of vector.

Referenced by decDVector4(), operator=(), Set(), SetZero(), and ToVector4().


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