ADTF_DISPLAY_TOOLBOX  3.8.0 (ADTF 3.14.3)
cVector3

3D vector class. More...

Inheritance diagram for cVector3:
[legend]

Public Member Functions

 cVector3 ()
 Constructor.
 
 cVector3 (const IVector3 *pVector3)
 constructor from IVector3 More...
 
 cVector3 (const tFloat64 f64X, const tFloat64 f64Y, const tFloat64 f64Z)
 Constructor. More...
 
tVoid Release ()
 Releases this vector.
 
OPT_INLINE void Set (const cVector3 &Vector)
 Set vector to the given value. More...
 
OPT_INLINE void Set (const tFloat64 Value)
 Set vector to the given value. More...
 
OPT_INLINE void Set (const tFloat64 f64X, const tFloat64 f64Y, const tFloat64 f64Z)
 Set vector to the given value. More...
 
OPT_INLINE void Zero ()
 Set vector to zero.
 
OPT_INLINE void Add (const cVector3 &Vector)
 Add the given vector to the current one. More...
 
OPT_INLINE void Sub (const cVector3 &Vector)
 Subtract the given vector from the current one. More...
 
OPT_INLINE void Scale (const tFloat64 Value)
 Scale the current vector by the given value. More...
 
OPT_INLINE void Scale (const cVector3 &Vector)
 Scale the current vector by the given one. More...
 
OPT_INLINE cVector3 Scalar (const cVector3 &Vector) const
 Multiply every coordinate of the current vector with the corresponding coordinate from the given one. More...
 
OPT_INLINE cVector3 Multiply (const cVector3 &Vector) const
 Cross product of the current vector and the given one. More...
 
tFloat Length () const
 Calculate the length of the current vector. More...
 
void Normalize ()
 Normalize the current vector so that the length becomes one.
 
void Dump ()
 Dump the current vector to stdout.
 
tFloat64 GetX () const
 gets the value of the x component More...
 
tVoid SetX (tFloat64 xValue)
 Set the current x value to the given one. More...
 
tFloat64 GetY () const
 gets the value of the y component More...
 
tVoid SetY (tFloat64 f64YValue)
 Set the current y value to the given one. More...
 
tFloat64 GetZ () const
 gets the value of the z component More...
 
tVoid SetZ (tFloat64 zValue)
 Set the current z value to the given one. More...
 
cVector3 operator= (const cVector3 &v)
 Set the current vector to the given one. More...
 
cVector3 operator- (void)
 Negate the current vector. More...
 
 operator IVector3 * ()
 instance of IVector3 More...
 
- Public Member Functions inherited from IVector3
virtual ~IVector3 ()
 virtual destructor to ensure proper cleanup.
 

Static Public Attributes

static const cVector3 Null
 Null vector.
 
static const cVector3 One
 Identity vector.
 

Private Attributes

tFloat64 x
 X coordinate of vector.
 
tFloat64 y
 Y coordinate of vector.
 
tFloat64 z
 Z coordinate of vector.
 

Static Private Attributes

static const tFloat64 nullScalar
 scalar null value
 
static const tFloat64 oneScalar
 scalar identity value
 

Detailed Description

3D vector class.

Definition at line 29 of file vector3.h.

Constructor & Destructor Documentation

◆ cVector3() [1/2]

cVector3 ( const IVector3 pVector3)

constructor from IVector3

Parameters
[in]pVector3Vector3

◆ cVector3() [2/2]

cVector3 ( const tFloat64  f64X,
const tFloat64  f64Y,
const tFloat64  f64Z 
)

Constructor.

Parameters
f64X[in] X coordinate of vector.
f64Y[in] Y coordinate of vector.
f64Z[in] Z coordinate of vector.

Member Function Documentation

◆ Add()

OPT_INLINE void Add ( const cVector3 Vector)

Add the given vector to the current one.

Parameters
Vector[in] Vector to add.

◆ GetX()

tFloat64 GetX ( ) const
virtual

gets the value of the x component

Returns
value of x component

Implements IVector3.

◆ GetY()

tFloat64 GetY ( ) const
virtual

gets the value of the y component

Returns
value of y component

Implements IVector3.

◆ GetZ()

tFloat64 GetZ ( ) const
virtual

gets the value of the z component

Returns
value of z component

Implements IVector3.

◆ Length()

tFloat Length ( ) const
virtual

Calculate the length of the current vector.

Returns
Length of the current vector.

Implements IVector3.

◆ Multiply()

OPT_INLINE cVector3 Multiply ( const cVector3 Vector) const

Cross product of the current vector and the given one.

Parameters
Vector[in] Vector for multiplication.
Returns
New vector.

◆ operator IVector3 *()

operator IVector3 * ( )
inlineexplicit

instance of IVector3

Returns
object

Definition at line 329 of file vector3.h.

◆ operator-()

cVector3 operator- ( void  )
inline

Negate the current vector.

Returns
New vector.

Definition at line 225 of file vector3.h.

References cVector3::cVector3(), cVector3::x, cVector3::y, and cVector3::z.

◆ operator=()

cVector3 operator= ( const cVector3 v)

Set the current vector to the given one.

Parameters
v[in] Vector.
Returns
New vector.

◆ Scalar()

OPT_INLINE cVector3 Scalar ( const cVector3 Vector) const

Multiply every coordinate of the current vector with the corresponding coordinate from the given one.

Parameters
Vector[in] Vector for multiplication.
Returns
New vector.

◆ Scale() [1/2]

OPT_INLINE void Scale ( const cVector3 Vector)

Scale the current vector by the given one.

Parameters
Vector[in] Vector with scaling factors.

◆ Scale() [2/2]

OPT_INLINE void Scale ( const tFloat64  Value)

Scale the current vector by the given value.

Parameters
Value[in] Scaling factor.

◆ Set() [1/3]

OPT_INLINE void Set ( const cVector3 Vector)

Set vector to the given value.

Parameters
Vector[in] Value for vector.

◆ Set() [2/3]

OPT_INLINE void Set ( const tFloat64  f64X,
const tFloat64  f64Y,
const tFloat64  f64Z 
)

Set vector to the given value.

Parameters
f64X[in] X value for vector.
f64Y[in] Y value for vector.
f64Z[in] Z value for vector.

◆ Set() [3/3]

OPT_INLINE void Set ( const tFloat64  Value)

Set vector to the given value.

Parameters
Value[in] Value for vector.

◆ SetX()

tVoid SetX ( tFloat64  xValue)
virtual

Set the current x value to the given one.

Parameters
xValue[in] x value to set
Returns
void

Implements IVector3.

◆ SetY()

tVoid SetY ( tFloat64  f64YValue)
virtual

Set the current y value to the given one.

Parameters
f64YValue[in] y value to set
Returns
void

Implements IVector3.

◆ SetZ()

tVoid SetZ ( tFloat64  zValue)
virtual

Set the current z value to the given one.

Parameters
zValue[in] z value to set
Returns
void

Implements IVector3.

◆ Sub()

OPT_INLINE void Sub ( const cVector3 Vector)

Subtract the given vector from the current one.

Parameters
Vector[in] Vector to subtract.