#include <UT_Vector3.h>
Public Member Functions | |
| UT_Vector3 (void) | |
| UT_Vector3 (fpreal vx, fpreal vy, fpreal vz) | |
| UT_Vector3 (const fpreal32 v[3]) | |
| UT_Vector3 (const fpreal64 v[3]) | |
| UT_Vector3 (const UT_Vector4 &v) | |
| ~UT_Vector3 (void) | |
| UT_Vector3 & | operator= (const UT_Vector4 &v) |
| Assignment operator that truncates a V4 to a V3. | |
| UT_Vector3 | operator- () const |
| UT_Vector3 & | operator+= (const UT_Vector3 &v) |
| UT_Vector3 & | operator-= (const UT_Vector3 &v) |
| unsigned | operator== (const UT_Vector3 &v) const |
| unsigned | operator!= (const UT_Vector3 &v) const |
| int | equalZero (fpreal tol=0.00001f) const |
| int | isEqual (const UT_Vector3 &vect, fpreal tol=0.00001f) const |
| void | clampZero (fpreal tol=0.00001f) |
| void | negate () |
| void | multiplyComponents (const UT_Vector3 &v) |
| UT_Vector3 & | operator= (fpreal scalar) |
| UT_Vector3 & | operator+= (fpreal scalar) |
| UT_Vector3 & | operator-= (fpreal scalar) |
| UT_Vector3 & | operator*= (fpreal scalar) |
| UT_Vector3 & | operator*= (const UT_Vector3 &v) |
| UT_Vector3 & | operator/= (fpreal scalar) |
| UT_Vector3 & | operator/= (const UT_Vector3 &v) |
| void | cross (const UT_Vector3 &v) |
| fpreal | dot (const UT_Vector3 &v) const |
| fpreal | normalize (void) |
| void | normal (const UT_Vector3 &va, const UT_Vector3 &vb) |
| void | normal (const UT_Vector4 &va, const UT_Vector4 &vb) |
| void | arbitraryPerp (const UT_Vector3 &v) |
| Finds an arbitrary perpendicular to v, and sets this to it. | |
| void | makeOrthonormal (const UT_Vector3 &v) |
| fpreal | maxComponent () const |
| Find the maximum component. | |
| fpreal | minComponent () const |
| fpreal | avgComponent () const |
| void | getFrameOfReference (UT_Vector3 &X, UT_Vector3 &Y) const |
| fpreal | length (void) const |
| The vector length (not to be confused with the vector dimension). | |
| fpreal | length2 (void) const |
| The vector length squared. | |
| UT_Vector3 | project (const UT_Vector3 &u) const |
| Calculates the orthogonal projection of a vector u on the *this vector. | |
| UT_Matrix3 | project (int norm=1) |
| UT_DMatrix3 | projectD (int norm=1) |
| UT_Vector3 | projection (const UT_Vector3 &p, const UT_Vector3 &v) const |
| UT_Vector3 | projectOnSegment (const UT_Vector3 &va, const UT_Vector3 &vb) const |
| UT_Vector3 | projectOnSegment (const UT_Vector3 &va, const UT_Vector3 &vb, fpreal &t) const |
| UT_Matrix3 | symmetry (int norm=1) |
| int | lineIntersect (const UT_Vector3 &p1, const UT_Vector3 &v1, const UT_Vector3 &p2, const UT_Vector3 &v2) |
| int | segLineIntersect (const UT_Vector3 &pa, const UT_Vector3 &pb, const UT_Vector3 &p2, const UT_Vector3 &v2) |
| bool | areCollinear (const UT_Vector3 &p0, const UT_Vector3 &p1, float *t=0, fpreal tol=1e-5) const |
| UT_Vector3 | getBary (const UT_Vector3 &t0, const UT_Vector3 &t1, const UT_Vector3 &t2, bool *degen=NULL) const |
| fpreal | distance (const UT_Vector3 &p1, const UT_Vector3 &v1) const |
| Compute the signed distance from us to a line. | |
| fpreal | distance (const UT_Vector3 &p1, const UT_Vector3 &v1, const UT_Vector3 &p2, const UT_Vector3 &v2) const |
| Compute the signed distance between two lines. | |
| void | assign (fpreal xx=0.0f, fpreal yy=0.0f, fpreal zz=0.0f) |
| Set the values of the vector components. | |
| void | assign (const float *v) |
| Set the values of the vector components. | |
| void | roundAngles (const UT_Vector3 &base) |
| void | roundAngles (const UT_Vector3 &b, const UT_XformOrder &o) |
| void | getDual (UT_Matrix3 &dual) const |
| void | getDual (UT_DMatrix3 &dual) const |
| void | rowVecMult (const UT_Matrix3 &m) |
| void | rowVecMult (const UT_Matrix4 &m) |
| void | rowVecMult (const UT_DMatrix3 &m) |
| void | rowVecMult (const UT_DMatrix4 &m) |
| void | colVecMult (const UT_Matrix3 &m) |
| void | colVecMult (const UT_Matrix4 &m) |
| void | colVecMult (const UT_DMatrix3 &m) |
| void | colVecMult (const UT_DMatrix4 &m) |
| void | rowVecMult3 (const UT_Matrix4 &m) |
| void | rowVecMult3 (const UT_DMatrix4 &m) |
| void | colVecMult3 (const UT_Matrix4 &m) |
| void | colVecMult3 (const UT_DMatrix4 &m) |
| UT_Vector3 & | operator*= (const UT_Matrix3 &m) |
| UT_Vector3 & | operator*= (const UT_DMatrix3 &m) |
| UT_Vector3 & | operator*= (const UT_Matrix4 &m) |
| UT_Vector3 & | operator*= (const UT_DMatrix4 &m) |
| void | multiply3 (const UT_Matrix4 &mat) |
| void | multiply3 (const UT_DMatrix4 &mat) |
| void | multiplyT (const UT_Matrix3 &mat) |
| void | multiplyT (const UT_DMatrix3 &mat) |
| void | multiply3T (const UT_Matrix4 &mat) |
| void | multiply3T (const UT_DMatrix4 &mat) |
| void | multiply3 (UT_Vector3 &dest, const UT_Matrix4 &mat) const |
| void | multiplyT (UT_Vector3 &dest, const UT_Matrix3 &mat) const |
| void | multiply3T (UT_Vector3 &dest, const UT_Matrix4 &mat) const |
| void | multiply (UT_Vector3 &dest, const UT_Matrix4 &mat) const |
| void | multiply (UT_Vector3 &dest, const UT_Matrix3 &mat) const |
| void | multiply3 (UT_Vector3 &dest, const UT_DMatrix4 &mat) const |
| void | multiplyT (UT_Vector3 &dest, const UT_DMatrix3 &mat) const |
| void | multiply3T (UT_Vector3 &dest, const UT_DMatrix4 &mat) const |
| void | multiply (UT_Vector3 &dest, const UT_DMatrix4 &mat) const |
| void | multiply (UT_Vector3 &dest, const UT_DMatrix3 &mat) const |
| int | findMinAbsAxis () const |
| These allow you to find out what indices to use for different axes. | |
| int | findMaxAbsAxis () const |
| These allow you to find out what indices to use for different axes. | |
| const float * | data (void) const |
| float * | data (void) |
| float & | x (void) |
| float | x (void) const |
| float & | y (void) |
| float | y (void) const |
| float & | z (void) |
| float | z (void) const |
| float & | r (void) |
| float | r (void) const |
| float & | g (void) |
| float | g (void) const |
| float & | b (void) |
| float | b (void) const |
| float & | operator() (unsigned i) |
| float | operator() (unsigned i) const |
| float & | operator[] (unsigned i) |
| float | operator[] (unsigned i) const |
| std::vector< float > | asStdVector () const |
| void | homogenize (void) |
| Express the point in homogeneous coordinates or vice-versa. | |
| void | dehomogenize (void) |
| Express the point in homogeneous coordinates or vice-versa. | |
| void | degToRad () |
| conversion between degrees and radians | |
| void | radToDeg () |
| conversion between degrees and radians | |
| void | save (ostream &os, int binary=0) const |
| Protected I/O methods. | |
| bool | load (UT_IStream &is) |
| Protected I/O methods. | |
Public Attributes | |
| float | vec [3] |
| The data. | |
Friends | |
| ostream & | operator<< (ostream &os, const UT_Vector3 &v) |
| I/O friends. | |
CVEX/cvexsample.C, CVEX/simple.C, GR/GR_BaryCenter.C, GR/GR_SimpleNoise.C, POP/POP_LocalForce.C, POP/POP_LocalForce.h, POP/POP_RadialBirth.C, POP/POP_RadialBirth.h, POP/POP_SpotLight.C, SIM/SIM_ForceOrbit.C, SIM/SIM_ForceOrbit.h, SIM/SIM_GasAdd.C, SIM/SIM_SolverHair.C, SIM/SIM_SolverSNOW.C, SOP/MSS_CustomBrushState.C, SOP/SOP_BrushHairLen.h, SOP/SOP_CopRaster.C, SOP/SOP_CustomBrush.C, SOP/SOP_CustomBrush.h, SOP/SOP_Flatten.C, SOP/SOP_SParticle.C, SOP/SOP_SParticle.h, standalone/geo2voxel.C, standalone/geoisosurface.C, standalone/i3ddsmgen.C, standalone/i3dsphere.C, VRAY/VRAY_DemoMountain.C, VRAY/VRAY_DemoMountain.h, VRAY/VRAY_DemoStamp.C, and VRAY/VRAY_DemoVolumeSphere.C.
Definition at line 157 of file UT_Vector3.h.
| UT_Vector3::UT_Vector3 | ( | void | ) | [inline] |
Default constructor. No data is initialized! Use it for extra speed.
Definition at line 161 of file UT_Vector3.h.
Definition at line 166 of file UT_Vector3.h.
| UT_Vector3::UT_Vector3 | ( | const fpreal32 | v[3] | ) | [inline] |
Definition at line 170 of file UT_Vector3.h.
| UT_Vector3::UT_Vector3 | ( | const fpreal64 | v[3] | ) | [inline] |
Definition at line 174 of file UT_Vector3.h.
| UT_Vector3::UT_Vector3 | ( | const UT_Vector4 & | v | ) | [inline] |
Definition at line 755 of file UT_Vector3.h.
| UT_Vector3::~UT_Vector3 | ( | void | ) | [inline] |
Definition at line 182 of file UT_Vector3.h.
| void UT_Vector3::arbitraryPerp | ( | const UT_Vector3 & | v | ) |
Finds an arbitrary perpendicular to v, and sets this to it.
| bool UT_Vector3::areCollinear | ( | const UT_Vector3 & | p0, | |
| const UT_Vector3 & | p1, | |||
| float * | t = 0, |
|||
| fpreal | tol = 1e-5 | |||
| ) | const |
Determines whether or not the points p0, p1 and "this" are collinear. If they are t contains the parametric value of where "this" is found on the segment from p0 to p1 and returns true. Otherwise returns false. If p0 and p1 are equal, t is set to FLT_MAX and true is returned.
| void UT_Vector3::assign | ( | const float * | v | ) | [inline] |
Set the values of the vector components.
Definition at line 676 of file UT_Vector3.h.
| std::vector<float> UT_Vector3::asStdVector | ( | ) | const |
Return the components of the vector. The () operator does NOT check for the boundary condition.
| fpreal UT_Vector3::avgComponent | ( | ) | const [inline] |
Definition at line 513 of file UT_Vector3.h.
| float UT_Vector3::b | ( | void | ) | const [inline] |
Return the components of the vector. The () operator does NOT check for the boundary condition.
Definition at line 649 of file UT_Vector3.h.
| float& UT_Vector3::b | ( | void | ) | [inline] |
Return the components of the vector. The () operator does NOT check for the boundary condition.
Definition at line 648 of file UT_Vector3.h.
| void UT_Vector3::clampZero | ( | fpreal | tol = 0.00001f |
) | [inline] |
Definition at line 237 of file UT_Vector3.h.
| void UT_Vector3::colVecMult | ( | const UT_DMatrix4 & | m | ) | [inline] |
If you need a multiplication operator that left multiplies the vector by a matrix (M * v), use the following colVecMult() functions. If you'd rather not use operator*=() for right-multiplications (v * M), use the following rowVecMult() functions. The methods that take a 4x4 matrix first extend this vector to 4D by adding an element equal to 1.0.
Definition at line 289 of file UT_Vector3.h.
| void UT_Vector3::colVecMult | ( | const UT_DMatrix3 & | m | ) | [inline] |
If you need a multiplication operator that left multiplies the vector by a matrix (M * v), use the following colVecMult() functions. If you'd rather not use operator*=() for right-multiplications (v * M), use the following rowVecMult() functions. The methods that take a 4x4 matrix first extend this vector to 4D by adding an element equal to 1.0.
Definition at line 285 of file UT_Vector3.h.
| void UT_Vector3::colVecMult | ( | const UT_Matrix4 & | m | ) | [inline] |
If you need a multiplication operator that left multiplies the vector by a matrix (M * v), use the following colVecMult() functions. If you'd rather not use operator*=() for right-multiplications (v * M), use the following rowVecMult() functions. The methods that take a 4x4 matrix first extend this vector to 4D by adding an element equal to 1.0.
Definition at line 281 of file UT_Vector3.h.
| void UT_Vector3::colVecMult | ( | const UT_Matrix3 & | m | ) | [inline] |
If you need a multiplication operator that left multiplies the vector by a matrix (M * v), use the following colVecMult() functions. If you'd rather not use operator*=() for right-multiplications (v * M), use the following rowVecMult() functions. The methods that take a 4x4 matrix first extend this vector to 4D by adding an element equal to 1.0.
Definition at line 277 of file UT_Vector3.h.
| void UT_Vector3::colVecMult3 | ( | const UT_DMatrix4 & | m | ) | [inline] |
This multiply will not extend the vector by adding a fourth element. Instead, it converts the Matrix4 to a Matrix3. This means that the translate component of the matrix is not applied to the vector
Definition at line 312 of file UT_Vector3.h.
| void UT_Vector3::colVecMult3 | ( | const UT_Matrix4 & | m | ) | [inline] |
This multiply will not extend the vector by adding a fourth element. Instead, it converts the Matrix4 to a Matrix3. This means that the translate component of the matrix is not applied to the vector
Definition at line 308 of file UT_Vector3.h.
| void UT_Vector3::cross | ( | const UT_Vector3 & | v | ) | [inline] |
Definition at line 461 of file UT_Vector3.h.
| float* UT_Vector3::data | ( | void | ) | [inline] |
Return the components of the vector. The () operator does NOT check for the boundary condition.
Definition at line 637 of file UT_Vector3.h.
| const float* UT_Vector3::data | ( | void | ) | const [inline] |
Return the components of the vector. The () operator does NOT check for the boundary condition.
Definition at line 636 of file UT_Vector3.h.
| void UT_Vector3::degToRad | ( | ) |
conversion between degrees and radians
| void UT_Vector3::dehomogenize | ( | void | ) | [inline] |
Express the point in homogeneous coordinates or vice-versa.
Definition at line 693 of file UT_Vector3.h.
| fpreal UT_Vector3::distance | ( | const UT_Vector3 & | p1, | |
| const UT_Vector3 & | v1, | |||
| const UT_Vector3 & | p2, | |||
| const UT_Vector3 & | v2 | |||
| ) | const |
Compute the signed distance between two lines.
| fpreal UT_Vector3::distance | ( | const UT_Vector3 & | p1, | |
| const UT_Vector3 & | v1 | |||
| ) | const |
Compute the signed distance from us to a line.
| fpreal UT_Vector3::dot | ( | const UT_Vector3 & | v | ) | const [inline] |
Definition at line 466 of file UT_Vector3.h.
| int UT_Vector3::equalZero | ( | fpreal | tol = 0.00001f |
) | const [inline] |
Definition at line 220 of file UT_Vector3.h.
| int UT_Vector3::findMaxAbsAxis | ( | ) | const [inline] |
These allow you to find out what indices to use for different axes.
Definition at line 528 of file UT_Vector3.h.
| int UT_Vector3::findMinAbsAxis | ( | ) | const [inline] |
These allow you to find out what indices to use for different axes.
Definition at line 520 of file UT_Vector3.h.
| float UT_Vector3::g | ( | void | ) | const [inline] |
Return the components of the vector. The () operator does NOT check for the boundary condition.
Definition at line 647 of file UT_Vector3.h.
| float& UT_Vector3::g | ( | void | ) | [inline] |
Return the components of the vector. The () operator does NOT check for the boundary condition.
Definition at line 646 of file UT_Vector3.h.
| UT_Vector3 UT_Vector3::getBary | ( | const UT_Vector3 & | t0, | |
| const UT_Vector3 & | t1, | |||
| const UT_Vector3 & | t2, | |||
| bool * | degen = NULL | |||
| ) | const |
Compute (homogeneous) barycentric co-ordinates of this point relative to the triangle defined by t0, t1 and t2. (The point is projected into the triangle's plane.)
| void UT_Vector3::getDual | ( | UT_DMatrix3 & | dual | ) | const |
| void UT_Vector3::getDual | ( | UT_Matrix3 & | dual | ) | const |
Return the dual of the vector The dual is a matrix which acts like the cross product when multiplied by other vectors. The following are equivalent: a.getDual(A); c = colVecMult(A, b) c = cross(a, b)
| void UT_Vector3::getFrameOfReference | ( | UT_Vector3 & | X, | |
| UT_Vector3 & | Y | |||
| ) | const [inline] |
Given this vector as the z-axis, get a frame of reference such that the X and Y vectors are orthonormal to the vector. This vector should be normalized.
Definition at line 541 of file UT_Vector3.h.
| void UT_Vector3::homogenize | ( | void | ) | [inline] |
Express the point in homogeneous coordinates or vice-versa.
Definition at line 688 of file UT_Vector3.h.
| int UT_Vector3::isEqual | ( | const UT_Vector3 & | vect, | |
| fpreal | tol = 0.00001f | |||
| ) | const [inline] |
Definition at line 227 of file UT_Vector3.h.
| fpreal UT_Vector3::length | ( | void | ) | const [inline] |
The vector length (not to be confused with the vector dimension).
Definition at line 553 of file UT_Vector3.h.
| fpreal UT_Vector3::length2 | ( | void | ) | const [inline] |
The vector length squared.
Definition at line 556 of file UT_Vector3.h.
| int UT_Vector3::lineIntersect | ( | const UT_Vector3 & | p1, | |
| const UT_Vector3 & | v1, | |||
| const UT_Vector3 & | p2, | |||
| const UT_Vector3 & | v2 | |||
| ) |
This method stores in (*this) the intersection between two 3D lines, p1+t*v1 and p2+u*v2. If the two lines do not actually intersect, we shift the 2nd line along the perpendicular on both lines (along the line of min distance) and return the shifted intersection point; this point thus lies on the 1st line. If we find an intersection point (shifted or not) we return 0; if the two lines are parallel we return -1; and if they intersect behind our back we return -2. When we return -2 there still is a valid intersection point in (*this).
| bool UT_Vector3::load | ( | UT_IStream & | is | ) |
Protected I/O methods.
| void UT_Vector3::makeOrthonormal | ( | const UT_Vector3 & | v | ) |
Makes this orthogonal to the given vector. If they are colinear, does an arbitrary perp
| fpreal UT_Vector3::maxComponent | ( | ) | const [inline] |
| fpreal UT_Vector3::minComponent | ( | ) | const [inline] |
Definition at line 506 of file UT_Vector3.h.
| void UT_Vector3::multiply | ( | UT_Vector3 & | dest, | |
| const UT_DMatrix3 & | mat | |||
| ) | const [inline] |
The following methods implement multiplies (row) vector by a matrix, however, the resulting vector is specified by the dest parameter These operations are safe even if "dest" is the same as "this".
Definition at line 409 of file UT_Vector3.h.
| void UT_Vector3::multiply | ( | UT_Vector3 & | dest, | |
| const UT_DMatrix4 & | mat | |||
| ) | const [inline] |
The following methods implement multiplies (row) vector by a matrix, however, the resulting vector is specified by the dest parameter These operations are safe even if "dest" is the same as "this".
Definition at line 405 of file UT_Vector3.h.
| void UT_Vector3::multiply | ( | UT_Vector3 & | dest, | |
| const UT_Matrix3 & | mat | |||
| ) | const [inline] |
The following methods implement multiplies (row) vector by a matrix, however, the resulting vector is specified by the dest parameter These operations are safe even if "dest" is the same as "this".
Definition at line 388 of file UT_Vector3.h.
| void UT_Vector3::multiply | ( | UT_Vector3 & | dest, | |
| const UT_Matrix4 & | mat | |||
| ) | const [inline] |
The following methods implement multiplies (row) vector by a matrix, however, the resulting vector is specified by the dest parameter These operations are safe even if "dest" is the same as "this".
Definition at line 384 of file UT_Vector3.h.
| void UT_Vector3::multiply3 | ( | UT_Vector3 & | dest, | |
| const UT_DMatrix4 & | mat | |||
| ) | const [inline] |
The following methods implement multiplies (row) vector by a matrix, however, the resulting vector is specified by the dest parameter These operations are safe even if "dest" is the same as "this".
Definition at line 393 of file UT_Vector3.h.
| void UT_Vector3::multiply3 | ( | UT_Vector3 & | dest, | |
| const UT_Matrix4 & | mat | |||
| ) | const [inline] |
The following methods implement multiplies (row) vector by a matrix, however, the resulting vector is specified by the dest parameter These operations are safe even if "dest" is the same as "this".
Definition at line 372 of file UT_Vector3.h.
| void UT_Vector3::multiply3 | ( | const UT_DMatrix4 & | mat | ) | [inline] |
The *=, multiply, multiply3 and multiplyT routines are provided for legacy reasons. They all assume that *this is a row vector. Generally, the rowVecMult and colVecMult methods are preferred, since they're more explicit about the row vector assumption.
Definition at line 339 of file UT_Vector3.h.
| void UT_Vector3::multiply3 | ( | const UT_Matrix4 & | mat | ) | [inline] |
The *=, multiply, multiply3 and multiplyT routines are provided for legacy reasons. They all assume that *this is a row vector. Generally, the rowVecMult and colVecMult methods are preferred, since they're more explicit about the row vector assumption.
Definition at line 335 of file UT_Vector3.h.
| void UT_Vector3::multiply3T | ( | UT_Vector3 & | dest, | |
| const UT_DMatrix4 & | mat | |||
| ) | const [inline] |
The following methods implement multiplies (row) vector by a matrix, however, the resulting vector is specified by the dest parameter These operations are safe even if "dest" is the same as "this".
Definition at line 401 of file UT_Vector3.h.
| void UT_Vector3::multiply3T | ( | UT_Vector3 & | dest, | |
| const UT_Matrix4 & | mat | |||
| ) | const [inline] |
The following methods implement multiplies (row) vector by a matrix, however, the resulting vector is specified by the dest parameter These operations are safe even if "dest" is the same as "this".
Definition at line 380 of file UT_Vector3.h.
| void UT_Vector3::multiply3T | ( | const UT_DMatrix4 & | mat | ) | [inline] |
This multiply will multiply the (row) vector by the transpose of the matrix instead of the matrix itself. This is faster than transposing the matrix, then multiplying (as well there's potentially less storage requirements).
Definition at line 362 of file UT_Vector3.h.
| void UT_Vector3::multiply3T | ( | const UT_Matrix4 & | mat | ) | [inline] |
This multiply will multiply the (row) vector by the transpose of the matrix instead of the matrix itself. This is faster than transposing the matrix, then multiplying (as well there's potentially less storage requirements).
Definition at line 358 of file UT_Vector3.h.
| void UT_Vector3::multiplyComponents | ( | const UT_Vector3 & | v | ) | [inline] |
Definition at line 248 of file UT_Vector3.h.
| void UT_Vector3::multiplyT | ( | UT_Vector3 & | dest, | |
| const UT_DMatrix3 & | mat | |||
| ) | const [inline] |
The following methods implement multiplies (row) vector by a matrix, however, the resulting vector is specified by the dest parameter These operations are safe even if "dest" is the same as "this".
Definition at line 397 of file UT_Vector3.h.
| void UT_Vector3::multiplyT | ( | UT_Vector3 & | dest, | |
| const UT_Matrix3 & | mat | |||
| ) | const [inline] |
The following methods implement multiplies (row) vector by a matrix, however, the resulting vector is specified by the dest parameter These operations are safe even if "dest" is the same as "this".
Definition at line 376 of file UT_Vector3.h.
| void UT_Vector3::multiplyT | ( | const UT_DMatrix3 & | mat | ) | [inline] |
This multiply will multiply the (row) vector by the transpose of the matrix instead of the matrix itself. This is faster than transposing the matrix, then multiplying (as well there's potentially less storage requirements).
Definition at line 354 of file UT_Vector3.h.
| void UT_Vector3::multiplyT | ( | const UT_Matrix3 & | mat | ) | [inline] |
This multiply will multiply the (row) vector by the transpose of the matrix instead of the matrix itself. This is faster than transposing the matrix, then multiplying (as well there's potentially less storage requirements).
Definition at line 350 of file UT_Vector3.h.
| void UT_Vector3::negate | ( | void | ) | [inline] |
Definition at line 245 of file UT_Vector3.h.
| void UT_Vector3::normal | ( | const UT_Vector4 & | va, | |
| const UT_Vector4 & | vb | |||
| ) |
| void UT_Vector3::normal | ( | const UT_Vector3 & | va, | |
| const UT_Vector3 & | vb | |||
| ) | [inline] |
Definition at line 483 of file UT_Vector3.h.
| fpreal UT_Vector3::normalize | ( | void | ) | [inline] |
Definition at line 470 of file UT_Vector3.h.
| unsigned UT_Vector3::operator!= | ( | const UT_Vector3 & | v | ) | const [inline] |
Definition at line 218 of file UT_Vector3.h.
| float UT_Vector3::operator() | ( | unsigned | i | ) | const [inline] |
Return the components of the vector. The () operator does NOT check for the boundary condition.
Definition at line 655 of file UT_Vector3.h.
| float& UT_Vector3::operator() | ( | unsigned | i | ) | [inline] |
Return the components of the vector. The () operator does NOT check for the boundary condition.
Definition at line 650 of file UT_Vector3.h.
| UT_Vector3& UT_Vector3::operator*= | ( | const UT_Vector3 & | v | ) | [inline] |
Definition at line 440 of file UT_Vector3.h.
| UT_Vector3& UT_Vector3::operator*= | ( | fpreal | scalar | ) | [inline] |
Definition at line 432 of file UT_Vector3.h.
| UT_Vector3& UT_Vector3::operator*= | ( | const UT_DMatrix4 & | m | ) | [inline] |
The *=, multiply, multiply3 and multiplyT routines are provided for legacy reasons. They all assume that *this is a row vector. Generally, the rowVecMult and colVecMult methods are preferred, since they're more explicit about the row vector assumption.
Definition at line 332 of file UT_Vector3.h.
| UT_Vector3& UT_Vector3::operator*= | ( | const UT_Matrix4 & | m | ) | [inline] |
The *=, multiply, multiply3 and multiplyT routines are provided for legacy reasons. They all assume that *this is a row vector. Generally, the rowVecMult and colVecMult methods are preferred, since they're more explicit about the row vector assumption.
Definition at line 330 of file UT_Vector3.h.
| UT_Vector3& UT_Vector3::operator*= | ( | const UT_DMatrix3 & | m | ) | [inline] |
The *=, multiply, multiply3 and multiplyT routines are provided for legacy reasons. They all assume that *this is a row vector. Generally, the rowVecMult and colVecMult methods are preferred, since they're more explicit about the row vector assumption.
Definition at line 328 of file UT_Vector3.h.
| UT_Vector3& UT_Vector3::operator*= | ( | const UT_Matrix3 & | m | ) | [inline] |
The *=, multiply, multiply3 and multiplyT routines are provided for legacy reasons. They all assume that *this is a row vector. Generally, the rowVecMult and colVecMult methods are preferred, since they're more explicit about the row vector assumption.
Definition at line 326 of file UT_Vector3.h.
| UT_Vector3& UT_Vector3::operator+= | ( | fpreal | scalar | ) | [inline] |
Definition at line 420 of file UT_Vector3.h.
| UT_Vector3& UT_Vector3::operator+= | ( | const UT_Vector3 & | v | ) | [inline] |
Definition at line 197 of file UT_Vector3.h.
| UT_Vector3 UT_Vector3::operator- | ( | ) | const [inline] |
Definition at line 192 of file UT_Vector3.h.
| UT_Vector3& UT_Vector3::operator-= | ( | fpreal | scalar | ) | [inline] |
Definition at line 427 of file UT_Vector3.h.
| UT_Vector3& UT_Vector3::operator-= | ( | const UT_Vector3 & | v | ) | [inline] |
Definition at line 205 of file UT_Vector3.h.
| UT_Vector3& UT_Vector3::operator/= | ( | const UT_Vector3 & | v | ) | [inline] |
Definition at line 453 of file UT_Vector3.h.
| UT_Vector3& UT_Vector3::operator/= | ( | fpreal | scalar | ) | [inline] |
Definition at line 448 of file UT_Vector3.h.
| UT_Vector3& UT_Vector3::operator= | ( | fpreal | scalar | ) | [inline] |
Definition at line 415 of file UT_Vector3.h.
| UT_Vector3& UT_Vector3::operator= | ( | const UT_Vector4 & | v | ) |
Assignment operator that truncates a V4 to a V3.
| unsigned UT_Vector3::operator== | ( | const UT_Vector3 & | v | ) | const [inline] |
Definition at line 212 of file UT_Vector3.h.
| float UT_Vector3::operator[] | ( | unsigned | i | ) | const [inline] |
Return the components of the vector. The () operator does NOT check for the boundary condition.
Definition at line 665 of file UT_Vector3.h.
| float& UT_Vector3::operator[] | ( | unsigned | i | ) | [inline] |
Return the components of the vector. The () operator does NOT check for the boundary condition.
Definition at line 660 of file UT_Vector3.h.
| UT_Matrix3 UT_Vector3::project | ( | int | norm = 1 |
) |
Create a matrix of projection onto this vector: the matrix transforms a vector v into its projection on the direction of (*this) vector, ie. dot(*this, v) * this->normalize(); If we need to be normalized, set norm to a non-zero value.
| UT_Vector3 UT_Vector3::project | ( | const UT_Vector3 & | u | ) | const |
Calculates the orthogonal projection of a vector u on the *this vector.
| UT_DMatrix3 UT_Vector3::projectD | ( | int | norm = 1 |
) |
| UT_Vector3 UT_Vector3::projection | ( | const UT_Vector3 & | p, | |
| const UT_Vector3 & | v | |||
| ) | const |
Vector p (representing a point in 3-space) and vector v define a line. This member returns the projection of "this" onto the line (the point on the line that is closest to this point).
| UT_Vector3 UT_Vector3::projectOnSegment | ( | const UT_Vector3 & | va, | |
| const UT_Vector3 & | vb, | |||
| fpreal & | t | |||
| ) | const |
Projects this onto the line segment [a, b]. The fpreal t is set to the parametric position of intersection, a being 0 and b being 1.
| UT_Vector3 UT_Vector3::projectOnSegment | ( | const UT_Vector3 & | va, | |
| const UT_Vector3 & | vb | |||
| ) | const |
Projects this onto the line segement [a,b]. The returned point will lie between a and b.
| float UT_Vector3::r | ( | void | ) | const [inline] |
Return the components of the vector. The () operator does NOT check for the boundary condition.
Definition at line 645 of file UT_Vector3.h.
| float& UT_Vector3::r | ( | void | ) | [inline] |
Return the components of the vector. The () operator does NOT check for the boundary condition.
Definition at line 644 of file UT_Vector3.h.
| void UT_Vector3::radToDeg | ( | ) |
conversion between degrees and radians
| void UT_Vector3::roundAngles | ( | const UT_Vector3 & | b, | |
| const UT_XformOrder & | o | |||
| ) |
It seems that given any rotation matrix and transform order, there are two distinct triples of rotations that will result in the same overall rotation. This method will find the closest of the two after finding the closest using the above method.
| void UT_Vector3::roundAngles | ( | const UT_Vector3 & | base | ) |
assuming that "this" is a rotation (in radians, of course), the equivalent set of rotations which are closest to the "base" rotation are found. The equivalent rotations are the same as the original rotations +2*n*PI
| void UT_Vector3::rowVecMult | ( | const UT_DMatrix4 & | m | ) | [inline] |
If you need a multiplication operator that left multiplies the vector by a matrix (M * v), use the following colVecMult() functions. If you'd rather not use operator*=() for right-multiplications (v * M), use the following rowVecMult() functions. The methods that take a 4x4 matrix first extend this vector to 4D by adding an element equal to 1.0.
Definition at line 273 of file UT_Vector3.h.
| void UT_Vector3::rowVecMult | ( | const UT_DMatrix3 & | m | ) | [inline] |
If you need a multiplication operator that left multiplies the vector by a matrix (M * v), use the following colVecMult() functions. If you'd rather not use operator*=() for right-multiplications (v * M), use the following rowVecMult() functions. The methods that take a 4x4 matrix first extend this vector to 4D by adding an element equal to 1.0.
Definition at line 269 of file UT_Vector3.h.
| void UT_Vector3::rowVecMult | ( | const UT_Matrix4 & | m | ) | [inline] |
If you need a multiplication operator that left multiplies the vector by a matrix (M * v), use the following colVecMult() functions. If you'd rather not use operator*=() for right-multiplications (v * M), use the following rowVecMult() functions. The methods that take a 4x4 matrix first extend this vector to 4D by adding an element equal to 1.0.
Definition at line 265 of file UT_Vector3.h.
| void UT_Vector3::rowVecMult | ( | const UT_Matrix3 & | m | ) | [inline] |
If you need a multiplication operator that left multiplies the vector by a matrix (M * v), use the following colVecMult() functions. If you'd rather not use operator*=() for right-multiplications (v * M), use the following rowVecMult() functions. The methods that take a 4x4 matrix first extend this vector to 4D by adding an element equal to 1.0.
Definition at line 261 of file UT_Vector3.h.
| void UT_Vector3::rowVecMult3 | ( | const UT_DMatrix4 & | m | ) | [inline] |
This multiply will not extend the vector by adding a fourth element. Instead, it converts the Matrix4 to a Matrix3. This means that the translate component of the matrix is not applied to the vector
Definition at line 304 of file UT_Vector3.h.
| void UT_Vector3::rowVecMult3 | ( | const UT_Matrix4 & | m | ) | [inline] |
This multiply will not extend the vector by adding a fourth element. Instead, it converts the Matrix4 to a Matrix3. This means that the translate component of the matrix is not applied to the vector
Definition at line 300 of file UT_Vector3.h.
| void UT_Vector3::save | ( | ostream & | os, | |
| int | binary = 0 | |||
| ) | const |
Protected I/O methods.
| int UT_Vector3::segLineIntersect | ( | const UT_Vector3 & | pa, | |
| const UT_Vector3 & | pb, | |||
| const UT_Vector3 & | p2, | |||
| const UT_Vector3 & | v2 | |||
| ) |
Compute the intersection of vector p2+t*v2 and the line segment between points pa and pb. If the two lines do not intersect we shift the (p2, v2) line along the line of min distance and return the point where it intersects the segment. If we find an intersection point along the stretch between pa and pb, we return 0. If the lines are parallel we return -1. If they intersect before pa we return -2, and if after pb, we return -3. The intersection point is valid with return codes 0,-2,-3.
| UT_Matrix3 UT_Vector3::symmetry | ( | int | norm = 1 |
) |
Create a matrix of symmetry around this vector: the matrix transforms a vector v into its symmetry around (*this), ie. two times the projection of v onto (*this) minus v. If we need to be normalized, set norm to a non-zero value.
| float UT_Vector3::x | ( | void | ) | const [inline] |
Return the components of the vector. The () operator does NOT check for the boundary condition.
Definition at line 639 of file UT_Vector3.h.
| float& UT_Vector3::x | ( | void | ) | [inline] |
Return the components of the vector. The () operator does NOT check for the boundary condition.
Definition at line 638 of file UT_Vector3.h.
| float UT_Vector3::y | ( | void | ) | const [inline] |
Return the components of the vector. The () operator does NOT check for the boundary condition.
Definition at line 641 of file UT_Vector3.h.
| float& UT_Vector3::y | ( | void | ) | [inline] |
Return the components of the vector. The () operator does NOT check for the boundary condition.
Definition at line 640 of file UT_Vector3.h.
| float UT_Vector3::z | ( | void | ) | const [inline] |
Return the components of the vector. The () operator does NOT check for the boundary condition.
Definition at line 643 of file UT_Vector3.h.
| float& UT_Vector3::z | ( | void | ) | [inline] |
Return the components of the vector. The () operator does NOT check for the boundary condition.
Definition at line 642 of file UT_Vector3.h.
| ostream& operator<< | ( | ostream & | os, | |
| const UT_Vector3 & | v | |||
| ) | [friend] |
| float UT_Vector3::vec[3] |
1.5.9