Public Attributes

decVector4 Class Reference

4 Component Vector. More...

#include <decVector4.h>

List of all members.

Public Member Functions

Constructors and Destructors
 decVector4 ()
 Creates a new vector initialized to ( 0,0,0,1 ).
 decVector4 (float nx, float ny, float nz)
 Creates a new vector with the given values.
 decVector4 (float nx, float ny, float nz, float nw)
 Creates a new vector with the given values.
 decVector4 (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.
Operators
decVector4 operator- ()
 Retrieves the negation of this vector.
decVector4operator= (const decVector4 &v)
 Sets the components of this vector to the values of another one.
decVector4operator+= (const decVector4 &v)
 Adds the components of another vector to this one.
decVector4operator-= (const decVector4 &v)
 Subtracts the components of another vector from this vector.
decVector4operator*= (float k)
 Multiplies the components of this vector with a value k.
decVector4operator/= (float k)
 Divides the components of this vector by a value k.
decVector4 operator+ (const decVector4 &v) const
 Retrieves a new vector with the sum of this vector with another one.
decVector4 operator- (const decVector4 &v) const
 Retrieves a new vector with the difference of this vector to another one.
decVector4 operator* (float k) const
 Retrieves a new vector with this vector scaled by k.
float operator* (const decVector4 &v) const
 Calculates the dor product of this vector with another one.
decVector4 operator/ (float k) const
 Retrieves a new vector with this vector divided by k.
decVector4 operator% (const decVector4 &v) const
 Retrieves a new vector with the cross producr of this vector with another one.
bool operator< (const decVector4 &v) const
 Determines if all the components of this vector are less then the components of another one.
bool operator> (const decVector4 &v) const
 Determines if all the components of this vector are greater then the components of another one.
bool operator<= (const decVector4 &v) const
 Determines if all the components of this vector are less then or equal to the components of another one.
bool operator>= (const decVector4 &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

decVector4::decVector4 (  ) [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/().

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

Creates a new vector with the given values.

References w, x, y, and z.

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

Creates a new vector with the given values.

References w, x, y, and z.

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

Creates a new vector with the values of another vector.

References w, x, y, and z.


Member Function Documentation

float decVector4::Length (  )

Retrieves the length of the vector.

void decVector4::Normalize (  )

Normalizes the vector.

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

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

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

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

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

Retrieves a new vector with this vector scaled by k.

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

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

Calculates the dor product of this vector with another one.

References x, y, and z.

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

Multiplies the components of this vector with a value k.

References x, y, and z.

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

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

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

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

Adds the components of another vector to this one.

References x, y, and z.

decVector4 decVector4::operator- (  ) [inline]

Retrieves the negation of this vector.

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

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

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

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

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

Subtracts the components of another vector from this vector.

References x, y, and z.

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

Retrieves a new vector with this vector divided by k.

If k is 0 an exception is thrown.

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

decVector4& decVector4::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 decVector4::operator< ( const decVector4 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 decVector4::operator<= ( const decVector4 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.

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

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

References w, x, y, and z.

bool decVector4::operator> ( const decVector4 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 decVector4::operator>= ( const decVector4 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 decVector4::Set ( float  nx,
float  ny,
float  nz,
float  nw 
) [inline]

Sets the components to the given values.

References w, x, y, and z.

void decVector4::SetZero (  ) [inline]

Sets all components to 0.

References w, x, y, and z.


Member Data Documentation

W Component of vector.

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


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