LMatrix4d
from panda3d.core import LMatrix4d
- class LMatrix4d
Bases:
DTOOL_SUPER_BASE
This is a 4-by-4 transform matrix.
Inheritance diagram
- class CRow
Bases:
DTOOL_SUPER_BASE
- __init__(*args, **kwargs)
- operatorTypecast()
C++ Interface: operator_typecast(CRow self)
- operator_typecast()
C++ Interface: operator_typecast(CRow self)
- class Row
Bases:
DTOOL_SUPER_BASE
These helper classes are used to support two-level operator [].
- __init__(*args, **kwargs)
- operatorTypecast()
C++ Interface: operator_typecast(Row self)
- operator_typecast()
C++ Interface: operator_typecast(Row self)
- __init__(*args, **kwargs)
- accumulate()
C++ Interface: accumulate(const LMatrix4d self, const LMatrix4d other, double weight)
- /**
Computes (*this) += other * weight.
*/
- addHash()
C++ Interface: add_hash(LMatrix4d self, int hash) add_hash(LMatrix4d self, int hash, double threshold)
- add_hash()
C++ Interface: add_hash(LMatrix4d self, int hash) add_hash(LMatrix4d self, int hash, double threshold)
- almostEqual()
C++ Interface: almost_equal(LMatrix4d self, const LMatrix4d other) almost_equal(LMatrix4d self, const LMatrix4d other, double threshold)
- almost_equal()
C++ Interface: almost_equal(LMatrix4d self, const LMatrix4d other) almost_equal(LMatrix4d self, const LMatrix4d other, double threshold)
- assign()
C++ Interface: assign(const LMatrix4d self, const LMatrix4d other) assign(const LMatrix4d self, double fill_value)
- /**
*/
- cols
- compareTo()
C++ Interface: compare_to(LMatrix4d self, const LMatrix4d other) compare_to(LMatrix4d self, const LMatrix4d other, double threshold)
- /**
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).
*/
- compare_to()
C++ Interface: compare_to(LMatrix4d self, const LMatrix4d other) compare_to(LMatrix4d self, const LMatrix4d other, double threshold)
- /**
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).
*/
- componentwiseMult()
C++ Interface: componentwise_mult(const LMatrix4d self, const LMatrix4d other)
- /**
*/
- componentwise_mult()
C++ Interface: componentwise_mult(const LMatrix4d self, const LMatrix4d other)
- /**
*/
- convertMat()
C++ Interface: convert_mat(int from, int to)
- /**
Returns a matrix that transforms from the indicated coordinate system to
the indicated coordinate system.
*/
- convert_mat()
C++ Interface: convert_mat(int from, int to)
- /**
Returns a matrix that transforms from the indicated coordinate system to
the indicated coordinate system.
*/
- fill()
C++ Interface: fill(const LMatrix4d self, double fill_value)
- /**
Sets each element of the matrix to the indicated fill_value. This is of
questionable value, but is sometimes useful when initializing to zero.
*/
- getCell()
C++ Interface: get_cell(LMatrix4d self, int row, int col)
- /**
Returns a particular element of the matrix.
*/
- getClassType()
C++ Interface: get_class_type()
- getCol()
C++ Interface: get_col(LMatrix4d self, int col)
- /**
Retrieves the indicated column of the matrix as a 4-component vector.
*/
- getCol3()
C++ Interface: get_col3(LMatrix4d self, int col)
- /**
Retrieves the indicated column of the matrix as a 3-component vector,
ignoring the last row.
*/
- getCols()
- getHash()
C++ Interface: get_hash(LMatrix4d self) get_hash(LMatrix4d self, double threshold)
- getNumComponents()
C++ Interface: get_num_components(LMatrix4d self)
- /**
Returns the number of elements in the matrix, 16.
*/
- getRow()
C++ Interface: get_row(LMatrix4d self, int row) get_row(LMatrix4d self, LVecBase4d result_vec, int row)
// these versions inline better
- getRow3()
C++ Interface: get_row3(LMatrix4d self, int row) get_row3(LMatrix4d self, LVecBase3d result_vec, int row)
- getRow3s()
- getRows()
- get_cell()
C++ Interface: get_cell(LMatrix4d self, int row, int col)
- /**
Returns a particular element of the matrix.
*/
- get_class_type()
C++ Interface: get_class_type()
- get_col()
C++ Interface: get_col(LMatrix4d self, int col)
- /**
Retrieves the indicated column of the matrix as a 4-component vector.
*/
- get_col3()
C++ Interface: get_col3(LMatrix4d self, int col)
- /**
Retrieves the indicated column of the matrix as a 3-component vector,
ignoring the last row.
*/
- get_cols()
- get_hash()
C++ Interface: get_hash(LMatrix4d self) get_hash(LMatrix4d self, double threshold)
- get_num_components()
C++ Interface: get_num_components(LMatrix4d self)
- /**
Returns the number of elements in the matrix, 16.
*/
- get_row()
C++ Interface: get_row(LMatrix4d self, int row) get_row(LMatrix4d self, LVecBase4d result_vec, int row)
// these versions inline better
- get_row3()
C++ Interface: get_row3(LMatrix4d self, int row) get_row3(LMatrix4d self, LVecBase3d result_vec, int row)
- get_row3s()
- get_rows()
- identMat()
C++ Interface: ident_mat()
- /**
Returns an identity matrix.
This function definition must appear first, since some inline functions
below take advantage of it.
*/
- ident_mat()
C++ Interface: ident_mat()
- /**
Returns an identity matrix.
This function definition must appear first, since some inline functions
below take advantage of it.
*/
- invertAffineFrom()
C++ Interface: invert_affine_from(const LMatrix4d self, const LMatrix4d other)
// bugbug: we could optimize this for rotationscaletranslation matrices // (transpose upper 3x3 and take negative of translation component)
- invertFrom()
C++ Interface: invert_from(const LMatrix4d self, const LMatrix4d other)
- /**
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.
*/
- invertInPlace()
C++ Interface: invert_in_place(const LMatrix4d self)
- /**
Inverts the current matrix. Returns true if the inverse is successful,
false if the matrix was singular.
*/
- invert_affine_from()
C++ Interface: invert_affine_from(const LMatrix4d self, const LMatrix4d other)
// bugbug: we could optimize this for rotationscaletranslation matrices // (transpose upper 3x3 and take negative of translation component)
- invert_from()
C++ Interface: invert_from(const LMatrix4d self, const LMatrix4d other)
- /**
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.
*/
- invert_in_place()
C++ Interface: invert_in_place(const LMatrix4d self)
- /**
Inverts the current matrix. Returns true if the inverse is successful,
false if the matrix was singular.
*/
- isIdentity()
C++ Interface: is_identity(LMatrix4d self)
- /**
Returns true if this is (close enough to) the identity matrix, false
otherwise.
*/
- isNan()
C++ Interface: is_nan(LMatrix4d self)
- /**
Returns true if any component of the matrix is not-a-number, false
otherwise.
*/
- is_identity()
C++ Interface: is_identity(LMatrix4d self)
- /**
Returns true if this is (close enough to) the identity matrix, false
otherwise.
*/
- is_int = 0
- is_nan()
C++ Interface: is_nan(LMatrix4d self)
- /**
Returns true if any component of the matrix is not-a-number, false
otherwise.
*/
- multiply()
C++ Interface: multiply(const LMatrix4d self, const LMatrix4d other1, const LMatrix4d other2)
// this = other1 * other2
// this = other1 * other2
- num_components = 16
- readDatagram()
C++ Interface: read_datagram(const LMatrix4d self, DatagramIterator source)
- /**
Reads the matrix from the Datagram using get_stdfloat().
*/
- readDatagramFixed()
C++ Interface: read_datagram_fixed(const LMatrix4d self, DatagramIterator scan)
- /**
Reads the matrix from the Datagram using get_float32() or get_float64().
See write_datagram_fixed().
*/
- read_datagram()
C++ Interface: read_datagram(const LMatrix4d self, DatagramIterator source)
- /**
Reads the matrix from the Datagram using get_stdfloat().
*/
- read_datagram_fixed()
C++ Interface: read_datagram_fixed(const LMatrix4d self, DatagramIterator scan)
- /**
Reads the matrix from the Datagram using get_float32() or get_float64().
See write_datagram_fixed().
*/
- rotateMat()
C++ Interface: rotate_mat(double angle, const LVecBase3d axis, int cs)
- /**
Returns a matrix that rotates by the given angle in degrees
counterclockwise about the indicated vector.
*/
- rotateMatNormaxis()
C++ Interface: rotate_mat_normaxis(double angle, const LVecBase3d axis, int cs)
- /**
Returns a matrix that rotates by the given angle in degrees
counterclockwise about the indicated vector. Assumes axis has been
prenormalized.
*/
- rotate_mat()
C++ Interface: rotate_mat(double angle, const LVecBase3d axis, int cs)
- /**
Returns a matrix that rotates by the given angle in degrees
counterclockwise about the indicated vector.
*/
- rotate_mat_normaxis()
C++ Interface: rotate_mat_normaxis(double angle, const LVecBase3d axis, int cs)
- /**
Returns a matrix that rotates by the given angle in degrees
counterclockwise about the indicated vector. Assumes axis has been
prenormalized.
*/
- rows
- scaleMat()
C++ Interface: scale_mat(const LVecBase3d scale) scale_mat(double scale) scale_mat(double sx, double sy, double sz)
- scaleShearMat()
C++ Interface: scale_shear_mat(const LVecBase3d scale, const LVecBase3d shear) scale_shear_mat(const LVecBase3d scale, const LVecBase3d shear, int cs) scale_shear_mat(double sx, double sy, double sz, double shxy, double shxz, double shyz, int cs)
- scale_mat()
C++ Interface: scale_mat(const LVecBase3d scale) scale_mat(double scale) scale_mat(double sx, double sy, double sz)
- scale_shear_mat()
C++ Interface: scale_shear_mat(const LVecBase3d scale, const LVecBase3d shear) scale_shear_mat(const LVecBase3d scale, const LVecBase3d shear, int cs) scale_shear_mat(double sx, double sy, double sz, double shxy, double shxz, double shyz, int cs)
- set()
C++ Interface: set(const LMatrix4d self, double e00, double e01, double e02, double e03, double e10, double e11, double e12, double e13, double e20, double e21, double e22, double e23, double e30, double e31, double e32, double e33)
- /**
*/
- setCell()
C++ Interface: set_cell(const LMatrix4d self, int row, int col, double value)
- /**
Changes a particular element of the matrix.
*/
- setCol()
C++ Interface: set_col(const LMatrix4d self, int col, const LVecBase4d v) set_col(const LMatrix4d self, int col, const LVecBase3d v)
- setRotateMat()
C++ Interface: set_rotate_mat(const LMatrix4d self, double angle, const LVecBase3d axis, int cs)
- /**
Sets mat to a matrix that rotates by the given angle in degrees
counterclockwise about the indicated vector.
*/
- setRotateMatNormaxis()
C++ Interface: set_rotate_mat_normaxis(const LMatrix4d self, double angle, const LVecBase3d axis, int cs)
- /**
Fills mat with a matrix that rotates by the given angle in degrees
counterclockwise about the indicated vector. Assumes axis has been
prenormalized.
*/
- setRow()
C++ Interface: set_row(const LMatrix4d self, int row, const LVecBase4d v) set_row(const LMatrix4d self, int row, const LVecBase3d v)
- setScaleMat()
C++ Interface: set_scale_mat(const LMatrix4d self, const LVecBase3d scale)
- /**
Fills mat with a matrix that applies the indicated scale in each of the
three axes.
*/
- setScaleShearMat()
C++ Interface: set_scale_shear_mat(const LMatrix4d self, const LVecBase3d scale, const LVecBase3d shear, int cs)
- /**
Fills mat with a matrix that applies the indicated scale and shear.
*/
- setShearMat()
C++ Interface: set_shear_mat(const LMatrix4d self, const LVecBase3d shear, int cs)
- /**
Fills mat with a matrix that applies the indicated shear in each of the
three planes.
*/
- setTranslateMat()
C++ Interface: set_translate_mat(const LMatrix4d self, const LVecBase3d trans)
- /**
Fills mat with a matrix that applies the indicated translation.
*/
- setUpper3()
C++ Interface: set_upper_3(const LMatrix4d self, const LMatrix3d upper3)
// Get and set the upper 3x3 rotation matrix.
- /**
Sets the upper 3x3 submatrix.
*/
- set_cell()
C++ Interface: set_cell(const LMatrix4d self, int row, int col, double value)
- /**
Changes a particular element of the matrix.
*/
- set_col()
C++ Interface: set_col(const LMatrix4d self, int col, const LVecBase4d v) set_col(const LMatrix4d self, int col, const LVecBase3d v)
- set_rotate_mat()
C++ Interface: set_rotate_mat(const LMatrix4d self, double angle, const LVecBase3d axis, int cs)
- /**
Sets mat to a matrix that rotates by the given angle in degrees
counterclockwise about the indicated vector.
*/
- set_rotate_mat_normaxis()
C++ Interface: set_rotate_mat_normaxis(const LMatrix4d self, double angle, const LVecBase3d axis, int cs)
- /**
Fills mat with a matrix that rotates by the given angle in degrees
counterclockwise about the indicated vector. Assumes axis has been
prenormalized.
*/
- set_row()
C++ Interface: set_row(const LMatrix4d self, int row, const LVecBase4d v) set_row(const LMatrix4d self, int row, const LVecBase3d v)
- set_scale_mat()
C++ Interface: set_scale_mat(const LMatrix4d self, const LVecBase3d scale)
- /**
Fills mat with a matrix that applies the indicated scale in each of the
three axes.
*/
- set_scale_shear_mat()
C++ Interface: set_scale_shear_mat(const LMatrix4d self, const LVecBase3d scale, const LVecBase3d shear, int cs)
- /**
Fills mat with a matrix that applies the indicated scale and shear.
*/
- set_shear_mat()
C++ Interface: set_shear_mat(const LMatrix4d self, const LVecBase3d shear, int cs)
- /**
Fills mat with a matrix that applies the indicated shear in each of the
three planes.
*/
- set_translate_mat()
C++ Interface: set_translate_mat(const LMatrix4d self, const LVecBase3d trans)
- /**
Fills mat with a matrix that applies the indicated translation.
*/
- set_upper_3()
C++ Interface: set_upper_3(const LMatrix4d self, const LMatrix3d upper3)
// Get and set the upper 3x3 rotation matrix.
- /**
Sets the upper 3x3 submatrix.
*/
- shearMat()
C++ Interface: shear_mat(const LVecBase3d shear) shear_mat(const LVecBase3d shear, int cs) shear_mat(double shxy, double shxz, double shyz, int cs)
- shear_mat()
C++ Interface: shear_mat(const LVecBase3d shear) shear_mat(const LVecBase3d shear, int cs) shear_mat(double shxy, double shxz, double shyz, int cs)
- translateMat()
C++ Interface: translate_mat(const LVecBase3d trans) translate_mat(double tx, double ty, double tz)
- translate_mat()
C++ Interface: translate_mat(const LVecBase3d trans) translate_mat(double tx, double ty, double tz)
- writeDatagram()
C++ Interface: write_datagram(LMatrix4d self, Datagram destination)
- /**
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.
*/
- writeDatagramFixed()
C++ Interface: write_datagram_fixed(LMatrix4d self, Datagram destination)
- /**
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.
*/
- write_datagram()
C++ Interface: write_datagram(LMatrix4d self, Datagram destination)
- /**
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.
*/
- write_datagram_fixed()
C++ Interface: write_datagram_fixed(LMatrix4d self, Datagram destination)
- /**
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.
*/
- xform()
C++ Interface: xform(LMatrix4d self, const LVecBase4d v)
- /**
4-component vector or point times matrix. This is a fully general
operation.
*/
- xformInPlace()
C++ Interface: xform_in_place(LMatrix4d self, LVecBase4d v)
- /**
4-component vector or point times matrix. This is a fully general
operation.
*/
- xformPoint()
C++ Interface: xform_point(LMatrix4d self, const LVecBase3d v)
- /**
The matrix transforms a 3-component point (including translation component)
and returns the result. This assumes the matrix is an affine transform.
*/
- xformPointGeneral()
C++ Interface: xform_point_general(LMatrix4d self, const LVecBase3d v)
- /**
The matrix transforms a 3-component point (including translation component)
and returns the result, as a fully general operation.
*/
- xformPointGeneralInPlace()
C++ Interface: xform_point_general_in_place(LMatrix4d self, LVecBase3d v)
- /**
The matrix transforms a 3-component point (including translation
component), as a fully general operation.
*/
- xformPointInPlace()
C++ Interface: xform_point_in_place(LMatrix4d self, LVecBase3d v)
- /**
The matrix transforms a 3-component point (including translation
component). This assumes the matrix is an affine transform.
*/
- xformVec()
C++ Interface: xform_vec(LMatrix4d self, const LVecBase3d v)
- /**
The matrix transforms a 3-component vector (without translation component)
and returns the result. This assumes the matrix is an orthonormal
transform.
*/
- xformVecGeneral()
C++ Interface: xform_vec_general(LMatrix4d self, const LVecBase3d v)
- /**
The matrix transforms a 3-component vector (without translation component)
and returns the result, as a fully general operation.
*/
- xformVecGeneralInPlace()
C++ Interface: xform_vec_general_in_place(LMatrix4d self, LVecBase3d v)
- /**
The matrix transforms a 3-component vector (without translation component),
as a fully general operation.
*/
- xformVecInPlace()
C++ Interface: xform_vec_in_place(LMatrix4d self, LVecBase3d v)
- /**
The matrix transforms a 3-component vector (without translation component).
This assumes the matrix is an orthonormal transform.
*/
- xform_in_place()
C++ Interface: xform_in_place(LMatrix4d self, LVecBase4d v)
- /**
4-component vector or point times matrix. This is a fully general
operation.
*/
- xform_point()
C++ Interface: xform_point(LMatrix4d self, const LVecBase3d v)
- /**
The matrix transforms a 3-component point (including translation component)
and returns the result. This assumes the matrix is an affine transform.
*/
- xform_point_general()
C++ Interface: xform_point_general(LMatrix4d self, const LVecBase3d v)
- /**
The matrix transforms a 3-component point (including translation component)
and returns the result, as a fully general operation.
*/
- xform_point_general_in_place()
C++ Interface: xform_point_general_in_place(LMatrix4d self, LVecBase3d v)
- /**
The matrix transforms a 3-component point (including translation
component), as a fully general operation.
*/
- xform_point_in_place()
C++ Interface: xform_point_in_place(LMatrix4d self, LVecBase3d v)
- /**
The matrix transforms a 3-component point (including translation
component). This assumes the matrix is an affine transform.
*/
- xform_vec()
C++ Interface: xform_vec(LMatrix4d self, const LVecBase3d v)
- /**
The matrix transforms a 3-component vector (without translation component)
and returns the result. This assumes the matrix is an orthonormal
transform.
*/
- xform_vec_general()
C++ Interface: xform_vec_general(LMatrix4d self, const LVecBase3d v)
- /**
The matrix transforms a 3-component vector (without translation component)
and returns the result, as a fully general operation.
*/
- xform_vec_general_in_place()
C++ Interface: xform_vec_general_in_place(LMatrix4d self, LVecBase3d v)
- /**
The matrix transforms a 3-component vector (without translation component),
as a fully general operation.
*/
- xform_vec_in_place()
C++ Interface: xform_vec_in_place(LMatrix4d self, LVecBase3d v)
- /**
The matrix transforms a 3-component vector (without translation component).
This assumes the matrix is an orthonormal transform.
*/
- yToZUpMat()
C++ Interface: y_to_z_up_mat()
- /**
Returns a matrix that transforms from the Y-up coordinate system to the
Z-up coordinate system.
*/
- y_to_z_up_mat()
C++ Interface: y_to_z_up_mat()
- /**
Returns a matrix that transforms from the Y-up coordinate system to the
Z-up coordinate system.
*/
- zToYUpMat()
C++ Interface: z_to_y_up_mat()
- /**
Returns a matrix that transforms from the Y-up coordinate system to the
Z-up coordinate system.
*/