Murl::Math::VectorUninitialized< DataType > Class Template Reference

A 4-component uninitialized vector class. More...

#include "murl_math_vector.h"

Inheritance diagram for Murl::Math::VectorUninitialized< DataType >:

Public Member Functions

 VectorUninitialized ()
 The default constructor. More...
 
template<class DataType2 >
 VectorUninitialized (const Vector< DataType2 > &v)
 The copy constructor using a vector of different type. More...
 
- Public Member Functions inherited from Murl::Math::Vector< DataType >
 Vector ()
 The default constructor.
 
template<class DataType2 >
 Vector (const Vector< DataType2 > &v)
 The copy constructor using a vector of different type. More...
 
 Vector (DataType vx, DataType vy, DataType vz, DataType vw)
 Constructor to initialize a vector with given component values. More...
 
 Vector (const Quaternion< DataType > &q)
 Constructor to initialize an axis/angle vector from a quaternion. More...
 
 Vector (PredefinedType type)
 Constructor to create a vector from a predefined type. More...
 
const DataType & operator[] (UInt32 index) const
 Get a const reference to one of the 4 component values. More...
 
DataType & operator[] (UInt32 index)
 Get a reference to one of the 4 component values. More...
 
const DataType * GetPointer () const
 Get a const pointer to the raw data. More...
 
DataType * GetPointer ()
 Get a pointer to the raw data. More...
 
Vectoroperator+= (const Vector &v)
 In-place addition operator. More...
 
Vectoroperator-= (const Vector &v)
 In-place subtraction operator. More...
 
Vectoroperator*= (DataType v)
 In-place multiplication operator (scaling). More...
 
Vectoroperator*= (const Vector &v)
 In-place component-wise multiplication operator. More...
 
Vectoroperator/= (DataType v)
 In-place division operator (inverse scaling). More...
 
Vectoroperator/= (const Vector &v)
 In-place component-wise division operator. More...
 
Vector operator+ (const Vector &rhs) const
 Addition operator. More...
 
Vector operator- (const Vector &rhs) const
 Subtraction operator. More...
 
Vector operator* (DataType rhs) const
 Multiplication (scaling) operator. More...
 
Vector operator* (const Vector &rhs) const
 Component-wise multiplication operator. More...
 
Vector operator/ (DataType rhs) const
 Division (inverse scaling) operator. More...
 
Vector operator/ (const Vector &rhs) const
 Component-wise division operator. More...
 
Vector operator- () const
 Inversion (negation) operator. More...
 
Quaternion< DataType > operator* (const Quaternion< DataType > &rhs) const
 Multiplication operator for quaternion. More...
 
void Clear ()
 Clear all components of the vector instance. More...
 
void Set (PredefinedType type)
 Set all components of the vector instance to the values of a given predefined type. More...
 
void Set (const Vector &v)
 Copy the content of a source vector to the vector instance. More...
 
void Set (DataType v)
 Set all components of the vector instance to a given value. More...
 
void Set (DataType vx, DataType vy, DataType vz, DataType vw)
 Set all components of the vector instance to a set of given component values. More...
 
void Set (const Quaternion< DataType > &q)
 Convert a given quaternion to an axis/angle vector. More...
 
void AddSelf (const Vector &v)
 In-place addition. More...
 
void SubtractSelf (const Vector &v)
 In-place subtraction. More...
 
void MultiplySelf (DataType v)
 In-place multiplication (scaling). More...
 
void MultiplySelf (const Vector &v)
 In-place component-wise multiplication. More...
 
void DivideSelf (DataType v)
 In-place division (inverse scaling). More...
 
void DivideSelf (const Vector &v)
 In-place component-wise division. More...
 
void CrossSelf (const Vector &v)
 In-place cross product. More...
 
void InterpolateSelf (const Vector &v, DataType t)
 In-place linear interpolation. More...
 
void ProjectSelf (const Vector &v)
 In-place projection of a given second vector. More...
 
void MinSelf (const Vector &v)
 In-place set each component to the minimum from the vector instance and a given second vector. More...
 
void MaxSelf (const Vector &v)
 In-place set each component to the maximum from the vector instance and a given second vector. More...
 
void ClampSelf (const Vector &min, const Vector &max)
 In-place clamp each component to the value range given by the min and max vector parameters. More...
 
void MinLengthSelf (DataType v)
 Rescale the vector to a length below or equal a given minimum. More...
 
void MaxLengthSelf (DataType v)
 Rescale the vector to a length above or equal a given maximum. More...
 
void ClampLengthSelf (DataType min, DataType max)
 Clamp the vector to a length within a given range. More...
 
void AbsSelf ()
 Set all vector components to their absolute value.
 
void SgnSelf ()
 Set all vector components to either -1, 0 or +1 depending on their sign.
 
void InvertSelf ()
 In-place inversion (negation) of the vector instance.
 
void NormalizeSelf ()
 In-place normalization of the vector instance. More...
 
void NormalizeAxisSelf ()
 In-place normalization of the x, y and z components. More...
 
Vector Add (const Vector &v) const
 Get the addition of a vector. More...
 
