#include <hspline.H>
Inheritance diagram for HSpline::HermiteBasis:
Public Member Functions | |
HermiteBasis () | |
Mat4 () | |
Default constructor. Creates an identity matrix. | |
Mat4 (Vec4 row0, Vec4 row1, Vec4 row2, Vec4 row3, bool perspec=false) | |
Constructor that creates a matrix with rows equal to the vectors givens as arguments. Perspective can also be set. | |
Mat4 (const Wpt &origin, const Wvec &x_dir, const Wvec &y_dir, const Wvec &z_dir) | |
This constructor creates a rigid motion transform from an origin and directions of x, y and z axes. | |
Mat4 (const Wvec &col0, const Wvec &col1, const Wvec &col2) | |
This constructor creates a linear map (no translation) whose columns are the given vectors. | |
Mat4 (const Wpt &origin, const Wvec &xDir, const Wvec &yDir) | |
This constructor creates a rigid motion transform from an origin and direction of x and y axis. If yDir is not perpendicular to xDir, yDir will be adjusted. | |
Mat4 (const Wline &axis) | |
This constructor creates a rigid motion transform from an origin (axis.point) and the direction of the z axis (axis.vector). The directions of the x and y axes are determined according to an arbitrary axis algorithm. | |
Mat4 (const Wpt &origin) | |
The constructor creates a rigid motion transform from an origin. The x, y and z axis are aligned with the world x, y and z axis. | |
double & | operator() (int i1, int i2) |
Returns a reference to the cell (i1, i2) in the matrix. No bounds checking is performed in this function. | |
double | operator() (int i1, int i2) const |
Returns the value in the cell (i1, i2) in the matrix. No bounds checking is performed in this function. | |
Vec4 & | operator[] (int i) |
Returns a reference to row i as a Vec4. No bounds checking is performed in this function. | |
Vec4 | operator[] (int i) const |
Returns the value of row i as a Vec4. No bounds checking is performed in this function. | |
Wvec | get_scale () const |
void | get_coord_system (Wpt &o, Wvec &x, Wvec &y, Wvec &z) const |
Wvec | X () const |
Returns the x-axis of the coordinate system defined by the matrix as a vector. | |
Wvec | Y () const |
Returns the y-axis of the coordinate system defined by the matrix as a vector. | |
Wvec | Z () const |
Returns the z-axis of the coordinate system defined by the matrix as a vector. | |
Wpt | origin () const |
Returns the origin of the coordinate system defined by the matrix as a point. | |
const double * | matrix () const |
Returns the elements of the matrix as a 1D array (in row major layout). | |
void | set_X (const Wvec &x) |
Set the x-axis of the coordinate system defined by the matrix. | |
void | set_Y (const Wvec &y) |
Set the y-axis of the coordinate system defined by the matrix. | |
void | set_Z (const Wvec &z) |
Set the z-axis of the coordinate system defined by the matrix. | |
void | set_origin (const Wpt &o) |
Set the origin of the coordinate system defined by the matrix. | |
Wtransf | rotation () const |
Returns the rotation part of the transform. | |
Wtransf | transpose () const |
Return the transpose of the matrix. | |
double | det () const |
Return the determinant of the matrix. | |
double | trace () const |
Return the trace of the matrix. | |
Wtransf | adjoint () const |
Return the adjoint of the matrix. | |
Wtransf | unscaled () const |
Return a copy of the matrix with the axes of the coordinate system it defines normalized. | |
Wtransf | normalized_basis () const |
Returns a normalized basis version of the matrix. | |
Wtransf | orthogonalized () const |
Returns a orthogonalized version of the matrix. | |
Wtransf | inverse (bool debug=false) const |
Returns the inverse of the matrix. | |
double | inverse (Mat4< Wtransf, Wpt, Wvec, Wline, Wquat > &inv) const |
Wtransf | derivative (const Wpt &p) const |
Returns the derivative of the matrix at point p. | |
void | set_perspective (bool p) |
Set whether this matrix represents a perspective transform or not. | |
bool | is_perspective () const |
Does this matrix represent a perspective transform? | |
bool | is_valid () const |
Is the matrix valid? | |
bool | is_identity () const |
Is the matrix equal to the identity matrix? | |
bool | is_orthogonal () const |
Is the matrix orthogonal (no shearing)? | |
bool | is_equal_scaling_orthogonal () const |
Is the matrix equal_scaling orthogonal (no shearing, no nonequal scaling)? | |
bool | is_orthonormal () const |
Is the matrix orthonormal (orthogonal, no scaling)? | |
int | operator== (const Wtransf &m) const |
Overloaded equality operator. Only checks to see if top 3 rows are equal. | |
Static Public Member Functions | |
static Wtransf | rotation (const Wquat &quat) |
Create a matrix that does the rotation described by the quaternion quat. | |
static Wtransf | rotation (const Wline &axis, double angle) |
Create a matrix that rotates angle radians about the axis described by line axis. | |
static Wtransf | rotation (const Wvec &axis, double angle) |
Create a matrix that rotates angle radians about the axis described by vector axis. | |
static Wtransf | shear (const Wvec &normal, const Wvec &shear_vec) |
Create a matrix that performs a shearing transform. | |
static Wtransf | scaling (const Wpt &fixed_pt, double factor) |
Create a matrix that does a uniform scale by factor along the x-, y- and z-directions, centered at the point fixed_pt. | |
static Wtransf | scaling (const Wpt &fixed_pt, const Wvec &xyz_factors) |
Create a matrix that scales along x-, y- and z-axes by the amount in the corresponding component of xyz_factors and that leaves the point fixed_pt unmoved. | |
static Wtransf | scaling (const Wvec &xyz_factors) |
Create a matrix that scales along the x-, y- and z-axes by the amount in the corresponding component of xyz_factors. | |
static Wtransf | scaling (double x, double y, double z) |
Create a matrix that scales by x along the x-axis, y along the y-axis and z along the z-axis. | |
static Wtransf | scaling (double factor) |
Create a matrix that does a uniform scale by factor. | |
static Wtransf | stretching (const Wline &axis) |
Create a matrix that scales along the direction of axis.vector leaving point axis.point unmoved. | |
static Wtransf | translation (const Wvec &vec) |
Create a matrix that does a translation along the vector vec. | |
static Wtransf | anchor_scale_rot (const Wpt &anchor, const Wpt &old_pt, const Wpt &new_pt) |
Contruct a rotation / non-uniform scale matrix that maps the line segment joining anchor and old_pt to the segment joining anchor and new-pt. | |
static Wtransf | align (const Wpt &src1, const Wpt &src2, const Wpt &src3, const Wpt &dst1, const Wpt &dst2, const Wpt &dst3) |
Map a triple of points (src1,src2,src3) to a triple of points (dst1,dst2,dst3). Point src1 maps to dst1, line (src1,src2) maps to line (dst1,dst2) and plane (src1,src2,src3) maps to plane (dst1,dst2,dst3). | |
static Wtransf | align (const Wpt &src1, const Wvec &src2, const Wvec &src3, const Wpt &dst1, const Wvec &dst2, const Wvec &dst3) |
static Wtransf | align (const Wpt &src1, const Wvec &src2, const Wpt &dst1, const Wvec &dst2) |
static Wtransf | align_and_scale (const Wpt &o, const Wvec &x, const Wvec &y, const Wvec &z) |
static Wtransf | glu_perspective (double fovy, double aspect, double zmin=0.0, double zmax=0.0) |
Creates a matrix that performs a perspective transformation exactly like gluPerspective. | |
static Wtransf | glu_lookat (const Wvec &from, const Wvec &at, const Wvec &up) |
Creates a matrix that performs a transformation exactly like gluLookAt. | |
static Wtransf | gl_viewport (double w, double h) |
Creates a matrix that performs the OpenGL viewport transformation. | |
Protected Attributes | |
Vec4 | row [4] |
Rows of the matrix stored as 4D vectors. | |
bool | perspective |
Is this matrix a perspective transform? |
Definition at line 32 of file hspline.H.
|
Definition at line 34 of file hspline.H. References mlib::Mat4< Wtransf, Wpt, Wvec, Wline, Wquat >::row. |
|
Return the adjoint of the matrix.
|
|
As align(src1, src2, src3, dst1, dst2, dst3), but src3 and dst3 are equal and computed to be cross(src2, dst2). If cross(src2, dst2) is the null vector, then src3 and dst3 are perpendicular to src2 (computed using an arbitrary axis algorithm) is src2 and dst2 point away from each other. Otherwise, a translation matrix from sr1 to dst1 is returned. |
|
The transformation maps points and vectors as follows:
|
|
Map a triple of points (src1,src2,src3) to a triple of points (dst1,dst2,dst3). Point src1 maps to dst1, line (src1,src2) maps to line (dst1,dst2) and plane (src1,src2,src3) maps to plane (dst1,dst2,dst3). The transformation maps points as follows: point src1 maps to point dst1 vec (src1,src2) maps to vector (dst1,dst2) plane (src1,src2,src3) maps to plane (dst1,dst2,dst3) |
|
Construct a rigid motion transformation from given coordinate system (origin,xx,yy,zz). This transformation will transform points from (origin,xx,yy,zz) to world. The axes xx, yy, and zz are not normalized before the matrix is constructed. Referenced by XFscaler< OBJ_TYPE, OBJ_TYPE_PTR >::tick(). |
|
Contruct a rotation / non-uniform scale matrix that maps the line segment joining anchor and old_pt to the segment joining anchor and new-pt. Contruct a rotation / non-uniform scale matrix that maps the line segment joining anchor -- old_pt to the segment joining anchor -- new_pt:
|
|
Returns the derivative of the matrix at point p. Returns the derivative of the map "mult by this matrix". Of course, this is only interesting for perspective matrices, since otherwise the derivative is the matrix itself. (We can ignore the translational component of the matrix since the derivative should only be multiplied with vectors, and the translational component doesn't affect them).
|
|
Return the determinant of the matrix.
Definition at line 234 of file mat4.H. References mlib::cross(), and mlib::Mat4< M, P, V, L, Q >::row. |
|
Returns by reference the origin and axes of the coordinate system defined by the matrix. Definition at line 107 of file mat4.H. References mlib::Mat4< M, P, V, L, Q >::origin(), mlib::Mat4< M, P, V, L, Q >::X(), mlib::Mat4< M, P, V, L, Q >::Y(), and mlib::Mat4< M, P, V, L, Q >::Z(). |
|
Returns a vector containing the lengths of the axes of the coordinate system defined by the matrix. Definition at line 102 of file mat4.H. References mlib::Mat4< M, P, V, L, Q >::X(), mlib::Mat4< M, P, V, L, Q >::Y(), and mlib::Mat4< M, P, V, L, Q >::Z(). |
|
Creates a matrix that performs the OpenGL viewport transformation.
|
|
Creates a matrix that performs a transformation exactly like gluLookAt.
|
|
Creates a matrix that performs a perspective transformation exactly like gluPerspective.
|
|
Matrix inversion code for 4x4 matrices using Gaussian elimination with partial pivoting. This is a specialized version of a procedure originally due to Paul Heckbert <ph@cs.cmu.edu>.
If the matrix is singular, returns 0 and leaves trash in
|
|
Returns the inverse of the matrix. Convenience version of inverse that returns the inverse rather than passing it back by reference. This version also prints an error message if a singular matrix is detected (in which case the returned matrix is undefined).
|
|
Is the matrix equal_scaling orthogonal (no shearing, no nonequal scaling)?
|
|
Is the matrix equal to the identity matrix?
|
|
Is the matrix orthogonal (no shearing)?
|
|
Is the matrix orthonormal (orthogonal, no scaling)?
Definition at line 279 of file mat4.H. References mlib::Mat4< M, P, V, L, Q >::get_scale(), and mlib::Mat4< M, P, V, L, Q >::is_orthogonal(). |
|
Does this matrix represent a perspective transform?
Definition at line 267 of file mat4.H. References mlib::Mat4< M, P, V, L, Q >::perspective. |
|
Is the matrix valid?
|
|
The constructor creates a rigid motion transform from an origin. The x, y and z axis are aligned with the world x, y and z axis.
|
|
This constructor creates a rigid motion transform from an origin (axis.point) and the direction of the z axis (axis.vector). The directions of the x and y axes are determined according to an arbitrary axis algorithm. Construct a transform that moves origin to axis.point and z-axis to axis.vector. The x and y axes are constructed according to an arbitrary axis algorithm.
|
|
This constructor creates a rigid motion transform from an origin and direction of x and y axis. If yDir is not perpendicular to xDir, yDir will be adjusted. Construct a rigid motion transformation from the coordinate system (origin,x_dir,y_dir,cross(x_dir,y_dir)). This transformation will transform points from (origin,x_dir,y_dir,cross(x_dir,y_dir)) to world.
|
|
This constructor creates a linear map (no translation) whose columns are the given vectors. Construct a matrix whose columns are the given vectors.
|
|
This constructor creates a rigid motion transform from an origin and directions of x, y and z axes. Construct a rigid motion transformation from given coordinate system (origin,x_dir,y_dir,z_dir). This transformation will transform points from (origin,x_dir,y_dir,z_dir) to world.
|
|
Constructor that creates a matrix with rows equal to the vectors givens as arguments. Perspective can also be set.
Definition at line 52 of file mat4.H. References mlib::Mat4< M, P, V, L, Q >::row. |
|
Default constructor. Creates an identity matrix.
Definition at line 43 of file mat4.H. References mlib::Mat4< M, P, V, L, Q >::row. |
|
Returns the elements of the matrix as a 1D array (in row major layout).
Definition at line 127 of file mat4.H. References mlib::Mat4< M, P, V, L, Q >::row. |
|
Returns a normalized basis version of the matrix. Return a copy of the matrix with the axes of the coordinate system it defines normalized and the origin of that coordinate system replaced with the origin of the world coordinate system, (0, 0, 0). |
|
Returns the value in the cell (i1, i2) in the matrix. No bounds checking is performed in this function.
Definition at line 91 of file mat4.H. References mlib::Mat4< M, P, V, L, Q >::row. |
|
Returns a reference to the cell (i1, i2) in the matrix. No bounds checking is performed in this function.
Definition at line 88 of file mat4.H. References mlib::Mat4< M, P, V, L, Q >::row. |
|
Overloaded equality operator. Only checks to see if top 3 rows are equal.
Definition at line 290 of file mat4.H. References mlib::Mat4< M, P, V, L, Q >::origin(), mlib::Mat4< M, P, V, L, Q >::X(), mlib::Mat4< M, P, V, L, Q >::Y(), and mlib::Mat4< M, P, V, L, Q >::Z(). |
|
Returns the value of row
Definition at line 98 of file mat4.H. References mlib::Mat4< M, P, V, L, Q >::row. |
|
Returns a reference to row
Definition at line 95 of file mat4.H. References mlib::Mat4< M, P, V, L, Q >::row. |
|
Returns the origin of the coordinate system defined by the matrix as a point.
Definition at line 121 of file mat4.H. References mlib::Mat4< M, P, V, L, Q >::row. |
|
Returns a orthogonalized version of the matrix. Creates a new matrix that defines a coordinate system with the same origin as the coordinate system defined by the original matrix, but x-axis normalized, the y-axis redefined to be perpendicular to the x-axis (and also unit length), and the z-axis redefined to be perpendicular to both (but the same length as before).
|
|
Create a matrix that rotates angle radians about the axis described by vector axis.
|
|
Create a matrix that rotates angle radians about the axis described by line axis.
|
|
Create a matrix that does the rotation described by the quaternion quat.
|
|
Returns the rotation part of the transform.
Definition at line 143 of file mat4.H. References mlib::Mat4< M, P, V, L, Q >::X(), mlib::Mat4< M, P, V, L, Q >::Y(), and mlib::Mat4< M, P, V, L, Q >::Z(). Referenced by Cam_int_edit::rot_x(), Cam_int_edit::rot_y(), and Cam_int_edit::rot_z(). |
|
Create a matrix that does a uniform scale by factor.
|
|
Create a matrix that scales by x along the x-axis, y along the y-axis and z along the z-axis.
Definition at line 177 of file mat4.H. References mlib::Mat4< M, P, V, L, Q >::scaling(). |
|
Create a matrix that scales along the x-, y- and z-axes by the amount in the corresponding component of xyz_factors.
|
|
Create a matrix that scales along x-, y- and z-axes by the amount in the corresponding component of xyz_factors and that leaves the point fixed_pt unmoved.
|
|
Create a matrix that does a uniform scale by factor along the x-, y- and z-directions, centered at the point fixed_pt.
Referenced by GEOM::bbox(), TEXTURE::expand_image(), Cam_int_edit::scale(), Cam_int_edit::scale_x(), Cam_int_edit::scale_y(), and Cam_int_edit::scale_z(). |
|
Set the origin of the coordinate system defined by the matrix.
Definition at line 139 of file mat4.H. References mlib::Mat4< M, P, V, L, Q >::row. |
|
Set whether this matrix represents a perspective transform or not.
Definition at line 265 of file mat4.H. References mlib::Mat4< M, P, V, L, Q >::perspective. |
|
Set the x-axis of the coordinate system defined by the matrix.
Definition at line 130 of file mat4.H. References mlib::Mat4< M, P, V, L, Q >::row. |
|
Set the y-axis of the coordinate system defined by the matrix.
Definition at line 133 of file mat4.H. References mlib::Mat4< M, P, V, L, Q >::row. |
|
Set the z-axis of the coordinate system defined by the matrix.
Definition at line 136 of file mat4.H. References mlib::Mat4< M, P, V, L, Q >::row. |
|
Create a matrix that performs a shearing transform.
|
|
Create a matrix that scales along the direction of axis.vector leaving point axis.point unmoved.
|
|
Return the trace of the matrix.
|
|
Create a matrix that does a translation along the vector vec.
|
|
Return the transpose of the matrix.
|
|
Return a copy of the matrix with the axes of the coordinate system it defines normalized.
|
|
Returns the x-axis of the coordinate system defined by the matrix as a vector.
Definition at line 112 of file mat4.H. References mlib::Mat4< M, P, V, L, Q >::row. |
|
Returns the y-axis of the coordinate system defined by the matrix as a vector.
Definition at line 115 of file mat4.H. References mlib::Mat4< M, P, V, L, Q >::row. |
|
Returns the z-axis of the coordinate system defined by the matrix as a vector.
Definition at line 118 of file mat4.H. References mlib::Mat4< M, P, V, L, Q >::row. |
|
Is this matrix a perspective transform?
|
|
Rows of the matrix stored as 4D vectors.
Definition at line 34 of file mat4.H. Referenced by HermiteBasis(). |