LMatrix4d¶
-
class LMatrix4d¶
Bases:
MemoryBaseThis is a 4-by-4 transform matrix.
Inheritance diagram
digraph inheritancefb0fb74d15 { bgcolor=transparent; rankdir=BT; size="8.0, 12.0"; "DTOOL_SUPER_BASE" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style=""]; "LMatrix4d" [URL="acron.core.LMatrix4d.html#acron.core.LMatrix4d",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "DTOOL_SUPER_BASE" -> "LMatrix4d" [arrowsize=0.75,style=""]; }- class LMatrix4d.CRow¶
Bases:
- __getitem__()¶
- __init__()¶
Defines a row-level constant accessor to the matrix.
- class LMatrix4d.Row¶
Bases:
These helper classes are used to support two-level operator [].
- __getitem__()¶
- __init__()¶
Defines a row-level index accessor to the matrix.
- LMatrix4d.__call__()¶
- LMatrix4d.__div__()¶
- LMatrix4d.__eq__()¶
- LMatrix4d.__getitem__()¶
- LMatrix4d.__iadd__()¶
Performs a memberwise addition between two matrices.
- LMatrix4d.__idiv__()¶
- LMatrix4d.__imul__()¶
- LMatrix4d.__init__()¶
Construct a 4x4 matrix given a 3x3 rotation matrix and an optional translation component.
Constructs the matrix from four individual rows.
- LMatrix4d.__isub__()¶
Performs a memberwise subtraction between two matrices.
- LMatrix4d.__lt__()¶
- LMatrix4d.__mul__()¶
- LMatrix4d.__ne__()¶
- LMatrix4d.__reduce__()¶
- LMatrix4d.__repr__()¶
- LMatrix4d.__rmul__()¶
- LMatrix4d.accumulate()¶
Computes
(*this) += other * weight.
- LMatrix4d.add_hash()¶
Adds the vector into the running hash.
Adds the vector into the running hash.
- LMatrix4d.almost_equal()¶
Returns true if two matrices are memberwise equal within a default tolerance based on the numeric type.
Returns true if two matrices are memberwise equal within a specified tolerance. This is faster than the equivalence operator as this doesn’t have to guarantee that it is transitive.
- LMatrix4d.assign()¶
- static LMatrix4d.begin()¶
Returns an iterator that may be used to traverse the elements of the matrix, STL-style.
Returns an iterator that may be used to traverse the elements of the matrix, STL-style.
- LMatrix4d.compare_to()¶
This flavor of compare_to uses a default threshold value based on the numeric type.
Sorts matrices lexicographically, componentwise. Returns a number less than 0 if this matrix sorts before the other one, greater than zero if it sorts after, 0 if they are equivalent (within the indicated tolerance).
- LMatrix4d.componentwise_mult()¶
- static LMatrix4d.convert_mat()¶
Returns a matrix that transforms from the indicated coordinate system to the indicated coordinate system.
- static LMatrix4d.end()¶
Returns an iterator that may be used to traverse the elements of the matrix, STL-style.
Returns an iterator that may be used to traverse the elements of the matrix, STL-style.
- LMatrix4d.fill()¶
Sets each element of the matrix to the indicated fill_value. This is of questionable value, but is sometimes useful when initializing to zero.
- LMatrix4d.generate_hash()¶
Adds the vector to the indicated hash generator.
Adds the vector to the indicated hash generator.
- LMatrix4d.get_cell()¶
Returns a particular element of the matrix.
- static LMatrix4d.get_class_type()¶
- LMatrix4d.get_col()¶
Retrieves the indicated column of the matrix as a 4-component vector.
- LMatrix4d.get_col3()¶
Retrieves the indicated column of the matrix as a 3-component vector, ignoring the last row.
- static LMatrix4d.get_data()¶
Returns the address of the first of the nine data elements in the matrix. The remaining elements occupy the next eight positions in row-major order.
- LMatrix4d.get_hash()¶
Returns a suitable hash for phash_map.
Returns a suitable hash for phash_map.
- LMatrix4d.get_num_components()¶
Returns the number of elements in the matrix, 16.
- LMatrix4d.get_row()¶
these versions inline better
Retrieves the indicated row of the matrix as a 4-component vector.
Stores the indicated row of the matrix as a 4-component vector.
- LMatrix4d.get_row3()¶
Retrieves the row column of the matrix as a 3-component vector, ignoring the last column.
Stores the row column of the matrix as a 3-component vector, ignoring the last column.
- LMatrix4d.get_upper_3()¶
Retrieves the upper 3x3 submatrix.
- static LMatrix4d.ident_mat()¶
Returns an identity matrix.
This function definition must appear first, since some inline functions below take advantage of it.
- LMatrix4d.invert_affine_from()¶
bugbug: we could optimize this for rotationscaletranslation matrices (transpose upper 3x3 and take negative of translation component)
- LMatrix4d.invert_from()¶
Computes the inverse of the other matrix, and stores the result in this matrix. This is a fully general operation and makes no assumptions about the type of transform represented by the matrix.
The other matrix must be a different object than this matrix. However, if you need to invert a matrix in place, see
invert_in_place.The return value is true if the matrix was successfully inverted, false if the was a singularity.
- LMatrix4d.invert_in_place()¶
Inverts the current matrix. Returns true if the inverse is successful, false if the matrix was singular.
- LMatrix4d.is_identity()¶
Returns true if this is (close enough to) the identity matrix, false otherwise.
- LMatrix4d.is_nan()¶
Returns true if any component of the matrix is not-a-number, false otherwise.
- LMatrix4d.multiply()¶
this = other1 * other2
this = other1 * other2
- static LMatrix4d.ones_mat()¶
Returns an matrix filled with ones.
- static LMatrix4d.operator_delete()¶
- static LMatrix4d.operator_delete()¶
- static LMatrix4d.operator_new()¶
- static LMatrix4d.operator_new()¶
- LMatrix4d.output()¶
- LMatrix4d.read_datagram()¶
Reads the matrix from the Datagram using get_stdfloat().
- LMatrix4d.read_datagram_fixed()¶
Reads the matrix from the Datagram using get_float32() or get_float64(). See
write_datagram_fixed().
- static LMatrix4d.rotate_mat()¶
Returns a matrix that rotates by the given angle in degrees counterclockwise about the indicated vector.
- static LMatrix4d.rotate_mat_normaxis()¶
Returns a matrix that rotates by the given angle in degrees counterclockwise about the indicated vector. Assumes axis has been prenormalized.
- static LMatrix4d.scale_mat()¶
Returns a matrix that applies the indicated scale in each of the three axes.
Returns a matrix that applies the indicated scale in each of the three axes.
Returns a matrix that applies the indicated uniform scale.
- static LMatrix4d.scale_shear_mat()¶
Returns a matrix that applies the indicated scale and shear.
Returns a matrix that applies the indicated scale and shear.
- LMatrix4d.set()¶
- LMatrix4d.set_cell()¶
Changes a particular element of the matrix.
- LMatrix4d.set_col()¶
Replaces the indicated column of the matrix.
Replaces the indicated column of the matrix with the indicated 3-component vector, ignoring the last row.
- LMatrix4d.set_rotate_mat()¶
Sets mat to a matrix that rotates by the given angle in degrees counterclockwise about the indicated vector.
- LMatrix4d.set_rotate_mat_normaxis()¶
Fills mat with a matrix that rotates by the given angle in degrees counterclockwise about the indicated vector. Assumes axis has been prenormalized.
- LMatrix4d.set_row()¶
Replaces the indicated row of the matrix.
Replaces the indicated row of the matrix with the indicated 3-component vector, ignoring the last column.
- LMatrix4d.set_scale_mat()¶
Fills mat with a matrix that applies the indicated scale in each of the three axes.
- LMatrix4d.set_scale_shear_mat()¶
Fills mat with a matrix that applies the indicated scale and shear.
- LMatrix4d.set_shear_mat()¶
Fills mat with a matrix that applies the indicated shear in each of the three planes.
- LMatrix4d.set_translate_mat()¶
Fills mat with a matrix that applies the indicated translation.
- LMatrix4d.set_upper_3()¶
Get and set the upper 3x3 rotation matrix.
Sets the upper 3x3 submatrix.
- static LMatrix4d.shear_mat()¶
Returns a matrix that applies the indicated shear in each of the three planes.
Returns a matrix that applies the indicated shear in each of the three planes.
- static LMatrix4d.translate_mat()¶
Returns a matrix that applies the indicated translation.
Returns a matrix that applies the indicated translation.
- LMatrix4d.transpose_from()¶
- LMatrix4d.transpose_in_place()¶
- static LMatrix4d.validate_ptr()¶
- LMatrix4d.write()¶
- LMatrix4d.write_datagram()¶
Writes the matrix to the Datagram using add_stdfloat(). This is appropriate when you want to write the matrix using the standard width setting, especially when you are writing a bam file.
- LMatrix4d.write_datagram_fixed()¶
Writes the matrix to the Datagram using add_float32() or add_float64(), depending on the type of floats in the matrix, regardless of the setting of
Datagram::set_stdfloat_double(). This is appropriate when you want to write a fixed-width value to the datagram, especially when you are not writing a bam file.
- LMatrix4d.xform()¶
4-component vector or point times matrix. This is a fully general operation.
- LMatrix4d.xform_in_place()¶
4-component vector or point times matrix. This is a fully general operation.
- LMatrix4d.xform_point()¶
The matrix transforms a 3-component point (including translation component) and returns the result. This assumes the matrix is an affine transform.
- LMatrix4d.xform_point_general()¶
The matrix transforms a 3-component point (including translation component) and returns the result, as a fully general operation.
- LMatrix4d.xform_point_general_in_place()¶
The matrix transforms a 3-component point (including translation component), as a fully general operation.
- LMatrix4d.xform_point_in_place()¶
The matrix transforms a 3-component point (including translation component). This assumes the matrix is an affine transform.
- LMatrix4d.xform_vec()¶
The matrix transforms a 3-component vector (without translation component) and returns the result. This assumes the matrix is an orthonormal transform.
- LMatrix4d.xform_vec_general()¶
The matrix transforms a 3-component vector (without translation component) and returns the result, as a fully general operation.
- LMatrix4d.xform_vec_general_in_place()¶
The matrix transforms a 3-component vector (without translation component), as a fully general operation.
- LMatrix4d.xform_vec_in_place()¶
The matrix transforms a 3-component vector (without translation component). This assumes the matrix is an orthonormal transform.
- static LMatrix4d.y_to_z_up_mat()¶
Returns a matrix that transforms from the Y-up coordinate system to the Z-up coordinate system.
- static LMatrix4d.z_to_y_up_mat()¶
Returns a matrix that transforms from the Y-up coordinate system to the Z-up coordinate system.
- static LMatrix4d.zeros_mat()¶
Returns an matrix filled with zeros.