Vector Subtract (const Vector &v) const
 Get the subtraction of a vector. More...
 
Quaternion< DataType > Multiply (const Quaternion< DataType > &q) const
 Get the multiplication with a quaternion. More...
 
Vector Multiply (DataType v) const
 Get the multiplication (scaling). More...
 
Vector Multiply (const Vector &v) const
 Get the component-wise multiplication. More...
 
Vector Divide (DataType v) const
 Get the division (inverse scaling). More...
 
Vector Divide (const Vector &v) const
 Get the component-wise division. More...
 
Vector Cross (const Vector &v) const
 Get the cross product. More...
 
Vector Interpolate (const Vector &v, DataType t) const
 Get the linear interpolation. More...
 
Vector Project (const Vector &v) const
 Get the projection of a given second vector. More...
 
Vector Min (const Vector &v) const
 Get the minimum of each component from the vector instance and a given second vector. More...
 
Vector Max (const Vector &v) const
 Get the maximum of each component from the vector instance and a given second vector. More...
 
Vector Clamp (const Vector &min, const Vector &max) const
 Clamp each component to the value range given by the min and max vector parameters. More...
 
Vector MinLength (DataType v) const
 Get a vector with a length below or equal a given minimum. More...
 
Vector MaxLength (DataType v) const
 Get a vector with a length above or equal a given maximum. More...
 
Vector ClampLength (DataType min, DataType max) const
 Get the a vector with clamped length. More...
 
Vector Abs () const
 Get a vector containing absolute values for each of the instance's components. More...
 
Vector Sgn () const
 Get a vector containing component values of either -1, 0 or +1, depending on the instance component's signs. More...
 
Vector Invert () const
 Get the inversion (negation) of the vector instance. More...
 
Vector Normalize () const
 Get the normalization of the vector instance. More...
 
Vector NormalizeAxis () const
 Get the normalization of the x, y and z components. More...
 
DataType Dot (const Vector &v) const
 Get the dot product of the vector instance and a given second vector. More...
 
DataType GetLength () const
 Get the length of the vector instance. More...
 
DataType GetSquaredLength () const
 Get the squared length of the vector instance. More...
 
DataType GetAngle2D () const
 Get the x/y angle of the vector instance. More...
 
Bool IsZero () const
 Check if the vector instance equals the null vector. More...
 
Bool IsZero (DataType epsilon) const
 Check if the vector instance equals the null vector. More...
 
Bool IsZeroPosition () const
 Check if the vector instance equals the zero position. More...
 
Bool IsZeroPosition (DataType epsilon) const
 Check if the vector instance equals the zero position. More...
 
Bool IsEqual (const Vector &v) const
 Check if the vector instance is equal to a given second vector. More...
 
Bool IsEqual (const Vector &v, DataType epsilon) const
 Check if the vector instance is equal to a given second vector. More...
 
Bool GetBaseNormals (Vector &n1, Vector &n2, Vector &n3) const
 Get base vectors for this vector instance. More...
 
String ToString () const
 Get the string representation of the object. More...
 
SInt32 GetCount () const
 Get the number of elements in the object. More...
 

Additional Inherited Members

- Public Types inherited from Murl::Math::Vector< DataType >
enum  Component {
  X , Y , Z , W ,
  NUM_COMPONENTS
}
 Enumeration of the components raw data index. More...
 
enum  ComponentMask {
  MASK_NONE , MASK_X , MASK_Y , MASK_Z ,
  MASK_W , MASK_XY , MASK_XZ , MASK_YZ ,
  MASK_XYZ , MASK_ALL
}
 Enumeration of the components' bit masks. More...
 
enum  PredefinedType { ZERO_DIRECTION , ZERO_POSITION , UNINITIALIZED }
 Enumeration of the predefined initialization types for constructing a Vector(PredefinedType type). More...
 
using ValueType = DataType
 The template parameter value type.
 
- Public Attributes inherited from Murl::Math::Vector< DataType >
union {
   DataType   mComponents [NUM_COMPONENTS]
 The components data array.
 
   struct {
      DataType   x
 The X component.
 
      DataType   y
 The Y component.
 
      DataType   z
 The Z component.
 
      DataType   w
 The W component.
 
   } 
 The components member struct.
 
}; 
 The components storage union overlaps the raw data array mComponents and the component structure.
 

Detailed Description

template<class DataType>
class Murl::Math::VectorUninitialized< DataType >

A 4-component uninitialized vector class.

This object can create arrays of uninitialized vector instances.

Constructor & Destructor Documentation

◆ VectorUninitialized() [1/2]

template<class DataType >
Murl::Math::VectorUninitialized< DataType >::VectorUninitialized ( )
inline

The default constructor.

Create an uninitialized vector instance.

◆ VectorUninitialized() [2/2]

template<class DataType >
template<class DataType2 >
Murl::Math::VectorUninitialized< DataType >::VectorUninitialized ( const Vector< DataType2 > &  v)
inline

The copy constructor using a vector of different type.

Parameters
vThe vector to copy.

The documentation for this class was generated from the following file:
  • murl_math_vector.h


Copyright © 2011-2024 Spraylight GmbH.