CVector3f Class Reference

A 3-element vector that is represented by single floating point x,y,z coordinates. The class is used used for implementing custom ICE nodes. More...

#include <xsi_vector3f.h>

List of all members.

Public Member Functions

__forceinline  CVector3f ()
__forceinline  CVector3f (float in_fX, float in_fY, float in_fZ)
__forceinline  CVector3f (const CVector3f &in_vector3)
__forceinline  ~CVector3f ()
__forceinline CVector3f operator= (const CVector3f &in_vector3)
__forceinline bool  operator== (const CVector3f &in_vector3) const
__forceinline bool  operator!= (const CVector3f &in_vector3) const
__forceinline CVector3f operator~ ()
__forceinline CVector3f operator+= (const CVector3f &in_vector3)
__forceinline CVector3f operator-= (const CVector3f &in_vector3)
__forceinline CVector3f operator *= (const CMatrix3f &in_matrix3)
__forceinline CVector3f operator *= (const CMatrix4f &in_matrix4)
__forceinline CVector3f operator *= (const float in_fAlpha)
__forceinline float  operator[] (const short &in_sIndex) const
__forceinline float &  operator[] (const short &in_sIndex)
__forceinline bool  operator< (const CVector3f &in_vector3) const
__forceinline CVector3f MulByMatrix3InPlace (const CMatrix3f &in_matrix3)
__forceinline CVector3f MulByMatrix3 (const CVector3f &in_vector3, const CMatrix3f &in_matrix3)
__forceinline CVector3f MulByMatrix4InPlace (const CMatrix4f &in_matrix4)
__forceinline CVector3f MulByMatrix4 (const CVector3f &in_vector3, const CMatrix4f &in_matrix4)
__forceinline CVector3f SetNull ()
__forceinline bool  IsNull (const float in_fEpsilon=MicroEPS)
__forceinline short  GetMaxComponentIndex () const
__forceinline float  GetMaxComponent () const
__forceinline short  GetMinComponentIndex () const
__forceinline float  GetMinComponent () const
__forceinline float  GetLength () const
__forceinline void  SetLength (const float in_val)
__forceinline float  GetLengthSquared () const
__forceinline CStatus  NormalizeInPlace ()
__forceinline CStatus  Normalize (const CVector3f &in_vector3)
__forceinline float  Dot (const CVector3f &in_vector3) const
__forceinline CVector3f Cross (const CVector3f &in_vector3A, const CVector3f &in_vector3B)
__forceinline float  GetAngle (const CVector3f &in_vector3) const
__forceinline CVector3f LinearlyInterpolate (const CVector3f &in_vector3A, const CVector3f &in_vector3B, const float in_fAlpha)
__forceinline CVector3f AbsoluteInPlace ()
__forceinline CVector3f Absolute (const CVector3f &in_vector3)
__forceinline CVector3f ClampInPlace (const float in_fMinValue, const float in_fMaxValue)
__forceinline CVector3f Clamp (const float in_fMinValue, const float in_fMaxValue, const CVector3f &in_vector3)
__forceinline bool  EpsilonEquals (const CVector3f &in_vector3, const float in_fEpsilon) const
__forceinline bool  Equals (const CVector3f &in_vector3) const
__forceinline CVector3f ScaleAddInPlace (const float in_fS, const CVector3f &in_vector3)
__forceinline CVector3f ScaleAdd (const float in_fS, const CVector3f &in_vector3A, const CVector3f &in_vector3B)
__forceinline CVector3f ScaleInPlace (const float in_fAlpha)
__forceinline CVector3f Scale (const float in_fAlpha, const CVector3f &in_vector3)
__forceinline CVector3f NegateInPlace ()
__forceinline CVector3f Negate (const CVector3f &in_vector3)
__forceinline CVector3f SubInPlace (const CVector3f &in_vector3)
__forceinline CVector3f Sub (const CVector3f &in_vector3A, const CVector3f &in_vector3B)
__forceinline CVector3f AddInPlace (const CVector3f &in_vector3)
__forceinline CVector3f Add (const CVector3f &in_vector3A, const CVector3f &in_vector3B)
__forceinline float  Get (const short &in_sIndex) const
__forceinline void  Set (const short &in_sIndex, const float in_val)
__forceinline void  Get (float &io_fX, float &io_fY, float &io_fZ) const
__forceinline CVector3f Set (const float in_fX, const float in_fY, const float in_fZ)
__forceinline float  GetZ () const
__forceinline CVector3f PutZ (const float in_fZ)
__forceinline float  GetY () const
__forceinline CVector3f PutY (const float in_fY)
__forceinline float  GetX () const
__forceinline CVector3f PutX (const float in_fX)


