MatrixKit
-
class
HPS.MatrixKit: IDisposable The MatrixKit class is a user space object, useful for carrying a group attribute settings.
Public Functions
-
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.
Return: A reference to this object.
-
bool
Compose(HPS.Vector in_translation, HPS.Vector in_scale, HPS.Quaternion in_rotation) Composes this matrix from translation, scale, and rotation components.
Param in_translation: The translation Vector to use. Param in_scale: The scale Vector to use. Param in_rotation: The translation Quaternion to use. Return: true if the matrix was successfully composed, false otherwise.
-
HPS.MatrixKit
Concatenate(HPS.MatrixKit in_kit) Replaces this matrix with the matrix product of itself multiplied by another matrix.
Param in_kit: the right side operand of the matrix multiplication. Return: A reference to this object.
-
bool
Decompose(out HPS.Vector out_translation, out HPS.Vector out_scale, out HPS.Quaternion out_rotation) Decomposes this matrix into translation, scale, and rotation components.
Param out_translation: The translation Vector extracted from this matrix. Param out_scale: The out_rotation Quaternion extracted from this matrix. Return: true if the matrix was successfully decomposed, false otherwise.
-
void
Dispose()
-
bool
Empty() Indicates whether this object has any values set on it.
- Deprecated:
This function exists for compatibility and will always return false.
Return: true if no values are set on this object, false otherwise.
-
bool
Equals(HPS.MatrixKit in_kit) Check if the source MatrixKit is equivalent to this object.
Param in_kit: The source MatrixKit to compare to this object. Return: true if the objects are equivalent, false otherwise.
-
override bool
Equals(Object obj)
-
override int
GetHashCode()
-
HPS.MatrixKit
Invert() Replaces this matrix with it’s matrix inverse. If this matrix is singular (determinant = 0), it will be unchanged.
Return: A reference to this object.
-
bool
IsIdentity() Indicates whether or not this matrix is an identity matrix
Return: Whether this matrix is an identity matrix.
-
MatrixKit() Initializes an identity matrix.
-
MatrixKit(float[] in_matrix_source) This constructor allows implicit construction from an array of floats.
Param 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.
-
MatrixKit(HPS.MatrixKit in_other) The copy constructor creates a new MatrixKit object that contains the same settings as the source object.
-
MatrixKit(HPS.Quaternion in_quaternion) This constructor allows implicit construction from a quaternion.
Param in_quaternion: A quaternion used to construct a new matrix.
-
HPS.MatrixKit
Multiply(float in_scalar) Performs a scalar multiplication of this matrix.
Param in_scalar: A scalar to multiply this object by. Return: A new MatrixKit representing the product.
-
HPS.MatrixKit
Multiply(HPS.MatrixKit in_right) Performs a matrix multiplication with this object as the left operand.
Param in_right: A matrix used as the right operand of a matrix multiplication. Return: A new MatrixKit representing the product.
-
HPS.MatrixKit
MultiplyAndAssign(float in_scalar) Performs a scalar multiplication of this matrix and then assigns it to this object.
Param in_scalar: A scalar to multiply this object by. Return: A reference to this object after the multiplication.
-
HPS.MatrixKit
MultiplyAndAssign(HPS.MatrixKit in_right) Performs a matrix multiplication with this object as the left operand and then assigns it to this object.
Param in_right: A matrix used as the right operand of a matrix multiplication. Return: A reference to this object after the multiplication.
-
HPS.MatrixKit
Normalize() Divides this matrix by its determinant. If this matrix is singular (determinant = 0), it will be unchanged.
Return: A reference to this object.
-
void
Reset() Sets this kit to an identity matrix.
-
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.
Param in_x: The number of degrees to rotate around the x-axis. Param in_y: The number of degrees to rotate around the y-axis. Param in_z: The number of degrees to rotate around the z-axis. Return: A reference to this object.
-
HPS.MatrixKit
RotateOffAxis(HPS.Vector in_vector, float in_theta) Concatenates a rotation matrix to this matrix with rotation around an arbitrary vector.
Param in_vector: The vector to rotate around. Param in_theta: the number of degrees to rotate around the specified vector Return: A reference to this object.
-
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.
Param in_x: The scale multiplier along the x-axis. Param in_y: The scale multiplier along the y-axis. Param in_z: The scale multiplier along the z-axis. Return: A reference to this object.
-
void
Set(HPS.MatrixKit other) Copies the data from the source MatrixKit into this object.
-
HPS.MatrixKit
SetElement(ulong in_ordinal_zero_to_fifteen, float in_value) Sets a single matrix element, indexed as a linear array in row-major order.
Param in_ordinal_zero_to_fifteen: The offset into the matrix. Valid range is [0, 15]. Param in_value: The matrix element. Return: A reference to this object.
-
HPS.MatrixKit
SetElement(ulong in_row, ulong in_column, float in_value) Sets a single matrix element.
Param in_row: The row index. Valid range is [0, 3]. Param in_column: The column index. Valid range is [0, 3]. Param in_value: The matrix element. Return: A reference to this object.
-
HPS.MatrixKit
SetElements(float[] in_values) Sets some or all elements in the matrix from an array, starting with the first element.
Param in_values: An array of float values in row-major order that should replace the values in the matrix. Return: A reference to this object.
-
bool
ShowAdjoint(out HPS.MatrixKit out_matrix) Computes the matrix adjoint of this matrix. The adjoint is similar to the inverse but is always guaranteed to exist, even for singular matrices.
Param out_matrix: The matrix adjoint of this matrix. Return: true if the setting is valid, false otherwise.
-
bool
ShowDeterminant(out float out_determinant) Computes the matrix determinant of this matrix.
Param out_determinant: The matrix determinant. Return: true if the setting is valid, false otherwise.
-
bool
ShowElement(ulong in_ordinal_zero_to_fifteen, out float out_value) Shows a single matrix element, indexed as a linear array in row-major order.
Param in_ordinal_zero_to_fifteen: The offset into the matrix. Valid range is [0, 15]. Param out_value: The matrix element. Return: true if the setting is valid, false otherwise.
-
bool
ShowElement(ulong in_row, ulong in_column, out float out_value) Shows a single matrix element.
Param in_row: The row index. Valid range is [0, 3]. Param in_column: The column index. Valid range is [0, 3]. Param out_value: The matrix element. Return: true if the setting is valid, false otherwise.
-
bool
ShowElements(out float[] out_matrix) Shows all elements of this matrix as an array.
Param out_matrix: The contents of the matrix arranged as a linear array in row-major order. Return: true if the setting is valid, false otherwise.
-
bool
ShowInverse(out HPS.MatrixKit out_matrix) Computes the matrix inverse of this matrix. Fails if this matrix is singular (determinant = 0).
Param out_matrix: The matrix inverse of this matrix. Return: true if the setting is valid, false otherwise.
-
HPS.Plane
Transform(HPS.Plane in_source) Transform a plane through this matrix.
Param in_source: The plane to apply a transformation to. Return: A new plane representing the transformed plane.
-
HPS.Plane[]
Transform(HPS.Plane[] in_source) Transform an array of planes through this matrix.
Param in_source: An array of planes to apply a transformation to. Return: A new plane array representing the transformed planes.
-
HPS.Point
Transform(HPS.Point in_source) Transform a point through this matrix.
Param in_source: The point to apply a transformation to. Return: A new point representing the transformed point.
-
HPS.Point[]
Transform(HPS.Point[] in_source) Transform an array of points through this matrix.
Param in_source: An array of points to apply a transformation to. Return: A new point array representing the transformed points.
-
HPS.SimpleCuboid
Transform(HPS.SimpleCuboid in_source) Transform a SimpleCuboid through this matrix.
Param in_source: The cuboid to apply a transformation to. Return: A new SimpleCuboid representing the transformed cuboid.
-
HPS.SimpleSphere
Transform(HPS.SimpleSphere in_source) Transform a SimpleSphere through this matrix.
Param in_source: The sphere to apply a transformation to. Return: A new SimpleSphere representing the transformed sphere.
-
HPS.Vector
Transform(HPS.Vector in_source) Transform a vector through this matrix.
Param in_source: The vector to apply a transformation to. Return: A new vector representing the transformed vector.
-
HPS.Vector[]
Transform(HPS.Vector[] in_source) Transform an array of vectors through this matrix.
Param in_source: An array of vectors to apply a transformation to. Return: A new vector array representing the transformed vectors.
-
HPS.MatrixKit
Translate(float in_x, float in_y, float in_z) Concatenates a translation matrix to this matrix that moves geometry.
Param in_x: The number of units to translate along the x-axis. Param in_y: The number of units to translate along the y-axis. Param in_z: The number of units to translate along the z-axis. Return: A reference to this object.
-
HPS.MatrixKit
Translate(HPS.Vector in_translation) Concatenates a translation matrix to this matrix that moves geometry.
Param in_translation: A vector distance to translate by. Return: A reference to this object.
-
HPS.MatrixKit
UnsetEverything() Sets this kit to an identity matrix.
- Deprecated:
This function exists for compatibility and Reset should be preferred.
Return: A reference to this kit.
Public Static Functions
-
HPS.MatrixKit
CreateNormalisationTransformation(int in_width, int in_height) Creates a MatrixKit representing the transformation matrix from an arbitary 2D space to a normalized space.
Param in_width: The current space width. Return: A new transformation MatrixKit.
-
HPS.MatrixKit
GetDefault() Creates a MatrixKit representing the identity matrix.
Return: An identity MatrixKit.
-
bool
operator!=(HPS.MatrixKit a, HPS.MatrixKit b)
-
bool
operator==(HPS.MatrixKit a, HPS.MatrixKit b)
-
HPS.MatrixKit