Isle
Loading...
Searching...
No Matches
Mx4DPointFloat Class Reference

[AI] 4D point class for floating point values. More...

#include <mxgeometry4d.h>

Inheritance diagram for Mx4DPointFloat:
Collaboration diagram for Mx4DPointFloat:

Public Member Functions

 Mx4DPointFloat ()
 [AI] Default constructor. More...
 
 Mx4DPointFloat (float p_x, float p_y, float p_z, float p_a)
 [AI] Constructor with explicit coordinates. More...
 
 Mx4DPointFloat (const Mx4DPointFloat &p_other)
 [AI] Copy constructor. More...
 
virtual void operator= (const Vector4 &p_impl)
 [AI] Assignment operator from a Vector4 object. More...
 
float & operator[] (int idx)
 [AI] Array subscript operator for modifiable access. More...
 
float & index_operator (int idx)
 [AI] Explicit indexed access wrapper (alias for operator[]). More...
 
- Public Member Functions inherited from Vector4
 Vector4 (float *p_data)
 [AI] Constructs a Vector4 using external float storage. More...
 
 Vector4 (const float *p_data)
 [AI] Constructs a Vector4 using a const float pointer (pointer is reinterpreted as mutable). More...
 
void Clear () override
 [AI] Sets all four components to zero. More...
 
float LenSquared () const override
 [AI] Computes the squared magnitude of the 4D vector. More...
 
void Fill (const float &p_value) override
 [AI] Fill all four floats with p_value. More...
 
virtual void SetMatrixProduct (const float *p_vec, const float *p_mat)
 [AI] Set this vector to the result of a matrix-vector product: result = p_mat * p_vec. More...
 
virtual void SetMatrixProduct (const Vector4 &p_a, const float *p_b)
 [AI] Set this vector to result of matrix-vector product with source given as Vector4, matrix as pointer. More...
 
virtual int NormalizeQuaternion ()
 [AI] Normalize this quaternion (interpreted as vector) in place. More...
 
virtual int EqualsHamiltonProduct (const Vector4 &p_a, const Vector4 &p_b)
 [AI] Set this vector to the Hamilton product of two quaternion Vector4s. More...
 
float & operator[] (int idx)
 [AI] Indexes 0-3: returns reference to the fast access coordinate. More...
 
const float & operator[] (int idx) const
 [AI] Const version for coordinate access (0...3). More...
 
- Public Member Functions inherited from Vector3
 Vector3 (float *p_data)
 [AI] Construct a 3D vector pointing at external data storage. More...
 
 Vector3 (const float *p_data)
 [AI] Construct a 3D vector from const float* (pointer is cast to non-const in base). More...
 
void Clear () override
 [AI] Sets every coordinate (x, y, z) to zero. More...
 
float LenSquared () const override
 [AI] Computes the squared magnitude (x^2 + y^2 + z^2) of this vector. More...
 
virtual void EqualsCross (const Vector3 &p_a, const Vector3 &p_b)
 [AI] Sets this vector to be the cross product of p_a and p_b. More...
 
virtual void EqualsCross (const Vector3 &p_a, const float *p_b)
 [AI] Sets this vector to be the cross product of p_a and p_b, with b as a pointer. More...
 
virtual void EqualsCross (const float *p_a, const Vector3 &p_b)
 [AI] Sets this vector to be the cross product of p_a and p_b, with a as a pointer. More...
 
virtual void Fill (const float &p_value)
 [AI] Fills all coordinates with p_value. More...
 
- Public Member Functions inherited from Vector2
 Vector2 (float *p_data)
 [AI] Construct a 2D vector using an external float buffer. More...
 
 Vector2 (const float *p_data)
 [AI] Construct a 2D vector from a (likely constant) array of floats without copying (just pointer assignment). More...
 
virtual float * GetData ()
 [AI] Retrieves the mutable in-memory data pointer for this vector. More...
 
virtual const float * GetData () const
 [AI] Retrieves the immutable data pointer for this vector. More...
 
virtual void Clear ()
 [AI] Zeros all elements (sets all coordinates to 0.0). More...
 
