Panda3D
 All Classes Functions Variables Enumerations
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
LMatrix4f Class Reference

This is a 4-by-4 transform matrix. More...

#include "lmatrix.h"

Classes

class  CRow
 
class  Row
 

Public Types

enum  { num_components = 16, is_int = 0 }
 
typedef const float * const_iterator
 
typedef LSimpleMatrix< float, 4, 4 > EMatrix4
 
typedef const float * iterator
 
typedef float numeric_type
 

Public Member Functions

 LMatrix4f (const LMatrix4f &other)
 
 LMatrix4f (const UnalignedLMatrix4f &other)
 
 LMatrix4f (float e00, float e01, float e02, float e03, float e10, float e11, float e12, float e13, float e20, float e21, float e22, float e23, float e30, float e31, float e32, float e33)
 
 LMatrix4f (const LMatrix3f &upper3)
 
 LMatrix4f (const LMatrix3f &upper3, const LVecBase3f &trans)
 
 LMatrix4f (const EMatrix4 &m)
 
void accumulate (const LMatrix4f &other, float weight)
 Computes (*this) += other * weight. More...
 
size_t add_hash (size_t hash) const
 Adds the vector into the running hash. More...
 
size_t add_hash (size_t hash, float threshold) const
 Adds the vector into the running hash. More...
 
bool almost_equal (const LMatrix4f &other, float threshold) const
 Returns true if two matrices are memberwise equal within a specified tolerance. More...
 
bool almost_equal (const LMatrix4f &other) const
 Returns true if two matrices are memberwise equal within a default tolerance based on the numeric type. More...
 
iterator begin ()
 Returns an iterator that may be used to traverse the elements of the matrix, STL-style. More...
 
const_iterator begin () const
 Returns an iterator that may be used to traverse the elements of the matrix, STL-style. More...
 
int compare_to (const LMatrix4f &other) const
 This flavor of compare_to uses a default threshold value based on the numeric type. More...
 
int compare_to (const LMatrix4f &other, float threshold) const
 Sorts matrices lexicographically, componentwise. More...
 
void componentwise_mult (const LMatrix4f &other)
 
iterator end ()
 Returns an iterator that may be used to traverse the elements of the matrix, STL-style. More...
 
const_iterator end () const
 Returns an iterator that may be used to traverse the elements of the matrix, STL-style. More...
 
void fill (float fill_value)
 Sets each element of the matrix to the indicated fill_value. More...
 
void generate_hash (ChecksumHashGenerator &hashgen) const
 Adds the vector to the indicated hash generator. More...
 
void generate_hash (ChecksumHashGenerator &hashgen, float scale) const
 Adds the vector to the indicated hash generator. More...
 
float get_cell (int row, int col) const
 Returns a particular element of the matrix. More...
 
LVecBase4f get_col (int col) const
 Retrieves the indicated column of the matrix as a 4-component vector. More...
 
LVecBase3f get_col3 (int col) const
 Retrieves the indicated column of the matrix as a 3-component vector, ignoring the last row. More...
 
const float * get_data () const
 Returns the address of the first of the nine data elements in the matrix. More...
 
size_t get_hash () const
 Returns a suitable hash for phash_map. More...
 
size_t get_hash (float threshold) const
 Returns a suitable hash for phash_map. More...
 
int get_num_components () const
 Returns the number of elements in the matrix, 16. More...
 
LVecBase4f get_row (int row) const
 Retrieves the indicated row of the matrix as a 4-component vector. More...
 
void get_row (LVecBase4f &result_vec, int row) const
 Stores the indicated row of the matrix as a 4-component vector. More...
 
LVecBase3f get_row3 (int row) const
 Retrieves the row column of the matrix as a 3-component vector, ignoring the last column. More...
 
void get_row3 (LVecBase3f &result_vec, int row) const
 Stores the row column of the matrix as a 3-component vector, ignoring the last column. More...
 
