FBase | +----FVector3
#include <Flek/FVector3.H>
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.
virtual FVector3::FBase(void);
Make a copy of the object.
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.
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,
void FVector3::fill_array(double arr[3]);
Fill an array with the elements of the vector.
void FVector3::get(double& v1, double& v2, double& v3);
Get the elements of vector into given values.
double FVector3::length();
Length (norm) of the vector.
friend double FVector3::norm(const FVector3& vec);
Norm of the vector.
friend double FVector3::normalize(FVector3& vec);
Normalize. Returns previous norm.
friend FVector3 FVector3::normalized(const FVector3& vec);
Returns normalized vector.
friend double FVector3::normsqr(const FVector3& vec);
Square of the norm of the vector.
bool FVector3::operator !=(const FVector3& vec);
Boolean ineqality operator.
FVector3 FVector3::operator %(const FVector3& vec);
Operator for vector multiplication (cross product).
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.
void FVector3::operator *=(double scalar);
Arithmetic operator for multiplicative (scalar) assignment.
FVector3 FVector3::operator +(const FVector3& vec);
Arithmetic operator for addition.
void FVector3::operator +=(const FVector3& vec);
Arithmetic operator for additive assignment.
FVector3 FVector3::operator -(const FVector3& vec);
Arithmetic operator for subtraction.friend FVector3 FVector3::operator -(const FVector3& vec);
Friend operator for negation.
void FVector3::operator -=(const FVector3& vec);
Arithmetic operator for subtractive assignment.
friend FVector3 FVector3::operator /(const FVector3& vec, double scalar);
Friend operator for scalar division.
void FVector3::operator /=(double scalar);
Arithmetic operator for divisive (scalar) assignment.
friend ostream& FVector3::operator <<(ostream& o, const FVector3& vec);
I/O Stream insertion operator. Of the form "[ x y z ]".
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.
bool FVector3::operator ==(const FVector3& vec);
Boolean equality operator.
friend istream& FVector3::operator >>(istream& i, FVector3& vec);
I/O Stream extraction operator. Of the form "[ x y z ]".
double& FVector3::operator [] (uint index);
Element access operator. For efficiency, this doesn't check for valid indicesdouble FVector3::operator [] (uint index);
Element access operator. For efficiency, this doesn't check for valid indices
friend FVector3 FVector3::product(const FVector3& vec1, const FVector3& vec2);
Friend operator for element-by-element product.
void FVector3::reset(void);
Set elements of vector to default values.
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.
friend void FVector3::swap(FVector3& vec1, FVector3& vec2);
Swap the elements of two FVector3s.
virtual FVector3::~FVector3();
The virtual destructor does nothing.