#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 | multnorm3d (const float[3], float[3]) const |
| multiplies a 3D norm (first arg) by the Matrix, returns in second arg. 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 96 of file Matrix4.C. References mat. |
|
|
clears the matrix (resets it to identity).
Definition at line 86 of file Matrix4.C. References mat. Referenced by SpaceballTracker::do_start, Timestep::get_transform_from_cell, Matrix4, measure_pbc_neighbors, Displayable::recalc_mat, FreeVRDisplayDevice::render, CaveDisplayDevice::render, Displayable::reset_transformation, SensorConfig::SensorConfig, OpenGLRenderer::set_persp, Displayable::set_rot, OpenGLRenderer::setup_initial_opengl_state, POV3DisplayDevice::trimesh, POV3DisplayDevice::tristrip, SpaceballTracker::update, VRPNTracker::update, FreeVRTracker::update, CaveTracker::update, and VMDTracker::VMDTracker. |
|
|
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 104 of file Matrix4.C. Referenced by Tool::dograb, PickModeForce::get_force, get_transform_to_orthonormal_cell, inverse, 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 188 of file Matrix4.C. References mat. Referenced by Matrix4, measure_pbc_neighbors, operator=, VMDTracker::orientation, and SpaceballTracker::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 330 of file Matrix4.C. References constant, mat, multmatrix, rot, and translate. |
|
|
premultiply the matrix by the given matrix, this->other * this.
Definition at line 193 of file Matrix4.C. References mat. Referenced by Displayable::add_rot, VolMapCreateFastEnergy::compute_frame, 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, OpenGLRenderer::render, FreeVRDisplayDevice::render, CaveDisplayDevice::render, rot, scale, OpenGLRenderer::set_persp, translate, and SpaceballTracker::update. |
|
||||||||||||
|
multiplies a 3D norm (first arg) by the Matrix, returns in second arg.
Definition at line 62 of file Matrix4.C. References mat. Referenced by POV3DisplayDevice::trimesh, POV3DisplayDevice::tristrip, and LibTachyonDisplayDevice::tristrip. |
|
||||||||||||
|
multiplies a 3D point (first arg) by the Matrix, returns in second arg.
Definition at line 35 of file Matrix4.C. References mat. Referenced by VolMapCreateFastEnergy::compute_frame, compute_pbcminmax, PinchTool::do_event, GrabTool::do_event, Tool::dograb, PickModeForce::get_force, measure_fit, measure_move, measure_pbc_neighbors, myfit3, normal_atom_coord, GeometryMol::normal_atom_coord, PickModeCenter::pick_molecule_end, PickModeMove::pick_molecule_move, Axes::pick_move, py_align, Scene::rotate_light, Tool::target, trans_overlap, POV3DisplayDevice::trimesh, POV3DisplayDevice::tristrip, LibTachyonDisplayDevice::tristrip, Tool::tug, and VolumetricData::voxel_coord_from_cartesian_coord. |
|
||||||||||||
|
multiplies a 4D point (first arg) by the Matrix, returns in second arg.
Definition at line 77 of file Matrix4.C. References mat. Referenced by Displayable::change_center, and OpenGLRenderer::render. |
|
|
Definition at line 61 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 209 of file Matrix4.C. References DEGTORAD, mat, and multmatrix. Referenced by Displayable::add_rot, convert_endpoints_to_matrix, lookat, myfit3, rotate_axis, Scene::rotate_light, Displayable::set_rot, transvec, transvec, transvecinv, transvecinv, SpaceballTracker::update, FreeVRTracker::update, and CaveTracker::update. |
|
||||||||||||
|
apply a rotation around the given vector; angle in radians.
Definition at line 239 of file Matrix4.C. References RADTODEG, rot, transvec, and transvecinv. Referenced by obj_transabout. |
|
|
Definition at line 84 of file Matrix4.h. References scale. |
|
||||||||||||||||
|
performs scaling.
Definition at line 273 of file Matrix4.C. References mat, and multmatrix. Referenced by Displayable::change_center, molinfo_get, Displayable::recalc_mat, scale, FileRenderer::super_scale, POV3DisplayDevice::trimesh, and POV3DisplayDevice::tristrip. |
|
|
Definition at line 80 of file Matrix4.h. References translate. |
|
||||||||||||||||
|
performs a translation.
Definition at line 264 of file Matrix4.C. References mat, and multmatrix. Referenced by convert_endpoints_to_matrix, get_transform_to_orthonormal_cell, Timestep::get_transforms, lookat, measure_fit, molinfo_get, myfit2, myfit3, Displayable::recalc_mat, Tool::target, and translate. |
|
|
transposes the matrix.
Definition at line 175 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 246 of file Matrix4.C. Referenced by obj_transvec, and rotate_axis. |
|
||||||||||||||||
|
apply a rotation such that the given vector is brought along 'x'.
Definition at line 255 of file Matrix4.C. Referenced by obj_transvecinv, and rotate_axis. |
|
||||||||||||||||||||||||||||
|
sets this matrix to represent a window perspective.
|
|
1.2.14 written by Dimitri van Heesch,
© 1997-2002