LMatrix3f get_upper_3 () const
 Retrieves the upper 3x3 submatrix. More...
 
bool invert_affine_from (const LMatrix4f &other)
 Performs an invert of the indicated matrix, storing the result in this matrix. More...
 
bool invert_from (const LMatrix4f &other)
 Computes the inverse of the other matrix, and stores the result in this matrix. More...
 
bool invert_in_place ()
 Inverts the current matrix. More...
 
bool is_identity () const
 Returns true if this is (close enough to) the identity matrix, false otherwise. More...
 
bool is_nan () const
 Returns true if any component of the matrix is not-a-number, false otherwise. More...
 
 MAKE_SEQ (get_rows, size, get_row)
 
 MAKE_SEQ (get_cols, size, get_col)
 
 MAKE_SEQ (get_row3s, size, get_row3)
 
void multiply (const LMatrix4f &other1, const LMatrix4f &other2)
 
bool operator!= (const LMatrix4f &other) const
 
float & operator() (int row, int col)
 
float operator() (int row, int col) const
 
LMatrix4f operator* (const LMatrix4f &other) const
 
LMatrix4f operator* (float scalar) const
 
LMatrix4foperator*= (const LMatrix4f &other)
 
LMatrix4foperator*= (float scalar)
 
LMatrix4foperator+= (const LMatrix4f &other)
 Performs a memberwise addition between two matrices. More...
 
LMatrix4foperator-= (const LMatrix4f &other)
 Performs a memberwise addition between two matrices. More...
 
LMatrix4f operator/ (float scalar) const
 
LMatrix4foperator/= (float scalar)
 
bool operator< (const LMatrix4f &other) const
 This performs a lexicographical comparison. More...
 
LMatrix4foperator= (const LMatrix4f &other)
 
LMatrix4foperator= (const UnalignedLMatrix4f &other)
 
LMatrix4foperator= (float fill_value)
 
bool operator== (const LMatrix4f &other) const
 
CRow operator[] (int i) const
 
Row operator[] (int i)
 
void output (ostream &out) const
 
void read_datagram (DatagramIterator &source)
 Reads the matrix from the Datagram using get_stdfloat(). More...
 
void read_datagram_fixed (DatagramIterator &scan)
 Reads the matrix from the Datagram using get_float32() or get_float64(). More...
 
void set (float e00, float e01, float e02, float e03, float e10, float e11, float e12, float e13, float e20, float e21, float e22, float e23, float e30, float e31, float e32, float e33)
 
void set_cell (int row, int col, float value)
 Changes a particular element of the matrix. More...
 
void set_col (int col, const LVecBase4f &v)
 Replaces the indicated column of the matrix. More...
 
void set_col (int col, const LVecBase3f &v)
 Replaces the indicated column of the matrix with the indicated 3-component vector, ignoring the last row. More...
 
void set_rotate_mat (float angle, const LVecBase3f &axis, CoordinateSystem cs=CS_default)
 Sets mat to a matrix that rotates by the given angle in degrees counterclockwise about the indicated vector. More...
 
void set_rotate_mat_normaxis (float angle, const LVecBase3f &axis, CoordinateSystem cs=CS_default)
 Fills mat with a matrix that rotates by the given angle in degrees counterclockwise about the indicated vector. More...
 
void set_row (int row, const LVecBase4f &v)
 Replaces the indicated row of the matrix. More...
 
void set_row (int row, const LVecBase3f &v)
 Replaces the indicated row of the matrix with the indicated 3-component vector, ignoring the last column. More...
 
void set_scale_mat (const LVecBase3f &scale)
 Fills mat with a matrix that applies the indicated scale in each of the three axes. More...
 
void set_scale_shear_mat (const LVecBase3f &scale, const LVecBase3f &shear, CoordinateSystem cs=CS_default)
 Fills mat with a matrix that applies the indicated scale and shear. More...
 
void set_shear_mat (const LVecBase3f &shear, CoordinateSystem cs=CS_default)
 Fills mat with a matrix that applies the indicated shear in each of the three planes. More...
 
