#include <MVector.h>
This class provides access to Maya's internal vector math library allowing vectors to be handled easily, and in a manner compatible with internal Maya data structures.
All methods that query the vector are threadsafe, all methods that modify the vector are not threadsafe.
animInfoCmd.cpp, apiMeshCreator.cpp, apiMeshData.cpp, apiMeshShape.cpp, apiMeshShapeUI.cpp, apiSimpleShapeUI.cpp, buildRotationNode.cpp, cgfxShaderNode.cpp, closestPointCmd.cpp, closestPointOnCurveCmd.cpp, closestPointOnCurveNode.cpp, closestPointOnNurbsSurfaceCmd.cpp, closestTangentUAndDistance.cpp, closestTangentUAndDistance.h, componentScaleManip.cpp, customAttrManip.cpp, D3DResourceManager.cpp, D3DViewportRenderer.cpp, dynExprField.cpp, dynExprField.h, footPrintManip.cpp, geometryCacheBlockDVAData.cpp, geometryCacheBlockFVAData.cpp, geometrySurfaceConstraint.cpp, getPointAndNormal.cpp, getPointAndNormal.h, hairCollisionSolver.cpp, hwAnisotropicShader_NV20.cpp, hwDecalBumpShader_NV20.cpp, hwReflectBumpShader_NV20.cpp, hwRefractReflectShader_NV20.cpp, hwRefractReflectShader_NV20.h, hwToonShader_NV20.cpp, intersectOnNurbsSurfaceCmd.cpp, lineManip.cpp, lineManipContainer.cpp, lineManipContainer.h, manipulatorMath.cpp, manipulatorMath.h, meshOpFtyAction.cpp, moveManip.cpp, moveNumericTool.cpp, moveTool.cpp, narrowPolyViewer.cpp, ownerEmitter.cpp, ownerEmitter.h, particleAttrNode.cpp, particleSystemInfoCmd.cpp, pfxInfoCmd.cpp, pointOnMeshCmd.cpp, pointOnMeshInfoNode.cpp, pointOnSubdNode.cpp, rockingTransform.cpp, rotateManip.cpp, sampleCmd.cpp, simpleEmitter.cpp, simpleEmitter.h, simpleFluidEmitter.cpp, simpleSolverNode.cpp, simpleSpring.cpp, simpleSpring.h, squareScaleManip.cpp, squareScaleManipContext.cpp, squareScaleManipContext.h, surfaceTwist.cpp, surfaceTwistCmd.cpp, sweptEmitter.cpp, sweptEmitter.h, swissArmyManip.cpp, torusField.cpp, torusField.h, and translateCmd.cpp.
Public Types | |
enum | Axis { kXaxis, kYaxis, kZaxis, kWaxis } |
Axes. More... | |
Public Member Functions | |
MVector () | |
MVector (const MVector &) | |
MVector (const MFloatPoint &) | |
MVector (const MFloatVector &) | |
MVector (const MPoint &) | |
MVector (double xx, double yy, double zz=0.0) | |
MVector (const double d[3]) | |
~MVector () | |
MVector & | operator= (const MVector &src) |
double | operator() (unsigned int i) const |
double | operator[] (unsigned int i) const |
MVector | operator^ (const MVector &right) const |
double | operator* (const MVector &right) const |
MVector & | operator/= (double scalar) |
MVector | operator/ (double scalar) const |
MVector & | operator*= (double scalar) |
MVector | operator* (double scalar) const |
MVector | operator+ (const MVector &other) const |
MVector & | operator+= (const MVector &other) |
MVector | operator- () const |
MVector & | operator-= (const MVector &other) |
MVector | operator- (const MVector &other) const |
MVector | operator* (const MMatrix &) const |
MVector & | operator*= (const MMatrix &) |
bool | operator!= (const MVector &other) const |
bool | operator== (const MVector &other) const |
MVector | rotateBy (double x, double y, double z, double w) const |
MVector | rotateBy (const double rotXYZ[3], MTransformationMatrix::RotationOrder order) const |
MVector | rotateBy (MVector::Axis axis, const double angle) const |
MVector | rotateBy (const MQuaternion &) const |
MVector | rotateBy (const MEulerRotation &) const |
MQuaternion | rotateTo (const MVector &) const |
MStatus | get (double[3]) const |
double | length () const |
MVector | normal () const |
MStatus | normalize () |
double | angle (const MVector &other) const |
bool | isEquivalent (const MVector &other, double tolerance=1.0e-10) const |
bool | isParallel (const MVector &other, double tolerance=1.0e-10) const |
MVector | transformAsNormal (const MMatrix &matrix) const |
double & | operator() (unsigned int i) |
NO SCRIPT SUPPORT. | |
double & | operator[] (unsigned int i) |
NO SCRIPT SUPPORT. | |
Public Attributes | |
double | x |
The x component of the vector. | |
double | y |
The y component of the vector. | |
double | z |
The z component of the vector. | |
Static Public Attributes | |
static const MVector | zero |
The null vector. | |
static const MVector | one |
The vector <1,1,1>. | |
static const MVector | xAxis |
Unit vector in the positive x direction. | |
static const MVector | yAxis |
Unit vector in the positive y direction. | |
static const MVector | zAxis |
Unit vector in the positive z direction. | |
static const MVector | xNegAxis |
Unit vector in the negative z direction. | |
static const MVector | yNegAxis |
Unit vector in the negative z direction. | |
static const MVector | zNegAxis |
Unit vector in the negative z direction. | |
Friends | |
OPENMAYA_EXPORT MVector | operator* (const MMatrix &, const MVector &) |
NO SCRIPT SUPPORT. | |
OPENMAYA_EXPORT MVector | operator* (int, const MVector &) |
NO SCRIPT SUPPORT. | |
OPENMAYA_EXPORT MVector | operator* (short, const MVector &) |
NO SCRIPT SUPPORT. | |
OPENMAYA_EXPORT MVector | operator* (unsigned int, const MVector &) |
NO SCRIPT SUPPORT. | |
OPENMAYA_EXPORT MVector | operator* (unsigned short, const MVector &) |
NO SCRIPT SUPPORT. | |
OPENMAYA_EXPORT MVector | operator* (float, const MVector &) |
NO SCRIPT SUPPORT. | |
OPENMAYA_EXPORT MVector | operator* (double, const MVector &) |
NO SCRIPT SUPPORT. | |
OPENMAYA_EXPORT std::ostream & | operator<< (std::ostream &os, const MVector &v) |
NO SCRIPT SUPPORT. |
enum MVector::Axis |
MVector::MVector | ( | ) | [inline] |
The default class constructor. Creates a null vector.
MVector::MVector | ( | const MVector & | src | ) | [inline] |
The copy constructor. Create a new vector and initialize it to the same values as the given vector.
[in] | src | the vector object to copy |
MVector::MVector | ( | const MFloatPoint & | src | ) |
Class constructor. Create a new vector and initialize it to the same x, y, z values as the given point.
[in] | src | the point object to copy |
MVector::MVector | ( | const MFloatVector & | src | ) |
Class constructor. Create a new vector and initialize it to the same values as the given vector.
[in] | src | the vector object to copy |
MVector::MVector | ( | const MPoint & | src | ) |
Class constructor. Create a new vector and initialize it to the same x, y, z values as the given point.
[in] | src | the point object to copy |
MVector::MVector | ( | double | xx, | |
double | yy, | |||
double | zz = 0.0 | |||
) | [inline] |
Class constructor. Initializes the vector with the explicit x, y and z values provided as arguments.
[in] | xx | the x component of the vector |
[in] | yy | the y component of the vector |
[in] | zz | the z component of the vector. Defaults to 0.0. |
MVector::MVector | ( | const double | d[3] | ) | [inline] |
Class constructor. Initializes the vector with the explicit x, y and z values provided in the given double array.
[in] | d | the 3 element array containing the initial x, y, and z values |
MVector::~MVector | ( | ) | [inline] |
Class destructor.
The assignment operator. Allows assignment between MVectors.
[in] | src | Vector to copy from. |
double MVector::operator() | ( | unsigned int | i | ) | const [inline] |
The index operator. If its argument is 0 it will return the x component of the vector. If its argument is 1 it will return the y component of the vector. Otherwise it will return the z component of the vector.
[in] | i | value indicating which component to return |
double MVector::operator[] | ( | unsigned int | i | ) | const [inline] |
The index operator. If its argument is 0 it will return the x component of the vector. If its argument is 1 it will return the y component of the vector. Otherwise it will return the z component of the vector.
[in] | i | value indicating which component to return |
The cross product operator.
[in] | right | Vector to take the cross product with. |
double MVector::operator* | ( | const MVector & | right | ) | const [inline] |
The dot product operator.
[in] | right | Vector to take the dot product with. |
MVector & MVector::operator/= | ( | double | scalar | ) | [inline] |
The in place division operator.
[in] | scalar | Division factor. |
MVector MVector::operator/ | ( | double | scalar | ) | const [inline] |
The division operator.
[in] | scalar | Division factor. |
MVector & MVector::operator*= | ( | double | scalar | ) | [inline] |
The in place multiplication operator.
[in] | scalar | Scale factor. |
MVector MVector::operator* | ( | double | scalar | ) | const [inline] |
The multiplication operator.
[in] | scalar | Scale factor. |
The vector addition operator.
[in] | other | Vector to add. |
The in place vector addition operator.
[in] | other | Vector to add. |
MVector MVector::operator- | ( | ) | const [inline] |
The unary minus operator. Negates the value of each of the x, y, and z components of the vector.
The in place vector subtraction operator.
[in] | other | Vector to subtract. |
The vector subtraction operator.
[in] | other | Vector to substract. |
The in place matrix multiplication operator.
bool MVector::operator!= | ( | const MVector & | other | ) | const [inline] |
The vector inequality operator. This returns false if all three of the x, y, and z components are identical.
[in] | other | The vector to compare to. |
bool MVector::operator== | ( | const MVector & | other | ) | const [inline] |
The vector equality operator. This returns true if all three of the x, y, and z components are identical.
[in] | other | The vector to compare to. |
MVector MVector::rotateBy | ( | double | x, | |
double | y, | |||
double | z, | |||
double | w | |||
) | const |
Returns the vector that represents the rotation of this vector by the given quaternion.
[in] | x | The x component of the quaternion. |
[in] | y | The y component of the quaternion. |
[in] | z | The z component of the quaternion. |
[in] | w | The w component of the quaternion. |
MVector MVector::rotateBy | ( | const double | rotXYZ[3], | |
MTransformationMatrix::RotationOrder | order | |||
) | const |
Returns the vector that represents the rotation of this vector by the given rotateXYZ according to the rotation order.
[in] | rotXYZ | The array that represent the rotation about the X, Y, and Z axis respectively. |
MVector MVector::rotateBy | ( | MVector::Axis | axis, | |
const double | angle | |||
) | const |
Returns the vector that represents the rotation of this vector by the given angle about the given axis.
[in] | axis | The axis to rotate about. |
[in] | angle | The rotation angle about the axis. |
MVector MVector::rotateBy | ( | const MQuaternion & | q | ) | const |
Returns the vector that represents the rotation of this vector by the given quaternion.
[in] | q | The quaternion rotation by which the vector will be rotated to produce the resulting vector. |
MVector MVector::rotateBy | ( | const MEulerRotation & | e | ) | const |
Returns the vector that represents the rotation of this vector by the given euler rotation.
[in] | e | The euler rotation by which the vector will be rotated to produce the resulting vector. |
MQuaternion MVector::rotateTo | ( | const MVector & | other | ) | const |
Returns the quaternion that represents the rotation of this vector into the other vector about their mutually perpendicular axis.
[in] | other | The other vector into which this vector will be rotated to produce the resulting quaternion rotation. |
MStatus MVector::get | ( | double | dest[3] | ) | const [inline] |
Extracts the x, y, and z components of the vector and places them in elements 0, 1, and 2 of the double array passed.
[out] | dest | the array of 3 doubles into which the results are placed. |
double MVector::length | ( | ) | const [inline] |
Return the length of the vector.
MVector MVector::normal | ( | ) | const [inline] |
Return a normalized copy of this vector.
MStatus MVector::normalize | ( | ) | [inline] |
double MVector::angle | ( | const MVector & | other | ) | const |
Returns the angle in radians between the vector and the one passed as an argument.
[in] | other | the vector from which to compute the angle. |
bool MVector::isEquivalent | ( | const MVector & | other, | |
double | tol = 1.0e-10 | |||
) | const [inline] |
Returns true if the vector and the one passed as an argument are equal to each other within the specified tolerance.
[in] | other | The vector to compare to. |
[in] | tol | The tolerance to use during the comparison. |
bool MVector::isParallel | ( | const MVector & | other, | |
double | tol = 1.0e-10 | |||
) | const |
Returns true if the current vector and the one passed as an argument are parallel to each other within the specified tolerance.
[in] | other | the vector to compare to |
[in] | tol | the tolerance to use during the comparison |
This method treats the vector as a normal vector and returns a transformed copy of the vector.
Normal vectors are not transformed in the same way as position vectors or points. If this vector is treated as a normal vector then it needs to be transformed by post multiplying it by the inverse tanspose of the transformation matrix. This method will apply the proper transformation to the vector as if it were a normal.
[in] | matrix | the transformation matrix |
double & MVector::operator() | ( | unsigned int | i | ) | [inline] |
NO SCRIPT SUPPORT.
The index operator. If its argument is 0 it will return the x component of the vector. If its argument is 1 it will return the y component of the vector. Otherwise it will return the z component of the vector.
[in] | i | value indicating which component to return |
double & MVector::operator[] | ( | unsigned int | i | ) | [inline] |
NO SCRIPT SUPPORT.
The index operator. If its argument is 0 it will return the x component of the vector. If its argument is 1 it will return the y component of the vector. Otherwise it will return the z component of the vector.
[in] | i | value indicating which component to return |
NO SCRIPT SUPPORT.
The multiplication operator that allows the scalar value to preceed the vector.
[in] | scalar | Scale factor. |
[in] | other | Vector to scale. |
NO SCRIPT SUPPORT.
The multiplication operator that allows the scalar value to preceed the vector.
[in] | scalar | Scale factor. |
[in] | other | Vector to scale. |
NO SCRIPT SUPPORT.
The multiplication operator that allows the scalar value to preceed the vector.
[in] | scalar | Scale factor. |
[in] | other | Vector to scale. |
NO SCRIPT SUPPORT.
The multiplication operator that allows the scalar value to preceed the vector.
[in] | scalar | Scale factor. |
[in] | other | Vector to scale. |
NO SCRIPT SUPPORT.
The multiplication operator that allows the scalar value to preceed the vector.
[in] | scalar | Scale factor. |
[in] | other | Vector to scale. |
NO SCRIPT SUPPORT.
The multiplication operator that allows the scalar value to preceed the vector.
[in] | scalar | Scale factor. |
[in] | other | Vector to scale. |
OPENMAYA_EXPORT std::ostream& operator<< | ( | std::ostream & | os, | |
const MVector & | v | |||
) | [friend] |
Autodesk® Maya® 2010 © 1997-2009 Autodesk, Inc. All rights reserved. | Generated with 1.5.6 |