virtual float Dot (const float *p_a, const float *p_b) const
 [AI] Compute the dot product of the two float arrays interpreted as vectors of 2 elements. More...
 
virtual float Dot (const Vector2 &p_a, const Vector2 &p_b) const
 [AI] Compute the dot product of two Vector2 objects. More...
 
virtual float Dot (const float *p_a, const Vector2 &p_b) const
 [AI] Compute the dot product given a pointer and a Vector2 (second param). More...
 
virtual float Dot (const Vector2 &p_a, const float *p_b) const
 [AI] Compute the dot product given a Vector2 (first param) and a pointer (second param). More...
 
virtual float LenSquared () const
 [AI] Compute the squared length (magnitude^2) of the vector. More...
 
virtual int Unitize ()
 [AI] Scales the vector so its norm is 1 (unit vector). More...
 
virtual void operator+= (float p_value)
 [AI] In-place add a scalar to all coordinates. More...
 
virtual void operator+= (const float *p_other)
 [AI] In-place add vector elements via float pointer. More...
 
virtual void operator+= (const Vector2 &p_other)
 [AI] In-place add another Vector2. More...
 
virtual void operator-= (const float *p_other)
 [AI] In-place subtraction of vector pointed to by p_other. More...
 
virtual void operator-= (const Vector2 &p_other)
 [AI] In-place subtraction of another Vector2. More...
 
virtual void operator*= (const float *p_other)
 [AI] In-place per-element multiplication of this vector by another array. More...
 
virtual void operator*= (const Vector2 &p_other)
 [AI] In-place per-element multiplication by another Vector2. More...
 
virtual void operator*= (const float &p_value)
 [AI] In-place multiplication by a scalar. More...
 
virtual void operator/= (const float &p_value)
 [AI] In-place scalar division. More...
 
virtual void operator= (const float *p_other)
 [AI] Assigns this vector's elements from a pointer to two floats. More...
 
virtual void operator= (const Vector2 &p_other)
 [AI] Assigns this vector's elements from another Vector2. More...
 
float & operator[] (int idx)
 [AI] Accesses the idx-th float in the vector (0 or 1). More...
 
const float & operator[] (int idx) const
 [AI] Const version of the index operator. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Vector4
void AddImpl (const float *p_value) override
 [AI] Adds the values pointed to by p_value to this vector. More...
 
void AddImpl (float p_value) override
 [AI] Adds a scalar value to every element of this vector. More...
 
void SubImpl (const float *p_value) override
 [AI] Subtracts the vector specified by p_value from this vector. More...
 
void MulImpl (const float *p_value) override
 [AI] Multiplies this vector by another vector (per element). More...
 
void MulImpl (const float &p_value) override
 [AI] Multiplies this vector by a scalar value. More...
 
void DivImpl (const float &p_value) override
 [AI] Divides this vector by a scalar value. More...
 
float DotImpl (const float *p_a, const float *p_b) const override
 
void EqualsImpl (const float *p_data) override
 [AI] Assigns values from provided array to this vector. More...
 
- Protected Member Functions inherited from Vector3
void AddImpl (const float *p_value) override
 [AI] Adds the values pointed to by p_value to this vector. More...
 
void AddImpl (float p_value) override
 [AI] Adds a scalar value to every element of this vector. More...
 
void SubImpl (const float *p_value) override
 [AI] Subtracts the vector specified by p_value from this vector. More...
 
void MulImpl (const float *p_value) override
 [AI] Multiplies this vector by another vector (per element). More...
 
void MulImpl (const float &p_value) override
 [AI] Multiplies this vector by a scalar value. More...
 
void DivImpl (const float &p_value) override
 [AI] Divides this vector by a scalar value. More...
 
float DotImpl (const float *p_a, const float *p_b) const override
 
void EqualsImpl (const float *p_data) override
 [AI] Assigns values from provided array to this vector. More...
 
virtual void EqualsCrossImpl (const float *p_a, const float *p_b)
 [AI] Assigns this vector to the cross product of p_a and p_b. More...
 