void set_translate_mat (const LVecBase3f &trans)
 Fills mat with a matrix that applies the indicated translation. More...
 
void set_upper_3 (const LMatrix3f &upper3)
 Sets the upper 3x3 submatrix. More...
 
void transpose_from (const LMatrix4f &other)
 
void transpose_in_place ()
 
void write (ostream &out, int indent_level=0) const
 
void write_datagram (Datagram &destination) const
 Writes the matrix to the Datagram using add_stdfloat(). More...
 
void write_datagram_fixed (Datagram &destination) const
 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(). More...
 
LVecBase4f xform (const LVecBase4f &v) const
 4-component vector or point times matrix. More...
 
void xform_in_place (LVecBase4f &v) const
 4-component vector or point times matrix. More...
 
LVecBase3f xform_point (const LVecBase3f &v) const
 The matrix transforms a 3-component point (including translation component) and returns the result. More...
 
LVecBase3f xform_point_general (const LVecBase3f &v) const
 The matrix transforms a 3-component point (including translation component) and returns the result, as a fully general operation. More...
 
void xform_point_general_in_place (LVecBase3f &v) const
 The matrix transforms a 3-component point (including translation component), as a fully general operation. More...
 
void xform_point_in_place (LVecBase3f &v) const
 The matrix transforms a 3-component point (including translation component). More...
 
LVecBase3f xform_vec (const LVecBase3f &v) const
 The matrix transforms a 3-component vector (without translation component) and returns the result. More...
 
LVecBase3f xform_vec_general (const LVecBase3f &v) const
 The matrix transforms a 3-component vector (without translation component) and returns the result, as a fully general operation. More...
 
void xform_vec_general_in_place (LVecBase3f &v) const
 The matrix transforms a 3-component vector (without translation component), as a fully general operation. More...
 
void xform_vec_in_place (LVecBase3f &v) const
 The matrix transforms a 3-component vector (without translation component). More...
 

Static Public Member Functions

static const LMatrix4fconvert_mat (CoordinateSystem from, CoordinateSystem to)
 Returns a matrix that transforms from the indicated coordinate system to the indicated coordinate system. More...
 
static TypeHandle get_class_type ()
 
static const LMatrix4fident_mat ()
 Returns an identity matrix. More...
 
static void init_type ()
 
static const LMatrix4fones_mat ()
 Returns an matrix filled with ones. More...
 
static LMatrix4f rotate_mat (float angle, const LVecBase3f &axis, CoordinateSystem cs=CS_default)
 Returns a matrix that rotates by the given angle in degrees counterclockwise about the indicated vector. More...
 
static LMatrix4f rotate_mat_normaxis (float angle, const LVecBase3f &axis, CoordinateSystem cs=CS_default)
 Returns a matrix that rotates by the given angle in degrees counterclockwise about the indicated vector. More...
 
static LMatrix4f scale_mat (const LVecBase3f &scale)
 Returns a matrix that applies the indicated scale in each of the three axes. More...
 
static LMatrix4f scale_mat (float sx, float sy, float sz)
 Returns a matrix that applies the indicated scale in each of the three axes. More...
 
static LMatrix4f scale_mat (float scale)
 Returns a matrix that applies the indicated uniform scale. More...
 
static LMatrix4f scale_shear_mat (const LVecBase3f &scale, const LVecBase3f &shear, CoordinateSystem cs=CS_default)
 Returns a matrix that applies the indicated scale and shear. More...
 
static LMatrix4f scale_shear_mat (float sx, float sy, float sz, float shxy, float shxz, float shyz, CoordinateSystem cs=CS_default)
 Returns a matrix that applies the indicated scale and shear. More...
 
static LMatrix4f shear_mat (const LVecBase3f &shear, CoordinateSystem cs=CS_default)
 Returns a matrix that applies the indicated shear in each of the three planes. More...
 
