The MatrixKit class is a user space object, useful for carrying a group attribute settings. More...
#include <hps.h>
Public Member Functions | |
MatrixKit () | |
Initializes an identity matrix. More... | |
MatrixKit (MatrixKit const &in_kit) | |
The copy constructor creates a new MatrixKit object that contains the same settings as the source object. More... | |
MatrixKit (MatrixKit &&in_that) | |
The move constructor creates a MatrixKit by transferring the underlying impl of the rvalue reference to this MatrixKit thereby avoiding a copy and allocation. More... | |
MatrixKit & | operator= (MatrixKit &&in_that) |
The move assignment operator transfers the underlying impl of the rvalue reference to this MatrixKit thereby avoiding a copy. More... | |
MatrixKit (FloatArray const &in_matrix_source) | |
This constructor allows implicit construction from an array of floats. More... | |
MatrixKit (float const in_matrix_source []) | |
This constructor allows implicit construction from an array of floats. More... | |
MatrixKit (Quaternion const &in_quaternion) | |
This constructor allows implicit construction from a quaternion. More... | |
virtual | ~MatrixKit () |
Destroy this kit. More... | |
HPS::Type | ObjectType () const |
void | Set (MatrixKit const &in_kit) |
Copies all settings from the source MatrixKit into this object. More... | |
void | Show (MatrixKit &out_kit) const |
Copies all settings from this MatrixKit into the given MatrixKit. More... | |
MatrixKit & | operator= (MatrixKit const &in_kit) |
Copies the source MatrixKit into this object. More... | |
bool | Empty () const |
Indicates whether this object has any values set on it. More... | |
bool | Equals (MatrixKit const &in_kit) const |
Check if the source MatrixKit is equivalent to this object. More... | |
bool | operator== (MatrixKit const &in_kit) const |
Check if the source MatrixKit is equivalent to this object. More... | |
bool | operator!= (MatrixKit const &in_kit) const |
Check if the source MatrixKit is not equivalent to this object. More... | |
MatrixKit & | SetElement (size_t in_row, size_t in_column, float in_value) |
Sets a single matrix element. More... | |
MatrixKit & | SetElement (size_t in_ordinal_zero_to_fifteen, float in_value) |
Sets a single matrix element, indexed as a linear array in row-major order. More... | |
MatrixKit & | SetElements (FloatArray const &in_values) |
Sets some or all elements in the matrix from an array, starting with the first element. More... | |
MatrixKit & | SetElements (size_t in_value_count, float const in_values []) |
Sets some or all elements in the matrix from an array, starting with the first element. More... | |
MatrixKit & | UnsetEverything () |
Sets this kit to an identity matrix. More... | |
bool | ShowElement (size_t in_row, size_t in_column, float &out_value) const |
Shows a single matrix element. More... | |
bool | ShowElement (size_t in_ordinal_zero_to_fifteen, float &out_value) const |
Shows a single matrix element, indexed as a linear array in row-major order. More... | |
bool | ShowElements (FloatArray &out_matrix) const |
Shows all elements of this matrix as an array. More... | |
bool | ShowElements (float out_matrix[]) const |
Shows all elements of this matrix as an array. More... | |
bool | ShowDeterminant (float &out_determinant) const |
Computes the matrix determinant of this matrix. More... | |
bool | ShowInverse (MatrixKit &out_matrix) const |
Computes the matrix inverse of this matrix. More... | |
bool | ShowAdjoint (MatrixKit &out_matrix) const |
Computes the matrix adjoint of this matrix. More... | |
MatrixKit & | Rotate (float in_x, float in_y, float in_z) |
Concatenates a rotation matrix to this matrix with rotation around the primary axes. More... | |
MatrixKit & | RotateOffAxis (Vector const &in_vector, float in_theta) |
Concatenates a rotation matrix to this matrix with rotation around an arbitrary vector. More... | |
MatrixKit & | Translate (float in_x, float in_y, float in_z) |
Concatenates a translation matrix to this matrix that moves geometry. More... | |
MatrixKit & | Translate (Vector const &in_translation) |
Concatenates a translation matrix to this matrix that moves geometry. More... | |
MatrixKit & | Scale (float in_x, float in_y, float in_z) |
Concatenates a scale matrix to this matrix that represents a uniform scaling of the scene. More... | |
MatrixKit & | Concatenate (MatrixKit const &in_kit) |
Replaces this matrix with the matrix product of itself multiplied by another matrix. More... | |
MatrixKit & | Normalize () |
Divides this matrix by its determinant. More... | |
MatrixKit & | Invert () |
Replaces this matrix with it's matrix inverse. More... | |
MatrixKit & | Adjoint () |
Replaces this matrix with it's matrix adjoint. More... | |
MatrixKit | Multiply (MatrixKit const &in_right) const |
Performs a matrix multiplication with this object as the left operand. More... | |
MatrixKit const & | MultiplyAndAssign (MatrixKit const &in_right) |
Performs a matrix multiplication with this object as the left operand and then assigns it to this object. More... | |
MatrixKit | Multiply (float in_scalar) const |
Performs a scalar multiplication of this matrix. More... | |
MatrixKit const & | MultiplyAndAssign (float in_scalar) |
Performs a scalar multiplication of this matrix and then assigns it to this object. More... | |
MatrixKit | operator* (MatrixKit const &in_right) const |
Performs a matrix multiplication with this object as the left operand. More... | |
MatrixKit const & | operator*= (MatrixKit const &in_right) |
Performs a matrix multiplication with this object as the left operand and then assigns it to this object. More... | |
MatrixKit | operator* (float in_scalar) const |
Performs a scalar multiplication of this matrix. More... | |
MatrixKit const & | operator*= (float in_scalar) |
Performs a scalar multiplication of this matrix and then assigns it to this object. More... | |
Point | Transform (Point const &in_source) const |
Transform a point through this matrix. More... | |
PointArray | Transform (PointArray const &in_source) const |
Transform an array of points through this matrix. More... | |
PointArray | Transform (size_t in_count, Point const in_source []) const |
Transform an array of points through this matrix. More... | |
Vector | Transform (Vector const &in_source) const |
Transform a vector through this matrix. More... | |
VectorArray | Transform (VectorArray const &in_source) const |
Transform an array of vectors through this matrix. More... | |
VectorArray | Transform (size_t in_count, Vector const in_source []) const |
Transform an array of vectors through this matrix. More... | |
Plane | Transform (Plane const &in_source) const |
Transform a plane through this matrix. More... | |
PlaneArray | Transform (PlaneArray const &in_source) const |
Transform an array of planes through this matrix. More... | |
PlaneArray | Transform (size_t in_count, Plane const in_source []) const |
Transform an array of planes through this matrix. More... | |
SimpleCuboid | Transform (SimpleCuboid const &in_source) const |
Transform a SimpleCuboid through this matrix. More... | |
SimpleSphere | Transform (SimpleSphere const &in_source) const |
Transform a SimpleSphere through this matrix. More... | |
virtual HPS::Type | Type () const |
This function returns the true type of the underlying object. More... | |
virtual void | Reset () |
Resets this object to its initial, uninitialized state. More... | |
bool | HasType (HPS::Type in_mask) const |
This function indicates whether this Object has the given Type mask. More... | |
intptr_t | GetClassID () const |
Returns a unique identifier that is shared by all objects of the same class. More... | |
intptr_t | GetInstanceID () const |
Returns an identifier that can be used to identify which instance of a class an object is. More... | |
Static Public Member Functions | |
static MatrixKit | GetDefault () |
Creates a MatrixKit representing the identity matrix. More... | |
template<typename T > | |
static intptr_t | ClassID () |
Unique identifier for this class. More... | |
Static Public Attributes | |
static const HPS::Type | staticType = HPS::Type::MatrixKit |
The MatrixKit class is a user space object, useful for carrying a group attribute settings.
HPS::MatrixKit::MatrixKit | ( | ) |
Initializes an identity matrix.
HPS::MatrixKit::MatrixKit | ( | MatrixKit const & | in_kit | ) |
The copy constructor creates a new MatrixKit object that contains the same settings as the source object.
in_kit | The source object to copy. |
HPS::MatrixKit::MatrixKit | ( | MatrixKit && | in_that | ) |
HPS::MatrixKit::MatrixKit | ( | FloatArray const & | in_matrix_source | ) |
This constructor allows implicit construction from an array of floats.
in_matrix_source | An array of floats that will be used to construct a new matrix. If this array is not at least 16 elements in length, only the valid members will be used, leaving the remainder initialized as the identity matrix. |
HPS::MatrixKit::MatrixKit | ( | float const | in_matrix_source[] | ) |
This constructor allows implicit construction from an array of floats.
in_matrix_source | An array of floats that will be used to construct a new matrix. This array is assumed to be at least 16 elements in length. If it is not, the behavior is undefined. |
HPS::MatrixKit::MatrixKit | ( | Quaternion const & | in_quaternion | ) |
This constructor allows implicit construction from a quaternion.
in_quaternion | A quaternion used to construct a new matrix. |
|
virtual |
Destroy this kit.
MatrixKit& HPS::MatrixKit::Adjoint | ( | ) |
Replaces this matrix with it's matrix adjoint.
The adjoint is similar to the inverse but is always guaranteed to exist, even for singular matrices.
|
inlinestaticinherited |
Unique identifier for this class.
Note: this method uses construction of static objects. If used in a constructor, it should be used in the body not the initializer list.
Replaces this matrix with the matrix product of itself multiplied by another matrix.
in_kit | the right side operand of the matrix multiplication. |
|
virtual |
Indicates whether this object has any values set on it.
Reimplemented from HPS::Object.
bool HPS::MatrixKit::Equals | ( | MatrixKit const & | in_kit | ) | const |
|
inherited |
Returns a unique identifier that is shared by all objects of the same class.
|
static |
|
inherited |
Returns an identifier that can be used to identify which instance of a class an object is.
Different keys and controls will return the same value if they are backed by the same database resource.
|
inherited |
MatrixKit& HPS::MatrixKit::Invert | ( | ) |
Replaces this matrix with it's matrix inverse.
If this matrix is singular (determinant = 0), it will be unchanged.
Performs a matrix multiplication with this object as the left operand.
in_right | A matrix used as the right operand of a matrix multiplication. |
MatrixKit HPS::MatrixKit::Multiply | ( | float | in_scalar | ) | const |
Performs a scalar multiplication of this matrix.
in_scalar | A scalar to multiply this object by. |
Performs a matrix multiplication with this object as the left operand and then assigns it to this object.
in_right | A matrix used as the right operand of a matrix multiplication. |
MatrixKit const& HPS::MatrixKit::MultiplyAndAssign | ( | float | in_scalar | ) |
Performs a scalar multiplication of this matrix and then assigns it to this object.
in_scalar | A scalar to multiply this object by. |
MatrixKit& HPS::MatrixKit::Normalize | ( | ) |
Divides this matrix by its determinant.
If this matrix is singular (determinant = 0), it will be unchanged.
|
inlinevirtual |
bool HPS::MatrixKit::operator!= | ( | MatrixKit const & | in_kit | ) | const |
Performs a matrix multiplication with this object as the left operand.
in_right | A matrix used as the right operand of a matrix multiplication. |
MatrixKit HPS::MatrixKit::operator* | ( | float | in_scalar | ) | const |
Performs a scalar multiplication of this matrix.
in_scalar | A scalar to multiply this object by. |
Performs a matrix multiplication with this object as the left operand and then assigns it to this object.
in_right | A matrix used as the right operand of a matrix multiplication. |
MatrixKit const& HPS::MatrixKit::operator*= | ( | float | in_scalar | ) |
Performs a scalar multiplication of this matrix and then assigns it to this object.
in_scalar | A scalar to multiply this object by. |
bool HPS::MatrixKit::operator== | ( | MatrixKit const & | in_kit | ) | const |
|
virtualinherited |
Resets this object to its initial, uninitialized state.
Reimplemented in HPS::EventHandler, HPS::EventDispatcher, HPS::World, HPS::HighlightSearchResults, HPS::HighlightSearchResultsIterator, HPS::SelectionResults, HPS::SelectionResultsIterator, HPS::FontSearchResults, HPS::FontSearchResultsIterator, HPS::SearchResults, and HPS::SearchResultsIterator.
MatrixKit& HPS::MatrixKit::Rotate | ( | float | in_x, |
float | in_y, | ||
float | in_z | ||
) |
Concatenates a rotation matrix to this matrix with rotation around the primary axes.
in_x | The number of degrees to rotate around the x-axis. |
in_y | The number of degrees to rotate around the y-axis. |
in_z | The number of degrees to rotate around the z-axis. |
Concatenates a rotation matrix to this matrix with rotation around an arbitrary vector.
in_vector | The vector to rotate around. |
in_theta | the number of degrees to rotate around the specified vector |
MatrixKit& HPS::MatrixKit::Scale | ( | float | in_x, |
float | in_y, | ||
float | in_z | ||
) |
Concatenates a scale matrix to this matrix that represents a uniform scaling of the scene.
in_x | The scale multiplier along the x-axis. |
in_y | The scale multiplier along the y-axis. |
in_z | The scale multiplier along the z-axis. |
void HPS::MatrixKit::Set | ( | MatrixKit const & | in_kit | ) |
MatrixKit& HPS::MatrixKit::SetElement | ( | size_t | in_row, |
size_t | in_column, | ||
float | in_value | ||
) |
Sets a single matrix element.
in_row | The row index. Valid range is [0, 3]. |
in_column | The column index. Valid range is [0, 3]. |
in_value | The matrix element. |
MatrixKit& HPS::MatrixKit::SetElement | ( | size_t | in_ordinal_zero_to_fifteen, |
float | in_value | ||
) |
Sets a single matrix element, indexed as a linear array in row-major order.
in_ordinal_zero_to_fifteen | The offset into the matrix. Valid range is [0, 15]. |
in_value | The matrix element. |
MatrixKit& HPS::MatrixKit::SetElements | ( | FloatArray const & | in_values | ) |
Sets some or all elements in the matrix from an array, starting with the first element.
in_values | An array of float values in row-major order that should replace the values in the matrix. |
MatrixKit& HPS::MatrixKit::SetElements | ( | size_t | in_value_count, |
float const | in_values[] | ||
) |
Sets some or all elements in the matrix from an array, starting with the first element.
in_value_count | the number of elements in the input array. Valid range is [0, 16]. |
in_values | An array of float values in row-major order that should replace the values in the matrix. |
void HPS::MatrixKit::Show | ( | MatrixKit & | out_kit | ) | const |
bool HPS::MatrixKit::ShowAdjoint | ( | MatrixKit & | out_matrix | ) | const |
Computes the matrix adjoint of this matrix.
The adjoint is similar to the inverse but is always guaranteed to exist, even for singular matrices.
out_matrix | The matrix adjoint of this matrix. |
bool HPS::MatrixKit::ShowDeterminant | ( | float & | out_determinant | ) | const |
Computes the matrix determinant of this matrix.
out_determinant | The matrix determinant. |
bool HPS::MatrixKit::ShowElement | ( | size_t | in_row, |
size_t | in_column, | ||
float & | out_value | ||
) | const |
Shows a single matrix element.
in_row | The row index. Valid range is [0, 3]. |
in_column | The column index. Valid range is [0, 3]. |
out_value | The matrix element. |
bool HPS::MatrixKit::ShowElement | ( | size_t | in_ordinal_zero_to_fifteen, |
float & | out_value | ||
) | const |
Shows a single matrix element, indexed as a linear array in row-major order.
in_ordinal_zero_to_fifteen | The offset into the matrix. Valid range is [0, 15]. |
out_value | The matrix element. |
bool HPS::MatrixKit::ShowElements | ( | FloatArray & | out_matrix | ) | const |
Shows all elements of this matrix as an array.
out_matrix | The contents of the matrix arranged as a linear array in row-major order. |
bool HPS::MatrixKit::ShowElements | ( | float | out_matrix[] | ) | const |
Shows all elements of this matrix as an array.
out_matrix | The contents of the matrix arranged as a linear array in row-major order. |
bool HPS::MatrixKit::ShowInverse | ( | MatrixKit & | out_matrix | ) | const |
Computes the matrix inverse of this matrix.
Fails if this matrix is singular (determinant = 0).
out_matrix | The matrix inverse of this matrix. |
Transform a point through this matrix.
in_source | The point to apply a transformation to. |
PointArray HPS::MatrixKit::Transform | ( | PointArray const & | in_source | ) | const |
Transform an array of points through this matrix.
in_source | An array of points to apply a transformation to. |
PointArray HPS::MatrixKit::Transform | ( | size_t | in_count, |
Point const | in_source[] | ||
) | const |
Transform an array of points through this matrix.
in_count | The number of elements in the source array. |
in_source | An array of points to apply a transformation to. |
Transform a vector through this matrix.
in_source | The vector to apply a transformation to. |
VectorArray HPS::MatrixKit::Transform | ( | VectorArray const & | in_source | ) | const |
Transform an array of vectors through this matrix.
in_source | An array of vectors to apply a transformation to. |
VectorArray HPS::MatrixKit::Transform | ( | size_t | in_count, |
Vector const | in_source[] | ||
) | const |
Transform an array of vectors through this matrix.
in_count | The number of elements in the source array. |
in_source | An array of vectors to apply a transformation to. |
Transform a plane through this matrix.
in_source | The plane to apply a transformation to. |
PlaneArray HPS::MatrixKit::Transform | ( | PlaneArray const & | in_source | ) | const |
Transform an array of planes through this matrix.
in_source | An array of planes to apply a transformation to. |
PlaneArray HPS::MatrixKit::Transform | ( | size_t | in_count, |
Plane const | in_source[] | ||
) | const |
Transform an array of planes through this matrix.
in_count | The number of elements in the source array. |
in_source | An array of planes to apply a transformation to. |
SimpleCuboid HPS::MatrixKit::Transform | ( | SimpleCuboid const & | in_source | ) | const |
Transform a SimpleCuboid through this matrix.
in_source | The cuboid to apply a transformation to. |
SimpleSphere HPS::MatrixKit::Transform | ( | SimpleSphere const & | in_source | ) | const |
Transform a SimpleSphere through this matrix.
in_source | The sphere to apply a transformation to. |
MatrixKit& HPS::MatrixKit::Translate | ( | float | in_x, |
float | in_y, | ||
float | in_z | ||
) |
Concatenates a translation matrix to this matrix that moves geometry.
in_x | The number of units to translate along the x-axis. |
in_y | The number of units to translate along the y-axis. |
in_z | The number of units to translate along the z-axis. |
Concatenates a translation matrix to this matrix that moves geometry.
in_translation | A vector distance to translate by. |
|
inlinevirtualinherited |
This function returns the true type of the underlying object.
This function is useful for finding the type of smart pointer objects that have been cast to more generic types.
Reimplemented from HPS::Object.
MatrixKit& HPS::MatrixKit::UnsetEverything | ( | ) |
Sets this kit to an identity matrix.
|
static |