The Fast Light Environment Kit



class FVector4

Class Hierarchy

FBase
   |
   +----FVector4

Include Files

#include <Flek/FVector4.H>

Description

FVector4 is a 4 dimensional vector represented internally as an array of doubles. This class is related to FVector2 and FVector3 which are 2-D and 3-D versions of this class. All FVector classes are forward declared in FVector.h.

Methods


Method Descriptions

FBase

virtual FVector4::FBase(void);

Make a copy of the object.

FVector4

FVector4::FVector4();

The default constructor sets each element in the vector to 0.

FVector4::FVector4(double val);

This one argument constructor intializes all elements in the vector with the given value.

FVector4::FVector4(double * arr);

This one argument constructor initializes the vector with the first three elements in the given array.

FVector4::FVector4(double val1, double val2, double val3, double val4);

This four argument constructor initializes the vector with the passed values.

FVector4::FVector4(const FVector4& vec);

The copy constructor initializes this vector with the contents of another vector.

FVector4::FVector4(const FVector2& vec);

This constructor initializes the vector from the contents of a FVector2 (a 2D vector). The third and forth elements are set to zero.

FVector4::FVector4(const FVector3& vec);

This constructor initializes the vector from the contents of a FVector2 (a 2D vector). The third element is set to zero.

copy_from

void FVector4::copy_from(const FVector2& vec);

Initialize the elements from a FVector2,

void FVector4::copy_from(const FVector3& vec);

Initialize the elements from a FVector4,

fill_array

void FVector4::fill_array(double arr[4]);

Fill an array with the elements of the vector.

get

void FVector4::get(double& v1, double& v2, double& v3, double& v4);

Get the elements of vector into given values.

length

double FVector4::length();

Length (norm) of the vector.

norm

friend double FVector4::norm(const FVector4& vec);

Norm of the vector.

normalize

friend double FVector4::normalize(FVector4& vec);

Normalize. Returns previous norm.

normalized

friend FVector4 FVector4::normalized(const FVector4& vec);

Returns normalized vector.

normsqr

friend double FVector4::normsqr(const FVector4& vec);

Square of the norm of the vector.

operator !=

bool FVector4::operator !=(const FVector4& vec);

Boolean ineqality operator.

operator *

double FVector4::operator * (const FVector4& vec);

Operator for scalar multiplication (dot product).

friend FVector4 FVector4::operator * (double scalar, const FVector4& vec);

Friend operator for scalar pre-multiplication.

friend FVector4 FVector4::operator * (const FVector4& vec, double scalar);

Friend operator for scalar post-multiplication.

operator *=

void FVector4::operator *=(double scalar);

Arithmetic operator for multiplicative (scalar) assignment.

operator +

FVector4 FVector4::operator +(const FVector4& vec);

Arithmetic operator for addition.

operator +=

void FVector4::operator +=(const FVector4& vec);

Arithmetic operator for additive assignment.

operator -

FVector4 FVector4::operator -(const FVector4& vec);

Arithmetic operator for subtraction.

friend FVector4 FVector4::operator -(const FVector4& vec);

Friend operator for negation.

operator -=

void FVector4::operator -=(const FVector4& vec);

Arithmetic operator for subtractive assignment.

operator /

friend FVector4 FVector4::operator /(const FVector4& vec, double scalar);

Friend operator for scalar division.

operator /=

void FVector4::operator /=(double scalar);

Arithmetic operator for divisive (scalar) assignment.

operator <<

friend ostream& FVector4::operator <<(ostream& o, const FVector4& vec);

I/O Stream insertion operator. Of the form "[ x y z ]".

operator =

FVector4& FVector4::operator =(const FVector4& vec);

Assignment operator from another FVector3.

FVector4& FVector4::operator =(double scalar);

Assignment operator from a scalar. All elements are set to the scalar value.

FVector4& FVector4::operator =(const FVector2& vec);

Assignment operator from a FVector2. The third and forth elements are set to 0.

FVector4& FVector4::operator =(const FVector3& vec);

Assignment operator from a FVector3. The forth element is set to 0.

operator ==

bool FVector4::operator ==(const FVector4& vec);

Boolean equality operator.

operator >>

friend istream& FVector4::operator >>(istream& i, FVector4& vec);

I/O Stream extraction operator. Of the form "[ x y z ]".

operator []

double& FVector4::operator [] (uint index);

Element access operator. For efficiency, this doesn't check for valid indices

double FVector4::operator [] (uint index);

Element access operator. For efficiency, this doesn't check for valid indices

product

friend FVector4 FVector4::product(const FVector4& vec1, const FVector4& vec2);

Friend operator for element-by-element product.

reset

void FVector4::reset(void);

Set elements of vector to default values.

set

void FVector4::set(double v1, double v2, double v3, double v4);

Set each element vector to the given values.

void FVector4::set(double val);

Set each element vector to the given value.

swap

friend void FVector4::swap(FVector4& vec1, FVector4& vec2);

Swap the elements of two FVector4s.

~FVector4

virtual FVector4::~FVector4();

The virtual destructor does nothing.

© 2000 the Flek Development team.
Generated by ScanDoc
Last Updated: Tue May 15 8:50:06 2001