static LMatrix4f shear_mat (float shxy, float shxz, float shyz, CoordinateSystem cs=CS_default)
 Returns a matrix that applies the indicated shear in each of the three planes. More...
 
static int size ()
 Returns 4: the number of rows of a LMatrix4. More...
 
static LMatrix4f translate_mat (const LVecBase3f &trans)
 Returns a matrix that applies the indicated translation. More...
 
static LMatrix4f translate_mat (float tx, float ty, float tz)
 Returns a matrix that applies the indicated translation. More...
 
static const LMatrix4fy_to_z_up_mat ()
 Returns a matrix that transforms from the Y-up coordinate system to the Z-up coordinate system. More...
 
static const LMatrix4fz_to_y_up_mat ()
 Returns a matrix that transforms from the Y-up coordinate system to the Z-up coordinate system. More...
 
static const LMatrix4fzeros_mat ()
 Returns an matrix filled with zeros. More...
 

Public Attributes

EMatrix4 _m
 

Detailed Description

This is a 4-by-4 transform matrix.

Definition at line 451 of file lmatrix.h.

Member Function Documentation

void LMatrix4f::accumulate ( const LMatrix4f other,
float  weight 
)
inline

Computes (*this) += other * weight.

Definition at line 2300 of file lmatrix.h.

Referenced by VertexTransform::accumulate_matrix(), and JointVertexTransform::accumulate_matrix().

size_t LMatrix4f::add_hash ( size_t  hash) const
inline

Adds the vector into the running hash.

Definition at line 1597 of file lmatrix.h.

size_t LMatrix4f::add_hash ( size_t  hash,
float  threshold 
) const
inline

Adds the vector into the running hash.

Definition at line 1607 of file lmatrix.h.

bool LMatrix4f::almost_equal ( const LMatrix4f other,
float  threshold 
) const

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.

Definition at line 879 of file lmatrix.cxx.

Referenced by GeomTransformer::apply_texture_colors(), ProjectionScreen::recompute_if_stale(), CollisionNode::xform(), PartBundleNode::xform(), and PolylightNode::xform().

bool LMatrix4f::almost_equal ( const LMatrix4f other) const
inline

Returns true if two matrices are memberwise equal within a default tolerance based on the numeric type.

Definition at line 2579 of file lmatrix.h.

LMatrix4f::iterator LMatrix4f::begin ( )
inline

Returns an iterator that may be used to traverse the elements of the matrix, STL-style.

Definition at line 1489 of file lmatrix.h.

LMatrix4f::const_iterator LMatrix4f::begin ( ) const
inline

Returns an iterator that may be used to traverse the elements of the matrix, STL-style.

Definition at line 1511 of file lmatrix.h.

int LMatrix4f::compare_to ( const LMatrix4f other) const
inline

This flavor of compare_to uses a default threshold value based on the numeric type.

Definition at line 1567 of file lmatrix.h.

int LMatrix4f::compare_to ( const LMatrix4f other,
float  threshold 
) const

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).

Definition at line 724 of file lmatrix.cxx.

const LMatrix4f & LMatrix4f::convert_mat ( CoordinateSystem  from,
CoordinateSystem  to 
)
static

Returns a matrix that transforms from the indicated coordinate system to the indicated coordinate system.

Definition at line 656 of file lmatrix.cxx.

Referenced by DXGraphicsStateGuardian9::bind_light(), SpeedTreeNode::cull_callback(), GraphicsStateGuardian::fetch_specified_part(), GraphicsStateGuardian::set_coordinate_system(), and StaticTextFont::StaticTextFont().

LMatrix4f::iterator LMatrix4f::end ( )
inline

Returns an iterator that may be used to traverse the elements of the matrix, STL-style.

Definition at line 1500 of file lmatrix.h.

LMatrix4f::const_iterator LMatrix4f::end ( ) const
inline

Returns an iterator that may be used to traverse the elements of the matrix, STL-style.

Definition at line 1522 of file lmatrix.h.

void LMatrix4f::fill ( float  fill_value)
inline

Sets each element of the matrix to the indicated fill_value.

This is of questionable value, but is sometimes useful when initializing to zero.

Definition at line 1093 of file lmatrix.h.

void LMatrix4f::generate_hash ( ChecksumHashGenerator hashgen) const
inline

Adds the vector to the indicated hash generator.

Definition at line 2589 of file lmatrix.h.

void LMatrix4f::generate_hash ( ChecksumHashGenerator hashgen,
float  scale 
) const

Adds the vector to the indicated hash generator.

Definition at line 973 of file lmatrix.cxx.

float LMatrix4f::get_cell ( int  row,
int  col 
) const
inline

Returns a particular element of the matrix.

Definition at line 1444 of file lmatrix.h.

LVecBase4f LMatrix4f::get_col ( int  col) const
inline

Retrieves the indicated column of the matrix as a 4-component vector.

Definition at line 1294 of file lmatrix.h.

Referenced by CubicCurveseg::CubicCurveseg(), and NurbsCurve::rebuild_curveseg().

LVecBase3f LMatrix4f::get_col3 ( int  col) const
inline

Retrieves the indicated column of the matrix as a 3-component vector, ignoring the last row.

Definition at line 1346 of file lmatrix.h.

const float * LMatrix4f::get_data ( ) const
inline

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.

Definition at line 1468 of file lmatrix.h.

Referenced by DXGraphicsStateGuardian9::begin_draw_primitives(), SpeedTreeNode::cull_callback(), DXGraphicsStateGuardian9::end_draw_primitives(), DXShaderContext9::issue_parameters(), and DXGraphicsStateGuardian9::prepare_lens().

size_t LMatrix4f::get_hash ( ) const
inline

Returns a suitable hash for phash_map.

Definition at line 1577 of file lmatrix.h.

size_t LMatrix4f::get_hash ( float  threshold) const
inline

Returns a suitable hash for phash_map.

Definition at line 1587 of file lmatrix.h.

int LMatrix4f::get_num_components ( ) const
inline

Returns the number of elements in the matrix, 16.

Definition at line 1478 of file lmatrix.h.

LVecBase4f LMatrix4f::get_row ( int  row) const
inline

Retrieves the indicated row of the matrix as a 4-component vector.

Definition at line 1258 of file lmatrix.h.

Referenced by GeomVertexWriter::add_matrix4f(), NurbsCurveResult::eval_segment_extended_point(), NurbsCurveResult::eval_segment_extended_points(), and GeomVertexWriter::set_matrix4f().

void LMatrix4f::get_row ( LVecBase4f result_vec,
int  row 
) const
inline

Stores the indicated row of the matrix as a 4-component vector.

Definition at line 1276 of file lmatrix.h.

LVecBase3f LMatrix4f::get_row3 ( int  row) const
inline
void LMatrix4f::get_row3 ( LVecBase3f result_vec,
int  row 
) const
inline

Stores the row column of the matrix as a 3-component vector, ignoring the last column.

Definition at line 1329 of file lmatrix.h.

LMatrix3f LMatrix4f::get_upper_3 ( ) const
inline

Retrieves the upper 3x3 submatrix.

Definition at line 1169 of file lmatrix.h.

Referenced by PhysxManager::mat4_to_nxMat34().

const LMatrix4f & LMatrix4f::ident_mat ( )
inlinestatic
bool LMatrix4f::invert_affine_from ( const LMatrix4f other)
inline

Performs an invert of the indicated matrix, storing the result in this matrix.

The calculation is only correct of the other matrix represents an affine transform.

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 there was a singularity.

Definition at line 2249 of file lmatrix.h.

Referenced by Lens::set_frustum_from_corners().

bool LMatrix4f::invert_from ( const LMatrix4f other)
inline

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.

Definition at line 2173 of file lmatrix.h.

Referenced by PGItem::activate_region(), CollisionBox::rederive_to_3d_mat(), Lens::set_frustum_from_corners(), and CollisionBox::setup_points().

bool LMatrix4f::invert_in_place ( )
inline

Inverts the current matrix.

Returns true if the inverse is successful, false if the matrix was singular.

Definition at line 2288 of file lmatrix.h.

Referenced by CMotionTrail::update_motion_trail().

bool LMatrix4f::is_identity ( ) const
inline

Returns true if this is (close enough to) the identity matrix, false otherwise.

Definition at line 1433 of file lmatrix.h.

bool LMatrix4f::is_nan ( ) const
inline
const LMatrix4f & LMatrix4f::ones_mat ( )
inlinestatic

Returns an matrix filled with ones.

Definition at line 913 of file lmatrix.h.

Referenced by GraphicsStateGuardian::fetch_specified_part().

LMatrix4f & LMatrix4f::operator+= ( const LMatrix4f other)
inline

Performs a memberwise addition between two matrices.

Definition at line 1933 of file lmatrix.h.

LMatrix4f & LMatrix4f::operator-= ( const LMatrix4f other)
inline

Performs a memberwise addition between two matrices.

Definition at line 1969 of file lmatrix.h.

bool LMatrix4f::operator< ( const LMatrix4f other) const
inline

This performs a lexicographical comparison.

It's of questionable mathematical meaning, but sometimes has a practical purpose for sorting unique vectors, especially in an STL container. Also see compare_to().

Definition at line 1536 of file lmatrix.h.

void LMatrix4f::read_datagram ( DatagramIterator source)

Reads the matrix from the Datagram using get_stdfloat().

Definition at line 1162 of file lmatrix.cxx.

void LMatrix4f::read_datagram_fixed ( DatagramIterator scan)

Reads the matrix from the Datagram using get_float32() or get_float64().

See write_datagram_fixed().

Definition at line 1127 of file lmatrix.cxx.

LMatrix4f LMatrix4f::rotate_mat ( float  angle,
const LVecBase3f axis,
CoordinateSystem  cs = CS_default 
)
inlinestatic

Returns a matrix that rotates by the given angle in degrees counterclockwise about the indicated vector.

Definition at line 2425 of file lmatrix.h.

LMatrix4f LMatrix4f::rotate_mat_normaxis ( float  angle,
const LVecBase3f axis,
CoordinateSystem  cs = CS_default 
)
inlinestatic

Returns a matrix that rotates by the given angle in degrees counterclockwise about the indicated vector.

Assumes axis has been prenormalized.

Definition at line 2440 of file lmatrix.h.

LMatrix4f LMatrix4f::scale_mat ( const LVecBase3f scale)
inlinestatic

Returns a matrix that applies the indicated scale in each of the three axes.

Definition at line 2456 of file lmatrix.h.

LMatrix4f LMatrix4f::scale_mat ( float  sx,
float  sy,
float  sz 
)
inlinestatic

Returns a matrix that applies the indicated scale in each of the three axes.

Definition at line 2471 of file lmatrix.h.

LMatrix4f LMatrix4f::scale_mat ( float  scale)
inlinestatic

Returns a matrix that applies the indicated uniform scale.

Definition at line 2485 of file lmatrix.h.

LMatrix4f LMatrix4f::scale_shear_mat ( const LVecBase3f scale,
const LVecBase3f shear,
CoordinateSystem  cs = CS_default 
)
inlinestatic

Returns a matrix that applies the indicated scale and shear.

Definition at line 2526 of file lmatrix.h.

Referenced by MovingPartMatrix::get_blend_value().

LMatrix4f LMatrix4f::scale_shear_mat ( float  sx,
float  sy,
float  sz,
float  shxy,
float  shxz,
float  shyz,
CoordinateSystem  cs = CS_default 
)
inlinestatic

Returns a matrix that applies the indicated scale and shear.

Definition at line 2541 of file lmatrix.h.

