#include <Matrix4.h>
Public Methods | |
Matrix4 (void) | |
identity constructor. More... | |
Matrix4 (float f) | |
const elements constructor. More... | |
Matrix4 (const float *m) | |
construct from float array. More... | |
Matrix4 (const Matrix4 &m) | |
copy constructor. More... | |
~Matrix4 (void) | |
destructor. More... | |
void | multpoint3d (const float[3], float[3]) const |
multiplies a 3D point (first arg) by the Matrix, returns in second arg. More... | |
void | multpointarray_3d (int numpts, const float *, float *) const |
multiplies a 3D point array (2nd arg) by the Matrix, returns in 3rd arg. More... | |
void | multnorm3d (const float[3], float[3]) const |
multiplies a 3D norm (first arg) by the Matrix, returns in second arg. More... | |
void | multplaneeq3d (const float[3], float[3]) const |
multiplies a 3D texture plane equation by the Matrix. More... | |
void | multpoint4d (const float[4], float[4]) const |
multiplies a 4D point (first arg) by the Matrix, returns in second arg. More... | |
void | identity (void) |
clears the matrix (resets it to identity). More... | |
void | constant (float) |
sets the matrix so all items are the given constant value. More... | |
int | inverse (void) |
inverts the matrix, that is, the inverse of the rotation, the inverse of the scaling, and the opposite of the translation vector. returns 0 if there were no problems, -1 if the matrix is singular. More... | |
void | transpose (void) |
transposes the matrix. More... | |
void | loadmatrix (const Matrix4 &m) |
replaces this matrix with the given one. More... | |
Matrix4 & | operator= (const Matrix4 &m) |
void | multmatrix (const Matrix4 &) |
premultiply the matrix by the given matrix, this->other * this. More... | |
void | rot (float, char) |
performs a left-handed rotation around an axis (char == 'x', 'y', or 'z'). More... | |
void | rotate_axis (const float axis[3], float angle) |
apply a rotation around the given vector; angle in radians. More... | |
void | transvec (float x, float y, float z) |
apply a rotation such that 'x' is brought along the given vector. More... | |
void | transvecinv (float x, float y, float z) |
apply a rotation such that the given vector is brought along 'x'. More... | |
void | translate (float, float, float) |
performs a translation. More... | |
void | translate (float d[3]) |
void | scale (float, float, float) |
performs scaling. More... | |
void | scale (float f) |
void | window (float, float, float, float, float, float) |
sets this matrix to represent a window perspective. More... | |
void | ortho (float, float, float, float, float, float) |
sets this matrix to a 3D orthographic matrix. More... | |
void | ortho2 (float, float, float, float) |
sets this matrix to a 2D orthographic matrix. More... | |
void | lookat (float, float, float, float, float, float, short) |
This subroutine defines a viewing transformation with the eye at point (vx,vy,vz) looking at the point (px,py,pz). Twist is the right-hand rotation about this line. The resultant matrix is multiplied with the top of the transformation stack and then replaces it. Precisely, lookat does: lookat=trans(-vx,-vy,-vz)*rotate(theta,y)*rotate(phi,x)*rotate(-twist,z). More... | |
Public Attributes | |
float | mat [16] |
the matrix itself. More... |
Definition at line 26 of file Matrix4.h.
|
identity constructor.
Definition at line 28 of file Matrix4.h. References identity. |
|
const elements constructor.
Definition at line 29 of file Matrix4.h. References constant. |
|
construct from float array.
Definition at line 30 of file Matrix4.C. References mat. |
|
copy constructor.
Definition at line 31 of file Matrix4.h. References loadmatrix. |
|
destructor.
|
|
sets the matrix so all items are the given constant value.
Definition at line 128 of file Matrix4.C. References mat. |
|
|
inverts the matrix, that is, the inverse of the rotation, the inverse of the scaling, and the opposite of the translation vector. returns 0 if there were no problems, -1 if the matrix is singular.
Definition at line 136 of file Matrix4.C. Referenced by Tool::dograb, PickModeForce::get_force, get_transform_to_orthonormal_cell, measure_pbc_neighbors, myfit3, PickModeMove::pick_molecule_move, vmd_measure_inverse, and VolumetricData::voxel_coord_from_cartesian_coord. |
|
replaces this matrix with the given one.
Definition at line 220 of file Matrix4.C. References mat. Referenced by Matrix4, measure_pbc_neighbors, operator=, VMDTracker::orientation, VRJugglerTracker::update, SpaceballTracker::update, and MobileTracker::update. |
|
This subroutine defines a viewing transformation with the eye at point (vx,vy,vz) looking at the point (px,py,pz). Twist is the right-hand rotation about this line. The resultant matrix is multiplied with the top of the transformation stack and then replaces it. Precisely, lookat does: lookat=trans(-vx,-vy,-vz)*rotate(theta,y)*rotate(phi,x)*rotate(-twist,z).
Definition at line 364 of file Matrix4.C. References constant, mat, multmatrix, rot, and translate. |
|
premultiply the matrix by the given matrix, this->other * this.
Definition at line 225 of file Matrix4.C. References mat. Referenced by Displayable::add_rot, convert_endpoints_to_matrix, RotateTool::do_event, Tool::dograb, DisplayDevice::find_pbc_images, get_transform_to_orthonormal_cell, lookat, measure_fit, measure_pbc_neighbors, myfit3, VMDTracker::orientation, RotateTool::orientation, Displayable::recalc_mat, VRJugglerDisplayDevice::render, FreeVRDisplayDevice::render, CaveDisplayDevice::render, rot, scale, OpenGLRenderer::set_persp, translate, SpaceballTracker::update, and MobileTracker::update. |
|
|
multiplies a 3D texture plane equation by the Matrix.
Definition at line 89 of file Matrix4.C. References multnorm3d. |
|
|
multiplies a 4D point (first arg) by the Matrix, returns in second arg.
Definition at line 109 of file Matrix4.C. References mat. Referenced by Displayable::change_center, and text_cmd_mol. |
|
multiplies a 3D point array (2nd arg) by the Matrix, returns in 3rd arg.
Definition at line 60 of file Matrix4.C. References multpoint3d. |
|
Definition at line 67 of file Matrix4.h. References loadmatrix. |
|
sets this matrix to a 3D orthographic matrix.
|
|
sets this matrix to a 2D orthographic matrix.
|
|
performs a left-handed rotation around an axis (char == 'x', 'y', or 'z').
Definition at line 241 of file Matrix4.C. References DEGTORAD, mat, and multmatrix. Referenced by Displayable::add_rot, convert_endpoints_to_matrix, dodecahedron, lookat, myfit3, rotate_axis, Scene::rotate_light, Displayable::set_rot, transvec, transvec, transvecinv, transvecinv, VRJugglerTracker::update, SpaceballTracker::update, FreeVRTracker::update, CaveTracker::update, and MobileTracker::update. |
|
apply a rotation around the given vector; angle in radians.
Definition at line 273 of file Matrix4.C. References RADTODEG, rot, transvec, and transvecinv. Referenced by do_density_rotate, do_rotate, dodecahedron, obj_transabout, OptiXRenderer::render_to_videostream, Symmetry::score_axis, Symmetry::score_plane, and Symmetry::score_rotary_reflection. |
|
Definition at line 90 of file Matrix4.h. References scale. |
|
performs scaling.
Definition at line 307 of file Matrix4.C. References mat, multmatrix, and z. Referenced by Displayable::change_center, molinfo_get, Displayable::recalc_mat, scale, Symmetry::score_inversion, Symmetry::score_plane, Symmetry::score_rotary_reflection, FileRenderer::super_scale, POV3DisplayDevice::trimesh_c4n3v3, POV3DisplayDevice::trimesh_c4u_n3b_v3f, and POV3DisplayDevice::tristrip. |
|
Definition at line 86 of file Matrix4.h. References translate. |
|
performs a translation.
Definition at line 298 of file Matrix4.C. References mat, multmatrix, and z. Referenced by convert_endpoints_to_matrix, get_transform_to_orthonormal_cell, Timestep::get_transforms, lookat, measure_fit, molinfo_get, myfit2, myfit3, Displayable::recalc_mat, Symmetry::score_axis, Symmetry::score_inversion, Symmetry::score_plane, Symmetry::score_rotary_reflection, Tool::target, and translate. |
|
transposes the matrix.
Definition at line 207 of file Matrix4.C. References mat. Referenced by Tool::tug. |
|
apply a rotation such that 'x' is brought along the given vector.
Definition at line 280 of file Matrix4.C. References length, RADTODEG, rot, and z. Referenced by obj_transvec, and rotate_axis. |
|
apply a rotation such that the given vector is brought along 'x'.
Definition at line 289 of file Matrix4.C. References length, RADTODEG, rot, and z. Referenced by obj_transvecinv, and rotate_axis. |
|
sets this matrix to represent a window perspective.
|
|