The Fast Light Environment Kit



class FVector3

Class Hierarchy

FBase
   |
   +----FVector3

Include Files

#include <Flek/FVector3.H>

Description

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

Methods


Method Descriptions

FBase

virtual FVector3::FBase(void);

Make a copy of the object.

FVector3

FVector3::FVector3();

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

FVector3::FVector3(double val);

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

FVector3::FVector3(double * arr);

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

FVector3::FVector3(double val1, double val2, double val3=0.0);

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

FVector3::FVector3(const FVector3& vec);

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

FVector3::FVector3(const FVector2& vec);

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

FVector3::FVector3(const FVector4& vec);

This constructor initializes the vector from the contents of a FVector4. The third element in the FVector4 is ignored.

copy_from

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

Initialize the elements from a FVector2,

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

Initialize the elements from a FVector4,

fill_array

void FVector3::fill_array(double arr[3]);

Fill an array with the elements of the vector.

get

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

Get the elements of vector into given values.

length

double FVector3::length();

Length (norm) of the vector.

norm

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

Norm of the vector.

normalize

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

Normalize. Returns previous norm.

normalized

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

Returns normalized vector.

normsqr

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

Square of the norm of the vector.

operator !=

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

Boolean ineqality operator.

operator %

FVector3 FVector3::operator %(const FVector3& vec);

Operator for vector multiplication (cross product).

operator *

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

Operator for scalar multiplication (dot product).

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

Friend operator for scalar pre-multiplication.

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

Friend operator for scalar post-multiplication.

operator *=

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

Arithmetic operator for multiplicative (scalar) assignment.

operator +

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

Arithmetic operator for addition.

operator +=

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

Arithmetic operator for additive assignment.

operator -

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

Arithmetic operator for subtraction.

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

Friend operator for negation.

operator -=

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

Arithmetic operator for subtractive assignment.

operator /

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

Friend operator for scalar division.

operator /=

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

Arithmetic operator for divisive (scalar) assignment.

operator <<

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

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

operator =

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

Assignment operator from another FVector3.

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

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

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

Assignment operator from a FVector2. The third element set to 0.

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

Assignment operator from a FVector4. Copies first 3 elements.

operator ==

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

Boolean equality operator.

operator >>

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

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

operator []

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

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

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

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

product

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

Friend operator for element-by-element product.

reset

void FVector3::reset(void);

Set elements of vector to default values.

set

void FVector3::set(double v1, double v2, double v3);

Set each element vector to the given values.

void FVector3::set(double val);

Set each element vector to the given value.

swap

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

Swap the elements of two FVector3s.

~FVector3

virtual FVector3::~FVector3();

The virtual destructor does nothing.

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