void LMatrix4f::set_cell ( int  row,
int  col,
float  value 
)
inline

Changes a particular element of the matrix.

Definition at line 1455 of file lmatrix.h.

void LMatrix4f::set_col ( int  col,
const LVecBase4f v 
)
inline

Replaces the indicated column of the matrix.

Definition at line 1204 of file lmatrix.h.

Referenced by NurbsCurve::rebuild_curveseg().

void LMatrix4f::set_col ( int  col,
const LVecBase3f v 
)
inline

Replaces the indicated column of the matrix with the indicated 3-component vector, ignoring the last row.

Definition at line 1241 of file lmatrix.h.

void LMatrix4f::set_rotate_mat ( float  angle,
const LVecBase3f axis,
CoordinateSystem  cs = CS_default 
)

Sets mat to a matrix that rotates by the given angle in degrees counterclockwise about the indicated vector.

Definition at line 746 of file lmatrix.cxx.

void LMatrix4f::set_rotate_mat_normaxis ( float  angle,
const LVecBase3f axis,
CoordinateSystem  cs = CS_default 
)

Fills mat with a matrix that rotates by the given angle in degrees counterclockwise about the indicated vector.

Assumes axis has been prenormalized.

Definition at line 817 of file lmatrix.cxx.

void LMatrix4f::set_row ( int  row,
const LVecBase4f v 
)
inline
void LMatrix4f::set_row ( int  row,
const LVecBase3f v 
)
inline

Replaces the indicated row of the matrix with the indicated 3-component vector, ignoring the last column.

Definition at line 1223 of file lmatrix.h.

void LMatrix4f::set_scale_mat ( const LVecBase3f scale)
inline

Fills mat with a matrix that applies the indicated scale in each of the three axes.

Definition at line 2347 of file lmatrix.h.

void LMatrix4f::set_scale_shear_mat ( const LVecBase3f scale,
const LVecBase3f shear,
CoordinateSystem  cs = CS_default 
)
inline

Fills mat with a matrix that applies the indicated scale and shear.

Definition at line 2373 of file lmatrix.h.

void LMatrix4f::set_shear_mat ( const LVecBase3f shear,
CoordinateSystem  cs = CS_default 
)
inline

Fills mat with a matrix that applies the indicated shear in each of the three planes.

Definition at line 2361 of file lmatrix.h.

void LMatrix4f::set_translate_mat ( const LVecBase3f trans)
inline

Fills mat with a matrix that applies the indicated translation.

Definition at line 2333 of file lmatrix.h.

void LMatrix4f::set_upper_3 ( const LMatrix3f upper3)
inline

Sets the upper 3x3 submatrix.

Definition at line 1144 of file lmatrix.h.

LMatrix4f LMatrix4f::shear_mat ( const LVecBase3f shear,
CoordinateSystem  cs = CS_default 
)
inlinestatic

Returns a matrix that applies the indicated shear in each of the three planes.

Definition at line 2499 of file lmatrix.h.

LMatrix4f LMatrix4f::shear_mat ( float  shxy,
float  shxz,
float  shyz,
CoordinateSystem  cs = CS_default 
)
inlinestatic

Returns a matrix that applies the indicated shear in each of the three planes.

Definition at line 2512 of file lmatrix.h.

int LMatrix4f::size ( )
inlinestatic

Returns 4: the number of rows of a LMatrix4.

Definition at line 1406 of file lmatrix.h.

LMatrix4f LMatrix4f::translate_mat ( const LVecBase3f trans)
inlinestatic

Returns a matrix that applies the indicated translation.

Definition at line 2397 of file lmatrix.h.

Referenced by GraphicsStateGuardian::fetch_specified_part(), PhysicsObject::get_lcs(), Trackball::move_origin(), CollisionLevelStateBase::prepare_collider(), and Trackball::set_origin().

LMatrix4f LMatrix4f::translate_mat ( float  tx,
float  ty,
float  tz 
)
inlinestatic

