CSIBCVector4Dd Class Reference
General purpose 4D vector class.
More...#include <SIBCVector4Dd.h>
List of all members.
|
|
Public Member Functions
|
| |
CSIBCVector4Dd () |
| |
CSIBCVector4Dd (const double in_dX, const double in_dY, const double in_dZ, const double in_dW) |
| |
CSIBCVector4Dd (const CSIBCVector3Dd &in_vct, double in_dW) |
| double |
GetX (void) const |
| double |
GetY (void) const |
| double |
GetZ (void) const |
| double |
GetW (void) const |
| double |
Get (const int in_nIndex) const |
| void |
Get (double &out_dX, double &out_dY, double &out_dZ, double &out_dW) const |
| CSIBCVector4Dd & |
SetX (const double in_dVal) |
| CSIBCVector4Dd & |
SetY (const double in_dVal) |
| CSIBCVector4Dd & |
SetZ (const double in_dVal) |
| CSIBCVector4Dd & |
SetW (const double in_dVal) |
| CSIBCVector4Dd & |
Set (const int in_nIndex, const double in_dVal) |
| CSIBCVector4Dd & |
Set (const double in_dX, const double in_dY, const double in_dZ, const double in_dW) |
| void |
Set (const CSIBCVector4Dd &in_vct) |
| CSIBCVector4Dd & |
SetNull (void) |
| bool |
IsNull (const double in_dEpsilon=PICO_EPS) const |
| CSIBCVector4Dd & |
SetMinimal (const double in_dEpsilon=PICO_EPS) |
| bool |
operator== (const CSIBCVector4Dd &in_vct) const |
| bool |
operator!= (const CSIBCVector4Dd &in_vct) const |
| CSIBCVector4Dd & |
Negate (const CSIBCVector4Dd &in_vct) |
| CSIBCVector4Dd & |
Negate (void) |
| double |
GetSquaredLength (void) const |
| double |
GetLength (void) const |
| bool |
SetLength (const double in_dLength) |
| bool |
Normalize (void) |
| CSIBCVector4Dd & |
Add (const CSIBCVector4Dd &in_vct) |
| CSIBCVector4Dd & |
Add (const CSIBCVector4Dd &in_vct1, const CSIBCVector4Dd &in_vct2) |
| CSIBCVector4Dd & |
Sub (const CSIBCVector4Dd &in_vct) |
| CSIBCVector4Dd & |
Sub (const CSIBCVector4Dd &in_vct1, const CSIBCVector4Dd &in_vct2) |
| CSIBCVector4Dd & |
Mul (const double in_dFactor) |
| CSIBCVector4Dd & |
Mul (const double in_dFactor, const CSIBCVector4Dd &in_vct) |
| CSIBCVector4Dd & |
Mul (const CSIBCVector4Dd &in_vct, const double in_dFactor) |
| CSIBCVector4Dd & |
Div (const double in_dFactor) |
| CSIBCVector4Dd & |
Div (const CSIBCVector4Dd &in_vct, const double in_dFactor) |
| CSIBCVector4Dd & |
MulComp (const CSIBCVector4Dd &in_vct1, const CSIBCVector4Dd &in_vct2) |
| CSIBCVector4Dd & |
MulComp (const CSIBCVector4Dd &in_vct) |
| CSIBCVector4Dd & |
DivComp (const CSIBCVector4Dd &in_vct) |
| CSIBCVector4Dd & |
DivComp (const CSIBCVector4Dd &in_vct1, const CSIBCVector4Dd &in_vct2) |
| CSIBCVector4Dd & |
Mul (const CSIBCMatrix44d &in_mat) |
| CSIBCVector4Dd & |
Mul (const CSIBCVector4Dd &in_vct, const CSIBCMatrix44d &in_mat) |
| CSIBCVector4Dd & |
Mul (const CSIBCMatrix44d &in_mat, const CSIBCVector4Dd &in_vct) |
| CSIBCVector4Dd & |
Mul (const CSIBCVector4Dd &in_vct, const CSIBCXfoMatd &in_mat) |
| CSIBCVector4Dd & |
Mul (const CSIBCXfoMatd &in_mat, const CSIBCVector4Dd &in_vct) |
| bool |
SetProjection (const CSIBCVector4Dd &in_vct) |
Friends
|
| bool |
AreAlmostEqual (const CSIBCVector4Dd &in_vct1, const CSIBCVector4Dd &in_vct2, const double in_dEpsilon=PICO_EPS) |
| double |
GetDot (const CSIBCVector4Dd &in_vct1, const CSIBCVector4Dd &in_vct2) |
| double |
GetDistance (const CSIBCVector4Dd &in_pnt1, const CSIBCVector4Dd &in_pnt2) |
| double |
GetSquaredDistance (const CSIBCVector4Dd &in_pnt1, const CSIBCVector4Dd &in_pnt2) |
Detailed Description
General purpose 4D vector class.
Representation of a 4D vector, defining operations to access, modify and perform calculations on 4D vectors. This class uses double precision floating-point numbers for represent its data, and in its operations. There are seperate similar classes for 2D and 3D vectors, CSIBCVector2Dd and CSIBCVector3Dd, respectively, which also use double precision.
Furthermore, there is another set of vector classes which use single precision floating-point numbers, CSIBCVector2D, CSIBCVector3D and CSIBCVector4D for 2D, 3D and 4D vectors respectively. Quaternions represented as 4D vectors are also available in CSIBCQuaternion and CSIBCQuaterniond with single precision and double precision, repspectively.
Constructor & Destructor Documentation
Default Constructor. Constructs a new 4D vector.
| CSIBCVector4Dd |
( |
const double |
in_dX, |
|
|
|
const double |
in_dY, |
|
|
|
const double |
in_dZ, |
|
|
|
const double |
in_dW |
|
|
|
) |
|
|
|
Constructor. Constructs a new 4D vector, with in_dX, in_dY, in_dZ and in_dW as the X, Y, Z and W component values, respectively.
- Parameters:
-
| [in] |
in_dX |
The value for the X component of the new vector. |
| [in] |
in_dY |
The value for the Y component of the new vector. |
| [in] |
in_dZ |
The value for the Z component of the new vector. |
| [in] |
in_dW |
The value for the W component of the new vector. |
Constructor. Constructs a new 4D vector, with the X, Y and Z components taken from in_vct, and the W component as in_dW.
- Parameters:
-
| [in] |
in_vct |
The 3D vector for the X, Y and Z components. |
| [in] |
in_dW |
The value of the W component. |
Member Function Documentation
| double GetX |
( |
void |
|
) |
const |
| double GetY |
( |
void |
|
) |
const |
Returns the Y component of this vector.
- Returns:
- Value of the Y component of this vector.
- See also:
- CSIBCVector4Dd::GetX
CSIBCVector4Dd::GetZ
CSIBCVector4Dd::GetW
CSIBCVector4Dd::SetY
CSIBCVector4Dd::Get
| double GetZ |
( |
void |
|
) |
const |
Returns the Z component of this vector.
- Returns:
- Value of the Z component of this vector.
- See also:
- CSIBCVector4Dd::GetX
CSIBCVector4Dd::GetY
CSIBCVector4Dd::GetW
CSIBCVector4Dd::SetZ
CSIBCVector4Dd::Get
| double GetW |
( |
void |
|
) |
const |
Returns the W component of this vector.
- Returns:
- Value of the W component of this vector.
- See also:
- CSIBCVector4Dd::GetX
CSIBCVector4Dd::GetY
CSIBCVector4Dd::GetZ
CSIBCVector4Dd::SetW
CSIBCVector4Dd::Get
| double Get |
( |
const int |
in_nIndex |
) |
const |
Returns the value of the component specified by in_nIndex.
- Parameters:
-
| [in] |
in_nIndex |
Index of the component value to get (0 == X, 1 == Y, 2 == Z, 3 == W). |
- Returns:
- Value of the component specified by
in_nIndex.
- See also:
- CSIBCVector4Dd::GetX
CSIBCVector4Dd::GetY
CSIBCVector4Dd::GetZ
CSIBCVector4Dd::GetW
CSIBCVector4Dd::Set
| void Get |
( |
double & |
out_dX, |
|
|
|
double & |
out_dY, |
|
|
|
double & |
out_dZ, |
|
|
|
double & |
out_dW |
|
|
|
) |
|
|
const |
Returns the values of the X, Y, Z and W components of this vector.
- Parameters:
-
| [out] |
out_dX |
Receives the value of the X component |
| [out] |
out_dY |
Receives the value of the Y component |
| [out] |
out_dZ |
Receives the value of the Z component |
| [out] |
out_dW |
Receives the value of the W component |
- See also:
- CSIBCVector4Dd::GetX
CSIBCVector4Dd::GetY
CSIBCVector4Dd::GetZ
CSIBCVector4Dd::GetW
CSIBCVector4Dd::Set
Sets the value of the X component of this vector.
- Parameters:
-
| [in] |
in_dVal |
The new value of the X component of this vector. |
- Returns:
- Reference to this vector.
- See also:
- CSIBCVector4Dd::SetY
CSIBCVector4Dd::SetZ
CSIBCVector4Dd::SetW
CSIBCVector4Dd::Set
CSIBCVector4Dd::GetX
Sets the value of the Y component of this vector.
- Parameters:
-
| [in] |
in_dVal |
The new value of the Y component of this vector. |
- Returns:
- Reference to this vector.
- See also:
- CSIBCVector4Dd::SetX
CSIBCVector4Dd::SetZ
CSIBCVector4Dd::SetW
CSIBCVector4Dd::Set
CSIBCVector4Dd::GetY
Sets the value of the Z component of this vector.
- Parameters:
-
| [in] |
in_dVal |
The new value of the Z component of this vector. |
- Returns:
- Reference to this vector.
- See also:
- CSIBCVector4Dd::SetX
CSIBCVector4Dd::SetY
CSIBCVector4Dd::SetW
CSIBCVector4Dd::Set
CSIBCVector4Dd::GetZ
Sets the value of the W component of this vector.
- Parameters:
-
| [in] |
in_dVal |
The new value of the W component of this vector. |
- Returns:
- Reference to this vector.
- See also:
- CSIBCVector4Dd::SetX
CSIBCVector4Dd::SetY
CSIBCVector4Dd::SetZ
CSIBCVector4Dd::Set
CSIBCVector4Dd::GetW
Sets the component given by in_nIndex to in_dVal.
- Parameters:
-
| [in] |
in_nIndex |
The index of the component to set (0 == X, 1 == Y, 2 == Z). |
| [in] |
in_dVal |
The value to set the component to. |
- Returns:
- Reference to this vector.
- See also:
- CSIBCVector4Dd::Set
CSIBCVector4Dd::Get
| CSIBCVector4Dd& Set |
( |
const double |
in_dX, |
|
|
|
const double |
in_dY, |
|
|
|
const double |
in_dZ, |
|
|
|
const double |
in_dW |
|
|
|
) |
|
|
|
Sets the X, Y, Z and W components of the vector.
- Parameters:
-
| [in] |
in_dX |
The value for the X component of the vector. |
| [in] |
in_dY |
The value for the Y component of the vector. |
| [in] |
in_dZ |
The value for the Z component of the vector. |
| [in] |
in_dW |
The value for the W component of the vector. |
- Returns:
- Reference to this vector.
- See also:
- CSIBCVector4Dd::Set
CSIBCVector4Dd::SetX
CSIBCVector4Dd::SetY
CSIBCVector4Dd::SetZ
CSIBCVector4Dd::SetW
CSIBCVector4Dd::Get
Sets the value of this vector to the value of in_vct.
- Parameters:
-
| [in] |
in_vct |
Vector to set this vector equal to. |
- Returns:
- Reference to this vector.
- See also:
- CSIBCVector4Dd::Set
CSIBCVector4Dd::SetX
CSIBCVector4Dd::SetY
CSIBCVector4Dd::SetZ
CSIBCVector4Dd::Get
Sets all the components of this vector to zero.
- Returns:
- Reference to this vector.
- See also:
- CSIBCVector4Dd::IsNull
CSIBCVector4Dd::Set
| bool IsNull |
( |
const double |
in_dEpsilon = PICO_EPS |
) |
const |
Determines whether all components of this vector are equal to zero. Since this method uses floating-point comparison, a threshhold value of in_dEpsilon is used for equality comparison.
- Parameters:
-
| [in] |
in_dEpsilon |
Floating-point comparison error range. Defaults to PICO_EPS. |
- Return values:
-
|
|
true |
if the vector is null |
|
|
false |
otherwise |
- See also:
- CSIBCVector4Dd::SetNull
CSIBCVector4Dd::AreAlmostEqual
Sets each component of this vector to be at least in_dEpsilon (in absolute value). This does not change the sign of the component.
- Parameters:
-
| [in] |
in_dEpsilon |
Value for the minimum absolute value of each component. Defaults to PICO_EPS. |
- Returns:
- Reference to this vector
- See also:
- CSIBCVector4Dd::Set
Determines whether all corresponding components of this vector and in_vct are exactly equal.
- Parameters:
-
| [in] |
in_vct |
The vector to compare equality with. |
- Return values:
-
|
|
true |
if the vectors are exactly equal |
|
|
false |
otherwise |
- See also:
- CSIBCVector4Dd::AreAlmostEqual
CSIBCVector4Dd::operator!=
Determines whether any corresponding components of this vector and in_vct are different.
- Parameters:
-
| [in] |
in_vct |
The vector to compare inequality with. |
- Return values:
-
|
|
true |
if the vectors differ in any component |
|
|
false |
otherwise |
- See also:
- CSIBCVector4Dd::AreAlmostEqual
CSIBCVector4Dd::operator==
Sets this vector to the negative of in_vct.
- Parameters:
-
| [in] |
in_vct |
Vector containing the negative value for this vector. |
- Returns:
- Reference to this vector.
- See also:
- CSIBCVector4Dd::Negate
Sets this vector to its negative.
- Returns:
- Reference to this vector.
- See also:
- CSIBCVector4Dd::Negate
| double GetSquaredLength |
( |
void |
|
) |
const |
Returns the squared length of this vector.
- Returns:
- The squared length of this vector.
- See also:
- CSIBCVector4Dd::GetLength
CSIBCVector4Dd::SetLength
CSIBCVector4Dd::Normalize
| double GetLength |
( |
void |
|
) |
const |
Returns the length of this vector.
- Returns:
- The squared length of this vector.
- See also:
- CSIBCVector4Dd::GetSquaredLength
CSIBCVector4Dd::SetLength
CSIBCVector4Dd::Normalize
| bool SetLength |
( |
const double |
in_dLength |
) |
|
Sets the length of this vector.
- Parameters:
-
| [in] |
in_dLength |
New length for this vector. |
- Return values:
-
|
|
true |
if the length was set properly |
|
|
false |
if the length of the current vector is zero |
- See also:
- CSIBCVector4Dd::Normalize
CSIBCVector4Dd::GetLength
Sets the vector to be a unit vector.
- Return values:
-
|
|
true |
if the length was set properly |
|
|
false |
if the length of the current vector is zero |
- See also:
- CSIBCVector4Dd::SetLength
CSIBCVector4Dd::GetLength
Adds this vector and in_vct. The result is stored in this vector.
- Parameters:
-
| [in] |
in_vct |
Vector to add to this vector. return CSIBCVector4Dd& Reference to this vector. |
- See also:
- CSIBCVector4Dd::Add
CSIBCVector4Dd::Sub
Adds in_vct1 and in_vct2. The result is stored in this vector.
- Parameters:
-
| [in] |
in_vct1 |
First vector in the addition. |
| [in] |
in_vct2 |
Second vector in the addition. |
- Returns:
- Reference to this vector.
- See also:
- CSIBCVector4Dd::Add
CSIBCVector4Dd::Sub
Subtracts in_vct from this vector. The result is stored in this vector.
- Parameters:
-
| [in] |
in_vct |
Vector to subtract from this vector. |
- Returns:
- Reference to this vector.
- See also:
- CSIBCVector4Dd::Sub
CSIBCVector4Dd::Add
Subtracts in_vct2 from in_vct1. The result is stored in this vector.
- Parameters:
-
| [in] |
in_vct1 |
First vector for the subtraction. |
| [in] |
in_vct2 |
Second vector for the subtraction. |
- Returns:
- Reference to this vector.
- See also:
- CSIBCVector4Dd::Sub
CSIBCVector4Dd::Add
Multiplies each component of this vector by in_dFactor. The result is stored in this vector.
- Parameters:
-
| [in] |
in_dFactor |
Factor to multiply the components of this vector by. |
- Returns:
- Reference to this vector.
- See also:
- CSIBCVector4Dd::Mul
CSIBCVector4Dd::Div
CSIBCVector4Dd::MulComp
CSIBCVector4Dd::DivComp
Multiplies each of the components in in_vct by in_dFactor. The result is stored in this vector.
- Parameters:
-
| [in] |
in_dFactor |
Factor to multiply the components of in_vct by. |
| [in] |
in_vct |
Vector to multiply. |
- Returns:
- Reference to this vector.
- See also:
- CSIBCVector4Dd::Mul
CSIBCVector4Dd::Div
CSIBCVector4Dd::MulComp
CSIBCVector4Dd::DivComp
Multiplies each of the components in in_vct by in_dFactor. The result is stored in this vector.
- Parameters:
-
| [in] |
in_vct |
Vector to multiply. |
| [in] |
in_dFactor |
Factor to multiply the components of in_vct by. |
- Returns:
- Reference to this vector.
- See also:
- CSIBCVector4Dd::Mul
CSIBCVector4Dd::Div
CSIBCVector4Dd::MulComp
CSIBCVector4Dd::DivComp
Divides each component of this vector by in_dFactor. The result is stored in this vector.
- Parameters:
-
| [in] |
in_dFactor |
Factor to divide the components of this vector by. |
- Returns:
- Reference to this vector.
- See also:
- CSIBCVector4Dd::Div
CSIBCVector4Dd::Mul
CSIBCVector4Dd::DivComp
CSIBCVector4Dd::MulComp
Divides each component of in_vct by in_dFactor. The result is stored in this vector.
- Parameters:
-
| [in] |
in_vct |
Vector to divide. |
| [in] |
in_dFactor |
Factor to divide the components of this vector by. |
- Returns:
- Reference to this vector.
- See also:
- CSIBCVector4Dd::Div
CSIBCVector4Dd::Mul
CSIBCVector4Dd::DivComp
CSIBCVector4Dd::MulComp
Multiplies each component of in_vct1 by the corresponding component in in_vct2. The result is stored in this vector.
- Parameters:
-
| [in] |
in_vct1 |
First vector to multiply the components of. |
| [in] |
in_vct2 |
Second vector to multiply the components of. |
- Returns:
- Reference to this vector.
- See also:
- CSIBCVector4Dd::MulComp
CSIBCVector4Dd::DivComp
CSIBCVector4Dd::Mul
CSIBCVector4Dd::Div
Multiplies each component of in_vct by the corresponding component in this vector. The result is stored in this vector.
- Parameters:
-
| [in] |
in_vct |
Vector to multiply the components of. |
- Returns:
- Reference to this vector.
- See also:
- CSIBCVector4Dd::MulComp
CSIBCVector4Dd::DivComp
CSIBCVector4Dd::Mul
CSIBCVector4Dd::Div
Divides each component of this vector by the corresponding component in in_vct. The result is stored in this vector.
- Parameters:
-
| [in] |
in_vct |
Vector to divide the components of this vector by. |
- Returns:
- Reference to this vector.
- See also:
- CSIBCVector4Dd::DivComp
CSIBCVector4Dd::MulComp
CSIBCVector4Dd::Div
CSIBCVector4Dd::Mul
Divides each component of in_vct1 by the corresponding component in in_vct2. The result is stored in this vector.
- Parameters:
-
| [in] |
in_vct1 |
Vector to be divided by the components of in_vct2 |
| [in] |
in_vct2 |
Vector to divide the components of in_vct1 by. |
- Returns:
- Reference to this vector.
- See also:
- CSIBCVector4Dd::DivComp
CSIBCVector4Dd::MulComp
CSIBCVector4Dd::Div
CSIBCVector4Dd::Mul
Multiplies a this vector (as a row vector), into a 4x4 matrix in_mat (this * in_mat), and stores the result in this vector.
- Parameters:
-
| [in] |
in_mat |
Matrix to multiply (on the right). |
- Returns:
- Reference to this vector.
- See also:
- CSIBCVector4Dd::Mul
CSIBCVector4Dd::MulComp
CSIBCVector4Dd::DivComp
CSIBCVector4Dd::Div
Multiplies a row vector in_vct, into a 4x4 matrix in_mat (in_vct * in_mat), and stores the result in this vector.
- Parameters:
-
| [in] |
in_vct |
Row vector to multiply (on the left). |
| [in] |
in_mat |
Matrix to multiply (on the right). |
- Returns:
- Reference to this vector.
- See also:
- CSIBCVector4Dd::Mul
CSIBCVector4Dd::MulComp
CSIBCVector4Dd::DivComp
CSIBCVector4Dd::Div
Multiplies a 4x4 matrix in_mat, into a column vector, in_vct (in_mat * in_vct), and stores the result in this vector.
- Parameters:
-
| [in] |
in_mat |
Matrix to multiply (on the left). |
| [in] |
in_vct |
Column vector to multiply (on the right). |
- Returns:
- Reference to this vector.
- See also:
- CSIBCVector4Dd::Mul
CSIBCVector4Dd::MulComp
CSIBCVector4Dd::DivComp
CSIBCVector4Dd::Div
Multiplies a row vector in_vct, into a 4x4 transformation matrix in_mat (in_vct * in_mat), and stores the result in this vector.
- Parameters:
-
| [in] |
in_vct |
Row vector to multiply (on the left). |
| [in] |
in_mat |
Rotation matrix to multiply (on the right). |
- Returns:
- Reference to this vector.
- See also:
- CSIBCVector4Dd::Mul
CSIBCVector4Dd::MulComp
CSIBCVector4Dd::DivComp
CSIBCVector4Dd::Div
Multiplies a 4x4 transformation matrix in_mat into a column vector in_vct, (in_mat * in_vct), and stores the result in this vector.
- Parameters:
-
| [in] |
in_mat |
Rotation matrix to multiply (on the left). |
| [in] |
in_vct |
Column vector to multiply (on the right). |
- Returns:
- Reference to this vector.
- See also:
- CSIBCVector4Dd::Mul
CSIBCVector4Dd::MulComp
CSIBCVector4Dd::DivComp
CSIBCVector4Dd::Div
Projects this vector onto in_vct. The projected vector is stored in this vector.
- Parameters:
-
| [in] |
in_vct |
Vector to project this vector onto. |
- Return values:
-
|
|
true |
if the vector is projected |
|
|
false |
if the input vector is the null vector, in which case this vector keeps its original value. |
- See also:
- CSIBCVector4Dd::SetOrthoProj
Friends And Related Function Documentation
Determines whether all corresponding components of the in_vct1 and in_vct2 are equal. Since this method uses floating-point comparison, a threshhold value of in_dEpsilon is used for equality comparison.
- Parameters:
-
| [in] |
in_vct1 |
First vector for equality comparison. |
| [in] |
in_vct2 |
Second vector for equality comparison. |
| [in] |
in_dEpsilon |
Floating-point comparison error range. Defaults to PICO_EPS. |
- Return values:
-
|
|
true |
if the vectors are equal |
|
|
false |
otherwise |
- See also:
- CSIBCVector4Dd::operator==
CSIBCVector4Dd::operator!=
Computes the dot product between the vectors in_vct1 and in_vct2.
- Parameters:
-
| [in] |
in_vct1 |
First vector in the dot product. |
| [in] |
in_vct2 |
Second vector in the dot product. |
- Returns:
- The dot product between
in_vct1 and in_vct2.
Computes the distance between two points in 3D space given by in_pnt1 and in_pnt2.
- Parameters:
-
| [in] |
in_pnt1 |
Starting point for distance calculation. |
| [in] |
in_pnt2 |
Ending point for distance calculation. |
- Returns:
- The scalar distance between the two points, in 3D space.
- See also:
- CSIBCVector4Dd::GetSquaredDistance
Computes the squared distance between two points in 3D space given by in_pnt1 and in_pnt2.
- Parameters:
-
| [in] |
in_pnt1 |
Starting point for distance calculation. |
| [in] |
in_pnt2 |
Ending point for distance calculation. |
- Returns:
- The squared scalar distance between the two points, in 3D space.
- See also:
- CSIBCVector4Dd::GetDistance
The documentation for this class was generated from the following file: