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.
#include <xsi_vector3f.h>
Public Member Functions |
|
SICPPSDK_INLINE | CVector3f () |
SICPPSDK_INLINE | CVector3f (float in_fX, float in_fY, float in_fZ) |
SICPPSDK_INLINE | CVector3f (const CVector3f &in_vector3) |
SICPPSDK_INLINE | ~CVector3f () |
SICPPSDK_INLINE CVector3f & | operator= (const CVector3f &in_vector3) |
SICPPSDK_INLINE bool | operator== (const CVector3f &in_vector3) const |
SICPPSDK_INLINE bool | operator!= (const CVector3f &in_vector3) const |
SICPPSDK_INLINE CVector3f & | operator~ () |
SICPPSDK_INLINE CVector3f & | operator+= (const CVector3f &in_vector3) |
SICPPSDK_INLINE CVector3f & | operator-= (const CVector3f &in_vector3) |
SICPPSDK_INLINE CVector3f & | operator*= (const CMatrix3f &in_matrix3) |
SICPPSDK_INLINE CVector3f & | operator*= (const CMatrix4f &in_matrix4) |
SICPPSDK_INLINE CVector3f & | operator*= (const float in_fAlpha) |
SICPPSDK_INLINE float | operator[] (const short &in_sIndex) const |
SICPPSDK_INLINE float & | operator[] (const short &in_sIndex) |
SICPPSDK_INLINE bool | operator< (const CVector3f &in_vector3) const |
SICPPSDK_INLINE CVector3f & | MulByMatrix3InPlace (const CMatrix3f &in_matrix3) |
SICPPSDK_INLINE CVector3f & | MulByMatrix3 (const CVector3f &in_vector3, const CMatrix3f &in_matrix3) |
SICPPSDK_INLINE CVector3f & | MulByMatrix4InPlace (const CMatrix4f &in_matrix4) |
SICPPSDK_INLINE CVector3f & | MulByMatrix4 (const CVector3f &in_vector3, const CMatrix4f &in_matrix4) |
SICPPSDK_INLINE CVector3f & | SetNull () |
SICPPSDK_INLINE bool | IsNull (const float in_fEpsilon=MicroEPS) |
SICPPSDK_INLINE short | GetMaxComponentIndex () const |
SICPPSDK_INLINE float | GetMaxComponent () const |
SICPPSDK_INLINE short | GetMinComponentIndex () const |
SICPPSDK_INLINE float | GetMinComponent () const |
SICPPSDK_INLINE float | GetLength () const |
SICPPSDK_INLINE void | SetLength (const float in_val) |
SICPPSDK_INLINE float | GetLengthSquared () const |
SICPPSDK_INLINE CStatus | NormalizeInPlace () |
SICPPSDK_INLINE CStatus | Normalize (const CVector3f &in_vector3) |
SICPPSDK_INLINE float | Dot (const CVector3f &in_vector3) const |
SICPPSDK_INLINE CVector3f & | Cross (const CVector3f &in_vector3A, const CVector3f &in_vector3B) |
SICPPSDK_INLINE float | GetAngle (const CVector3f &in_vector3) const |
SICPPSDK_INLINE CVector3f & | LinearlyInterpolate (const CVector3f &in_vector3A, const CVector3f &in_vector3B, const float in_fAlpha) |
SICPPSDK_INLINE CVector3f & | AbsoluteInPlace () |
SICPPSDK_INLINE CVector3f & | Absolute (const CVector3f &in_vector3) |
SICPPSDK_INLINE CVector3f & | ClampInPlace (const float in_fMinValue, const float in_fMaxValue) |
SICPPSDK_INLINE CVector3f & | Clamp (const float in_fMinValue, const float in_fMaxValue, const CVector3f &in_vector3) |
SICPPSDK_INLINE bool | EpsilonEquals (const CVector3f &in_vector3, const float in_fEpsilon) const |
SICPPSDK_INLINE bool | Equals (const CVector3f &in_vector3) const |
SICPPSDK_INLINE CVector3f & | ScaleAddInPlace (const float in_fS, const CVector3f &in_vector3) |
SICPPSDK_INLINE CVector3f & | ScaleAdd (const float in_fS, const CVector3f &in_vector3A, const CVector3f &in_vector3B) |
SICPPSDK_INLINE CVector3f & | ScaleInPlace (const float in_fAlpha) |
SICPPSDK_INLINE CVector3f & | Scale (const float in_fAlpha, const CVector3f &in_vector3) |
SICPPSDK_INLINE CVector3f & | NegateInPlace () |
SICPPSDK_INLINE CVector3f & | Negate (const CVector3f &in_vector3) |
SICPPSDK_INLINE CVector3f & | SubInPlace (const CVector3f &in_vector3) |
SICPPSDK_INLINE CVector3f & | Sub (const CVector3f &in_vector3A, const CVector3f &in_vector3B) |
SICPPSDK_INLINE CVector3f & | AddInPlace (const CVector3f &in_vector3) |
SICPPSDK_INLINE CVector3f & | Add (const CVector3f &in_vector3A, const CVector3f &in_vector3B) |
SICPPSDK_INLINE float | Get (const short &in_sIndex) const |
SICPPSDK_INLINE void | Set (const short &in_sIndex, const float in_val) |
SICPPSDK_INLINE void | Get (float &io_fX, float &io_fY, float &io_fZ) const |
SICPPSDK_INLINE CVector3f & | Set (const float in_fX, const float in_fY, const float in_fZ) |
SICPPSDK_INLINE float | GetZ () const |
SICPPSDK_INLINE CVector3f & | PutZ (const float in_fZ) |
SICPPSDK_INLINE float | GetY () const |
SICPPSDK_INLINE CVector3f & | PutY (const float in_fY) |
SICPPSDK_INLINE float | GetX () const |
SICPPSDK_INLINE CVector3f & | PutX (const float in_fX) |
SICPPSDK_INLINE CVector3f | ( | ) |
Default constructor.
SICPPSDK_INLINE CVector3f | ( | float | in_fX, |
float | in_fY, | ||
float | in_fZ | ||
) |
Constructor.
in_fX | Value of the x component |
in_fY | Value of the y component |
in_fZ | Value of the z component |
Copy constructor.
in_vector3 | constant class object. |
SICPPSDK_INLINE ~CVector3f | ( | ) |
Default destructor.
Assignment operator.
in_vector3 | constant class object. |
SICPPSDK_INLINE bool operator== | ( | const CVector3f & | in_vector3 | ) | const |
Equality operator tests the strict equality of this CVector3f with the specified vector3.
in_vector3 | Operand vector. |
SICPPSDK_INLINE bool operator!= | ( | const CVector3f & | in_vector3 | ) | const |
Inequality operator tests the strict inequality of this CVector3f with the specified vector3.
in_vector3 | Operand vector. |
SICPPSDK_INLINE CVector3f & operator~ | ( | ) |
Negates this vector (this = - this).
Adds the input vector to this one (this = this + in_vector3)
in_vector3 | Operand vector.. |
Subtracts the input vector (in_vector3) from this one (this = this - in_vector3).
in_vector3 | Operand vector. |
Right-multiplies this vector by the matrix m in place (this = this * m ).
in_matrix3 | Operand matrix. |
Right-multiplies this vector by the matrix m in place (this = this * m ).
in_matrix4 | Operand matrix. |
SICPPSDK_INLINE CVector3f & operator*= | ( | const float | in_fAlpha | ) |
Scales this vector by the input scalar (alpha) (this = alpha * this).
in_fAlpha | Scalar multiplicator. |
SICPPSDK_INLINE float operator[] | ( | const short & | in_sIndex | ) | const |
Read-only accessors to the X,Y,Z components.
in_sIndex | 0,1,2 for X,Y and Z values. |
SICPPSDK_INLINE float & operator[] | ( | const short & | in_sIndex | ) |
Accessor to the X,Y,Z components.
in_sIndex | 0,1,2 for X,Y and Z values. |
SICPPSDK_INLINE 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.
in_vector3 | CVector3f to compare. |
Right-multiplies this vector by the matrix m in place (this = this * m ).
in_matrix3 | Operand matrix. |
SICPPSDK_INLINE 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 ).
in_vector3 | Operand vector |
in_matrix3 | Operand matrix. |
Right-multiplies this vector by the matrix m in place (this = this * m ).
in_matrix4 | Operand matrix. |
SICPPSDK_INLINE 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 ).
in_vector3 | Operand vector |
in_matrix4 | Operand matrix. |
SICPPSDK_INLINE CVector3f & SetNull | ( | ) |
Sets this vector to a null vector.
SICPPSDK_INLINE bool IsNull | ( | const float | in_fEpsilon =
MicroEPS |
) |
Returns true if the vector is a null vector
in_fEpsilon | Tolerance value |
SICPPSDK_INLINE short GetMaxComponentIndex | ( | ) | const |
Returns the index of the maximum component of this vector.
SICPPSDK_INLINE float GetMaxComponent | ( | ) | const |
Returns the maximum component value of this vector.
SICPPSDK_INLINE short GetMinComponentIndex | ( | ) | const |
Returns the index of the minimum component of this vector.
SICPPSDK_INLINE float GetMinComponent | ( | ) | const |
Returns the minimum component value of this vector.
SICPPSDK_INLINE float GetLength | ( | ) | const |
Returns the length of this vector.
SICPPSDK_INLINE void SetLength | ( | const float | in_val | ) |
Scales the vector to set its length.
in_val | Length to set |
SICPPSDK_INLINE float GetLengthSquared | ( | ) | const |
Returns the squared length of this vector.
SICPPSDK_INLINE CStatus NormalizeInPlace | ( | ) |
Normalizes this vector in place.
Sets the value of this vector to the normalization of input vector.
in_vector3 | vector operand. |
SICPPSDK_INLINE float Dot | ( | const CVector3f & | in_vector3 | ) | const |
Returns the dot product of this vector and the input vector.
in_vector3 | vector operand. |
Sets this vector to the vector cross product of vectors A and B.
in_vector3A | vector operand. |
in_vector3B | vector operand. |
SICPPSDK_INLINE float GetAngle | ( | const CVector3f & | in_vector3 | ) | const |
Returns the angle (in radians) between this vector and the input vector.
in_vector3 | vector operand. |
SICPPSDK_INLINE 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.
in_vector3A | vector operand. |
in_vector3B | vector operand. |
in_fAlpha | Scalar interpolator Possible Values: [0.0, 1.0] Domain of validity |
SICPPSDK_INLINE CVector3f & AbsoluteInPlace | ( | ) |
Sets each component of this CVector3 to its absolute value.
Sets each component of the specified vector to its absolute value and places the modified values into this vector.
in_vector3 | Vector to make absolute |
SICPPSDK_INLINE CVector3f & ClampInPlace | ( | const float | in_fMinValue, |
const float | in_fMaxValue | ||
) |
Clamps this vector's components to the range [MinValue, MaxValue].
in_fMinValue | Lower bound of the clamping domain. |
in_fMaxValue | Higher bound of the clamping domain. |
SICPPSDK_INLINE 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.
in_fMinValue | Lower bound of the clamping domain. |
in_fMaxValue | Higher bound of the clamping domain. |
in_vector3 | Operand vector. |
SICPPSDK_INLINE 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.
in_vector3 | Operand vector. |
in_fEpsilon | Error margin (validity domain: [0, +INF[ ) |
SICPPSDK_INLINE bool Equals | ( | const CVector3f & | in_vector3 | ) | const |
Tests the strict equality of this vector with the specified vector3.
in_vector3 | Operand vector. |
Sets the value of this vector to the scalar multiplication of
itself by s and then adds vector3 v. (this = s*this +
v
)
in_fS | Scalar multiplicator. |
in_vector3 | Operand vector. |
SICPPSDK_INLINE 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
).
in_fS | Scalar multiplicator. |
in_vector3A | Operand vector. |
in_vector3B | Operand vector. |
SICPPSDK_INLINE CVector3f & ScaleInPlace | ( | const float | in_fAlpha | ) |
Scales this vector by the input scalar (alpha) (this = alpha * this).
in_fAlpha | Scalar multiplicator. |
Scales the input vector (v) by (alpha) store the result into this one (this = alpha * v).
in_fAlpha | Scalar multiplicator. |
in_vector3 | Operand vector. |
SICPPSDK_INLINE CVector3f & NegateInPlace | ( | ) |
Negates this vector (this = - this).
Negates the input vector (v) store the result into this one (this = - v).
in_vector3 | Operand vector. |
Subtracts the input vector3 (v) from this one (this = this - v).
in_vector3 | Operand vector. |
Subtracts the input vector3 (in_vector3B
) from the
input vector3 (in_vector3A
) and stores the result into
this one (this = A - B
).
in_vector3A | Operand vector. |
in_vector3B | Operand vector. |
Adds the input vector to this one (this = this + in_vector3).
in_vector3 | Operand vector. |
Adds both input vectors and stores the result in this one. (this = A + B)
in_vector3A | Operand vector. |
in_vector3B | Operand vector. |
SICPPSDK_INLINE float Get | ( | const short & | in_sIndex | ) | const |
Accessor to the X,Y,Z components.
in_sIndex | 0,1,2 for X,Y and Z values. |
SICPPSDK_INLINE void Set | ( | const short & | in_sIndex, |
const float | in_val | ||
) |
Accessor to the X,Y,Z components.
in_sIndex | 0,1,2 for X,Y and Z values. |
in_val | The value of the specified component. |
SICPPSDK_INLINE void Get | ( | float & | io_fX, |
float & | io_fY, | ||
float & | io_fZ | ||
) | const |
Returns the X, Y and Z values of the vector.
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. |
SICPPSDK_INLINE CVector3f & Set | ( | const float | in_fX, |
const float | in_fY, | ||
const float | in_fZ | ||
) |
Sets the X, Y and Z values of the vector.
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. |
SICPPSDK_INLINE float GetZ | ( | ) | const |
Returns the Z value of this vector.
SICPPSDK_INLINE CVector3f & PutZ | ( | const float | in_fZ | ) |
Sets the Z value of this vector.
in_fZ | z value. |
SICPPSDK_INLINE float GetY | ( | ) | const |
Returns the Y value of this vector.
SICPPSDK_INLINE CVector3f & PutY | ( | const float | in_fY | ) |
Sets the Y value of this vector.
in_fY | y value. |
SICPPSDK_INLINE float GetX | ( | ) | const |
Returns the X value of this vector.
SICPPSDK_INLINE CVector3f & PutX | ( | const float | in_fX | ) |
Sets the X value of this vector.
in_fX | x value. |