Returns a matrix that applies the indicated translation.

Definition at line 2411 of file lmatrix.h.

void LMatrix4f::write_datagram ( Datagram destination) const

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.

Definition at line 1148 of file lmatrix.cxx.

Referenced by CharacterJoint::write_datagram(), and CollisionBox::write_datagram().

void LMatrix4f::write_datagram_fixed ( Datagram destination) const

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.

Definition at line 1108 of file lmatrix.cxx.

LVecBase4f LMatrix4f::xform ( const LVecBase4f v) const
inline

4-component vector or point times matrix.

This is a fully general operation.

Definition at line 1647 of file lmatrix.h.

Referenced by CMotionTrail::update_motion_trail().

void LMatrix4f::xform_in_place ( LVecBase4f v) const
inline

4-component vector or point times matrix.

This is a fully general operation.

Definition at line 1751 of file lmatrix.h.

LVecBase3f LMatrix4f::xform_point ( const LVecBase3f v) const
inline

The matrix transforms a 3-component point (including translation component) and returns the result.

This assumes the matrix is an affine transform.

Definition at line 1667 of file lmatrix.h.

Referenced by GeomPrimitive::calc_tight_bounds(), GraphicsStateGuardian::fetch_specified_part(), GraphicsStateGuardian::fetch_specified_value(), Texture::generate_normalization_cube_map(), PNMImage::remix_channels(), and Lens::set_frustum_from_corners().

LVecBase3f LMatrix4f::xform_point_general ( const LVecBase3f v) const
inline

The matrix transforms a 3-component point (including translation component) and returns the result, as a fully general operation.

Definition at line 1692 of file lmatrix.h.

Referenced by PfmVizzer::extrude().

void LMatrix4f::xform_point_general_in_place ( LVecBase3f v) const
inline

The matrix transforms a 3-component point (including translation component), as a fully general operation.

Definition at line 1787 of file lmatrix.h.

Referenced by PfmFile::xform().

void LMatrix4f::xform_point_in_place ( LVecBase3f v) const
inline

The matrix transforms a 3-component point (including translation component).

This assumes the matrix is an affine transform.

Definition at line 1769 of file lmatrix.h.

LVecBase3f LMatrix4f::xform_vec ( const LVecBase3f v) const
inline

The matrix transforms a 3-component vector (without translation component) and returns the result.

This assumes the matrix is an orthonormal transform.

Definition at line 1707 of file lmatrix.h.

Referenced by GraphicsStateGuardian::fetch_specified_part(), and GraphicsStateGuardian::fetch_specified_value().

LVecBase3f LMatrix4f::xform_vec_general ( const LVecBase3f v) const
inline

The matrix transforms a 3-component vector (without translation component) and returns the result, as a fully general operation.

Definition at line 1732 of file lmatrix.h.

void LMatrix4f::xform_vec_general_in_place ( LVecBase3f v) const
inline

The matrix transforms a 3-component vector (without translation component), as a fully general operation.

Definition at line 1818 of file lmatrix.h.

void LMatrix4f::xform_vec_in_place ( LVecBase3f v) const
inline

The matrix transforms a 3-component vector (without translation component).

This assumes the matrix is an orthonormal transform.

Definition at line 1800 of file lmatrix.h.

const LMatrix4f & LMatrix4f::y_to_z_up_mat ( )
inlinestatic

Returns a matrix that transforms from the Y-up coordinate system to the Z-up coordinate system.

Definition at line 2557 of file lmatrix.h.

Referenced by PhysxHeightFieldShapeDesc::set_to_default(), and PhysxWheelShapeDesc::set_to_default().

const LMatrix4f & LMatrix4f::z_to_y_up_mat ( )
inlinestatic

Returns a matrix that transforms from the Y-up coordinate system to the Z-up coordinate system.

Definition at line 2568 of file lmatrix.h.

const LMatrix4f & LMatrix4f::zeros_mat ( )
inlinestatic

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