- Protected Member Functions inherited from Vector2
virtual void AddImpl (const float *p_value)
 [AI] Adds the values pointed to by p_value to this vector. More...
 
virtual void AddImpl (float p_value)
 [AI] Adds a scalar value to every element of this vector. More...
 
virtual void SubImpl (const float *p_value)
 [AI] Subtracts the vector specified by p_value from this vector. More...
 
virtual void MulImpl (const float *p_value)
 [AI] Multiplies this vector by another vector (per element). More...
 
virtual void MulImpl (const float &p_value)
 [AI] Multiplies this vector by a scalar value. More...
 
virtual void DivImpl (const float &p_value)
 [AI] Divides this vector by a scalar value. More...
 
virtual float DotImpl (const float *p_a, const float *p_b) const
 [AI] Computes the dot product of two arrays interpreted as vectors. More...
 
virtual void SetData (float *p_data)
 [AI] Set the internal data pointer to external storage. More...
 
virtual void EqualsImpl (const float *p_data)
 [AI] Assigns values from provided array to this vector. More...
 
- Protected Attributes inherited from Vector2
float * m_data
 [AI] Pointer to externally provided float storage (owned elsewhere). More...
 

Detailed Description

[AI] 4D point class for floating point values.

[AI] This class extends the Vector4 class, adding storage for 4D point coordinates using float precision. It provides various constructors and utility methods to manipulate 4D points, such as setting/getting each coordinate, assignment, and array-style access. This is especially useful in graphics or spatial transformations where a homogeneous coordinate is needed.

Definition at line 18 of file mxgeometry4d.h.

Constructor & Destructor Documentation

◆ Mx4DPointFloat() [1/3]

Mx4DPointFloat::Mx4DPointFloat ( )
inline

[AI] Default constructor.

Initializes a 4D point with uninitialized elements. [AI]

[AI] Constructs the base Vector4 with m_elements as storage for coordinate values.

Definition at line 24 of file mxgeometry4d.h.

◆ Mx4DPointFloat() [2/3]

Mx4DPointFloat::Mx4DPointFloat ( float  p_x,
float  p_y,
float  p_z,
float  p_a 
)
inline

[AI] Constructor with explicit coordinates.

Parameters
p_xX component. [AI]
p_yY component. [AI]
p_zZ component. [AI]
p_a'A' component (homogeneous or fourth dimension). [AI]

[AI] Initializes the four-dimensional point with given values. Used for direct coordinate control.

Definition at line 34 of file mxgeometry4d.h.

◆ Mx4DPointFloat() [3/3]

Mx4DPointFloat::Mx4DPointFloat ( const Mx4DPointFloat p_other)
inline

[AI] Copy constructor.

Parameters
p_otherInstance to copy from. [AI]

[AI] Initializes the new object by copying all 4 coordinate values from another Mx4DPointFloat.

Definition at line 47 of file mxgeometry4d.h.

Member Function Documentation

◆ index_operator()

float & Mx4DPointFloat::index_operator ( int  idx)
inline

[AI] Explicit indexed access wrapper (alias for operator[]).

[AI]

Parameters
idxIndex into the four components. [AI]
Returns
Reference to the float component. [AI]

[AI] Used by several legacy routines, provides alternate access to the data array.

Definition at line 73 of file mxgeometry4d.h.

◆ operator=()

virtual void Mx4DPointFloat::operator= ( const Vector4 p_impl)
inlinevirtual

[AI] Assignment operator from a Vector4 object.

Parameters
p_implThe source Vector4 to copy values from. [AI]

[AI] Overwrites the current 4D point's data array with another Vector4's components.

Definition at line 54 of file mxgeometry4d.h.

◆ operator[]()

float & Mx4DPointFloat::operator[] ( int  idx)
inline

[AI] Array subscript operator for modifiable access.

Parameters
idxIndex (0-3) for x/y/z/a components. [AI]
Returns
Reference to the requested coordinate component. [AI]

[AI] Allows for array-style reading and writing of component values, e.g. pt[2] = 4.5f;

Definition at line 62 of file mxgeometry4d.h.


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