Detailed Description

A 3-element vector that is represented by single floating point x,y,z coordinates. The class is used used for implementing custom ICE nodes.

See also:
CVector2f, CVector4f, CMatrix3f, CMatrix4f, CQuaternionf, CRotationf, CColor4f,


Constructor & Destructor Documentation

__forceinline CVector3f (  ) 

Default constructor.

__forceinline CVector3f ( float  in_fX,
float  in_fY,
float  in_fZ  
)

Constructor.

Parameters:
in_fX  Value of the x component
in_fY  Value of the y component
in_fZ  Value of the z component

__forceinline CVector3f ( const CVector3f in_vector3  ) 

Copy constructor.

Parameters:
in_vector3  constant class object.

__forceinline ~CVector3f (  ) 

Default destructor.


Member Function Documentation

__forceinline CVector3f & operator= ( const CVector3f in_vector3  ) 

Assignment operator.

Parameters:
in_vector3  constant class object.
Returns:
A reference to this vector.

__forceinline bool operator== ( const CVector3f in_vector3  )  const

Equality operator tests the strict equality of this CVector3f with the specified vector3.

Parameters:
in_vector3  Operand vector.
Returns:
true if equal else false.
See also:
CVector3f::Equals

__forceinline bool operator!= ( const CVector3f in_vector3  )  const

Inequality operator tests the strict inequality of this CVector3f with the specified vector3.

Parameters:
in_vector3  Operand vector.
Returns:
true if equal else false.
See also:
CVector3f::Equals

__forceinline CVector3f & operator~ (  ) 

Negates this vector (this = - this).

Returns:
A reference to this vector.
See also:
CVector3f::NegateInPlace

__forceinline CVector3f & operator+= ( const CVector3f in_vector3  ) 

Adds the input vector to this one (this = this + in_vector3)

Parameters:
in_vector3  Operand vector..
Returns:
A reference to this vector.
See also:
CVector3f::AddInPlace

__forceinline CVector3f & operator-= ( const CVector3f in_vector3  ) 

Subtracts the input vector (in_vector3) from this one (this = this - in_vector3).

Parameters:
in_vector3  Operand vector.
Returns:
A reference to this vector.
See also:
CVector3f::SubInPlace

__forceinline CVector3f & operator *= ( const CMatrix3f in_matrix3  ) 

Right-multiplies this vector by the matrix m in place (this = this * m ).

Parameters:
in_matrix3  Operand matrix.
Returns:
A reference to this vector.
See also:
CVector3f::MulByMatrix3InPlace

__forceinline CVector3f & operator *= ( const CMatrix4f in_matrix4  ) 

Right-multiplies this vector by the matrix m in place (this = this * m ).

Parameters:
in_matrix4  Operand matrix.
Returns:
A reference to this vector.
See also:
CVector3f::MulByMatrix4InPlace

__forceinline CVector3f & operator *= ( const float  in_fAlpha  ) 

Scales this vector by the input scalar (alpha) (this = alpha * this).

Parameters:
in_fAlpha  Scalar multiplicator.
Returns:
A reference to this vector.
See also:
CVector3f::ScaleInPlace

__forceinline float operator[] ( const short &  in_sIndex  )  const

Read-only accessors to the X,Y,Z components.

Parameters:
in_sIndex  0,1,2 for X,Y and Z values.
Returns:
The value of the specified component. If the index supplied is out of range the function returns FLT_MAX.
See also:
CVector3f::GetX(), CVector3f::GetY(), CVector3f::GetZ()

__forceinline float & operator[] ( const short &  in_sIndex  ) 

Accessor to the X,Y,Z components.

Parameters:
in_sIndex  0,1,2 for X,Y and Z values.
Returns:
The value of the specified component. If the index supplied is out of range the function returns FLT_MAX.
See also:
CVector3f::GetX(), CVector3f::GetY(), CVector3f::GetZ()

__forceinline bool operator< ( const CVector3f in_vector3  )  const

Less than operator. Performs a comparison with a specified CVector3f to determine if this CVector3f is less than the specified CVector3f. The comparison is arbitrary and not geometrically meaningful, it's only purpose is to make CVector3f compliant with stl for sorting operations.

Parameters:
in_vector3  CVector3f to compare.
Returns:
true if this CVector3f is less than the specified CVector3f, false otherwise.
Since:
7.5

__forceinline CVector3f & MulByMatrix3InPlace ( const CMatrix3f in_matrix3  ) 

Right-multiplies this vector by the matrix m in place (this = this * m ).

Parameters:
in_matrix3  Operand matrix.
Returns:
A reference to this vector.

__forceinline CVector3f & MulByMatrix3 ( const CVector3f in_vector3,
const CMatrix3f in_matrix3  
)

Right-multiplies the vector v by the matrix m and store the result in this vector (this = v * m ).

Parameters:
in_vector3  Operand vector
in_matrix3  Operand matrix.
Returns:
A reference to this vector.

__forceinline CVector3f & MulByMatrix4InPlace ( const CMatrix4f in_matrix4  ) 

Right-multiplies this vector by the matrix m in place (this = this * m ).

Parameters:
in_matrix4  Operand matrix.
Returns:
A reference to this vector.

__forceinline CVector3f & MulByMatrix4 ( const CVector3f in_vector3,
const CMatrix4f in_matrix4  
)

Right-multiplies the vector v by the matrix m and store the result in this vector (this = v * m ).

Parameters:
in_vector3  Operand vector
in_matrix4  Operand matrix.
Returns:
A reference to this vector.

__forceinline CVector3f & SetNull (  ) 

Sets this vector to a null vector.

Returns:
A reference to this vector.

__forceinline bool IsNull ( const float  in_fEpsilon = MicroEPS  ) 

Returns true if the vector is a null vector

Parameters:
in_fEpsilon  Tolerance value
Returns:
Bool value.

__forceinline short GetMaxComponentIndex (  )  const

Returns the index of the maximum component of this vector.

Returns:
Index of the maximum component of this vector.

__forceinline float GetMaxComponent (  )  const

Returns the maximum component value of this vector.

Returns:
Maximum component value of this vector.

__forceinline short GetMinComponentIndex (  )  const

Returns the index of the minimum component of this vector.

Returns:
Index of the minimum component of this vector.

__forceinline float GetMinComponent (  )  const

Returns the minimum component value of this vector.

Returns:
Minimum component value of this vector.

__forceinline float GetLength (  )  const

Returns the length of this vector.

Returns:
Length of this vector.

__forceinline void SetLength ( const float  in_val  ) 

Scales the vector to set its length.

Parameters:
in_val  Length to set

__forceinline float GetLengthSquared (  )  const

Returns the squared length of this vector.

Returns:
Squared length of this vector.

__forceinline CStatus NormalizeInPlace (  ) 

Normalizes this vector in place.

Returns:
CStatus::OK if the normalization has been computed,

__forceinline CStatus Normalize ( const CVector3f in_vector3  ) 

Sets the value of this vector to the normalization of input vector.

Parameters:
in_vector3  vector operand.
Returns:
CStatus::OK if the normalization has been computed.

__forceinline float Dot ( const CVector3f in_vector3  )  const

Returns the dot product of this vector and the input vector.

Parameters:
in_vector3  vector operand.
Returns:
Dot product of this vector and vector in_vector3.

__forceinline CVector3f & Cross ( const CVector3f in_vector3A,
const CVector3f in_vector3B  
)

Sets this vector to the vector cross product of vectors A and B.

Parameters:
in_vector3A  vector operand.
in_vector3B  vector operand.
Returns:
A reference to this vector.

__forceinline float GetAngle ( const CVector3f in_vector3  )  const

Returns the angle (in radians) between this vector and the input vector.

Parameters:
in_vector3  vector operand.
Returns:
Angle (in radians) between this vector and the input vector.

__forceinline CVector3f & LinearlyInterpolate ( const CVector3f in_vector3A,
const CVector3f in_vector3B,
const float  in_fAlpha  
)

Linearly interpolates between vectors A and B and places the result into this vector: this = (1-alpha)*A + alpha*B.

Parameters:
in_vector3A  vector operand.
in_vector3B  vector operand.
in_fAlpha  Scalar interpolator
Possible Values: [0.0, 1.0] Domain of validity
Returns:
A reference to this vector.

__forceinline CVector3f & AbsoluteInPlace (  ) 

Sets each component of this CVector3 to its absolute value.

Returns:
A reference to this vector.

__forceinline CVector3f & Absolute ( const CVector3f in_vector3  ) 

Sets each component of the specified vector to its absolute value and places the modified values into this vector.

Parameters:
in_vector3  Vector to make absolute
Returns:
A reference to this vector.

__forceinline CVector3f & ClampInPlace ( const float  in_fMinValue,
const float  in_fMaxValue  
)

Clamps this vector's components to the range [MinValue, MaxValue].

Parameters:
in_fMinValue  Lower bound of the clamping domain.
in_fMaxValue  Higher bound of the clamping domain.
Returns:
A reference to this vector.

__forceinline CVector3f& Clamp ( const float  in_fMinValue,
const float  in_fMaxValue,
const CVector3f in_vector3  
)

Clamps the specified vector's components to the range [MinValue, MaxValue] and places the values into this vector3.

Parameters:
in_fMinValue  Lower bound of the clamping domain.
in_fMaxValue  Higher bound of the clamping domain.
in_vector3  Operand vector.
Returns:
A reference to this vector.

__forceinline bool EpsilonEquals ( const CVector3f in_vector3,
const float  in_fEpsilon  
) const

Tests the equality of this vector with the specified vector3, with a tolerance of Epsilon.

Parameters:
in_vector3  Operand vector.
in_fEpsilon  Error margin (validity domain: [0, +INF[)
Returns:
true if equal else false.

__forceinline bool Equals ( const CVector3f in_vector3  )  const

Tests the strict equality of this vector with the specified vector3.

Parameters:
in_vector3  Operand vector.
Returns:
true if equal else false.

__forceinline CVector3f & ScaleAddInPlace ( const float  in_fS,
const CVector3f in_vector3  
)

Sets the value of this vector to the scalar multiplication of itself by s and then adds vector3 v. (this = s*this + v)

Parameters:
in_fS  Scalar multiplicator.
in_vector3  Operand vector.
Returns:
A reference to this vector.

__forceinline CVector3f & ScaleAdd ( const float  in_fS,
const CVector3f in_vector3A,
const CVector3f in_vector3B  
)

Sets the value of this vector to the scalar multiplication of vector3 A by s and then adds vector3 B. (this = s*v1 + v2).

Parameters:
in_fS  Scalar multiplicator.
in_vector3A  Operand vector.
in_vector3B  Operand vector.
Returns:
A reference to this vector.

__forceinline CVector3f & ScaleInPlace ( const float  in_fAlpha  ) 

Scales this vector by the input scalar (alpha) (this = alpha * this).

Parameters:
in_fAlpha  Scalar multiplicator.
Returns:
A reference to this vector.

__forceinline CVector3f & Scale ( const float  in_fAlpha,
const CVector3f in_vector3  
)

Scales the input vector (v) by (alpha) store the result into this one (this = alpha * v).

Parameters:
in_fAlpha  Scalar multiplicator.
in_vector3  Operand vector.
Returns:
A reference to this vector.

__forceinline CVector3f & NegateInPlace (  ) 

Negates this vector (this = - this).

Returns:
A reference to this vector.

__forceinline CVector3f & Negate ( const CVector3f in_vector3  ) 

Negates the input vector (v) store the result into this one (this = - v).

Parameters:
in_vector3  Operand vector.
Returns:
A reference to this vector.

__forceinline CVector3f & SubInPlace ( const CVector3f in_vector3  ) 

Subtracts the input vector3 (v) from this one (this = this - v).

Parameters:
in_vector3  Operand vector.
Returns:
A reference to this vector.

__forceinline CVector3f & Sub ( const CVector3f in_vector3A,
const CVector3f in_vector3B  
)

Subtracts the input vector3 (A) from the input vector3 (B) and stores the result into this one (this = A - B).

Parameters:
in_vector3A  Operand vector.
in_vector3B  Operand vector.
Returns:
A reference to this vector.

__forceinline CVector3f & AddInPlace ( const CVector3f in_vector3  ) 

Adds the input vector to this one (this = this + in_vector3).

Parameters:
in_vector3  Operand vector.
Returns:
A reference to this vector.

__forceinline CVector3f & Add ( const CVector3f in_vector3A,
const CVector3f in_vector3B  
)

Adds both input vectors and stores the result in this one. (this = A + B)

Parameters:
in_vector3A  Operand vector.
in_vector3B  Operand vector.
Returns:
A reference to this vector.

__forceinline float Get ( const short &  in_sIndex  )  const

Accessor to the X,Y,Z components.

Parameters:
in_sIndex  0,1,2 for X,Y and Z values.
Returns:
The value of the specified component. If the index supplied is out of range the function returns FLT_MAX.
See also:
CVector3f::GetX(), CVector3f::GetY(), CVector3f::GetZ()

__forceinline void Set ( const short &  in_sIndex,
const float  in_val  
)

Accessor to the X,Y,Z components.

Parameters:
in_sIndex  0,1,2 for X,Y and Z values.
in_val  The value of the specified component.
See also:
CVector3f::Get(), CVector3f::GetY(), CVector3f::GetZ()

__forceinline void Get ( float &  io_fX,
float &  io_fY,
float &  io_fZ  
) const

Returns the X, Y and Z values of the vector.

Parameters:
io_fX  X value to get in the vector.
io_fY  Y value to get in the vector.
io_fZ  Z value to get in the vector.

__forceinline CVector3f & Set ( const float  in_fX,
const float  in_fY,
const float  in_fZ  
)

Sets the X, Y and Z values of the vector.

Parameters:
in_fX  X value to set in the vector.
in_fY  Y value to set in the vector.
in_fZ  Z value to set in the vector.
Returns:
A reference to the vector.

__forceinline float GetZ (  )  const

Returns the Z value of this vector.

Returns:
Z value of this vector.

__forceinline CVector3f & PutZ ( const float  in_fZ  ) 

Sets the Z value of this vector.

Parameters:
in_fZ  z value.
Returns:
A reference to this vector.

__forceinline float GetY (  )  const

Returns the Y value of this vector.

Returns:
Y value of this vector.

__forceinline CVector3f & PutY ( const float  in_fY  ) 

Sets the Y value of this vector.

Parameters:
in_fY  y value.
Returns:
A reference to this vector.

__forceinline float GetX (  )  const

Returns the X value of this vector.

Returns:
X value of this vector.

__forceinline CVector3f & PutX ( const float  in_fX  ) 

Sets the X value of this vector.

Parameters:
in_fX  x value.
Returns:
A reference to this vector.


The documentation for this class was generated from the following file: