OpenMaya.MFloatVector Class Reference

Class Description

3D vector with single-precision coordinates.

Constructors

SignatureParametersDescription
MFloatVector()  

Default constructor. Returns a new MFloatVector object initialized to the zero vector.

MFloatVector(src) src - MVector, MFloatVector, MPoint or MFloatPoint

Copy constructor. Returns a new MFloatVector object whose x, y and z coordinates are set to the x, y and z coordinates of src.

MFloatVector(seq) seq - sequence of two three floats

Returns a new MFloatVector object whose x, y and z coordinates are set to the elements of seq. If the sequence only contains two values, z will be set to 0.0.

MFloatVector(x, y, z=0.0) x - float
y - float
z - float

Returns a new MFloatVector object with the specified x, y and z coordinates.

Sequence Support

An MFloatVector is treated a sequence of three float values: [x, y, z].

len() returns 3.

Indexing and element assignment are supported.

Deletion, concatenation, repetition and slicing are not supported.

Number Support

OperationDescription
MFloatVector = MFloatVector ^ MFloatVector

Cross product of two vectors.

float = MFloatVector * MFloatVector

Dot product of the two vectors.

MFloatVector = MFloatVector / scalar

Returns a new vector whose components are those of the given vector, each divided by scalar, which can be of any type which is convertable to float.

MFloatVector /= scalar

Divides each component of the vector by scalar, which can be of any type which is convertable to float, and returns a new reference to the vector.

MFloatVector = MFloatVector * scalar

Returns a new vector whose components are those of the given vector, each multiplied by scalar, which can be of any type which is convertable to float.

MFloatVector = scalar * MFloatVector

Returns a new vector whose components are those of the given vector, each multiplied by scalar, which can be of any type which is convertable to float.

MFloatVector *= scalar

Multiplies each component of the vector by scalar, which can be of any type which is convertable to float, and returns a new reference to the vector.

MFloatVector = MFloatVector * MFloatMatrix

Postmultiplying a vector by a matrix.

MFloatVector = MFloatMatrix * MFloatVector

Premultiplying a vector by a matrix.

MFloatVector *= MFloatMatrix

Postmultiplies the vector by the matrix and returns a new reference to the vector.

MFloatVector = MFloatVector + MFloatVector

Vector addition.

MFloatVector += MFloatVector

In-pace vector addition.

MFloatVector = -MFloatVector

Negate a vector.

MFloatVector = MFloatVector - MFloatVector

Vector subtraction.

MFloatVector -= MFloatVector

In-place vector subtraction.

Comparison Support

MFloatVector == MFloatVector Returns True if each component of the first vector is exactly equal to the corresponding component of the second.
MFloatVector != MFloatVector Returns False is any component of the first vector is not exactly equal to the corresponding component of the second.

All other comparison operators will raise a TypeError exception.

 


+ Inheritance diagram for OpenMaya.MFloatVector:

Public Member Functions

__add__ ()
 
__delitem__ ()
 
__div__ ()
 
__eq__ ()
 
__ge__ ()
 
__getitem__ ()
 
__gt__ ()
 
__iadd__ ()
 
__idiv__ ()
 
__imul__ ()
 
__init__ ()
 
__isub__ ()
 
__le__ ()
 
__len__ ()
 
__lt__ ()
 
__mul__ ()
 
__ne__ ()
 
__neg__ ()
 
__radd__ ()
 
__rdiv__ ()
 
__repr__ ()
 
__rmul__ ()
 
__rsub__ ()
 
__rxor__ ()
 
__setitem__ ()
 
__str__ ()
 
__sub__ ()
 
__xor__ ()
 
angle ()
 
isEquivalent ()
 
isParallel ()
 
length ()
 
normal ()
 
normalize ()
 
transformAsNormal ()
 

Static Public Attributes

float kTolerance = 9.999999747378752e-06
 
Common Vectors
tuple kOneVector = maya.api.OpenMaya.MFloatVector(1, 1, 1)
 
tuple kXaxisVector = maya.api.OpenMaya.MFloatVector(1, 0, 0)
 
tuple kXnegAxisVector = maya.api.OpenMaya.MFloatVector(-1, 0, 0)
 
tuple kYaxisVector = maya.api.OpenMaya.MFloatVector(0, 1, 0)
 
tuple kYnegAxisVector = maya.api.OpenMaya.MFloatVector(0, -1, 0)
 
tuple kZaxisVector = maya.api.OpenMaya.MFloatVector(0, 0, 1)
 
tuple kZeroVector = maya.api.OpenMaya.MFloatVector(0, 0, 0)
 
tuple kZnegAxisVector = maya.api.OpenMaya.MFloatVector(0, 0, -1)
 

Properties

 x
 
 y
 
 z
 

Constructor & Destructor Documentation

OpenMaya.MFloatVector.__init__ ( )
x.__init__(...) initializes x; see help(type(x)) for signature

Member Function Documentation

OpenMaya.MFloatVector.__add__ ( )
x.__add__(y) <==> x+y
OpenMaya.MFloatVector.__delitem__ ( )
x.__delitem__(y) <==> del x[y]
OpenMaya.MFloatVector.__div__ ( )
x.__div__(y) <==> x/y
OpenMaya.MFloatVector.__eq__ ( )
x.__eq__(y) <==> x==y
OpenMaya.MFloatVector.__ge__ ( )
x.__ge__(y) <==> x>=y
OpenMaya.MFloatVector.__getitem__ ( )
x.__getitem__(y) <==> x[y]
OpenMaya.MFloatVector.__gt__ ( )
x.__gt__(y) <==> x>y
OpenMaya.MFloatVector.__iadd__ ( )
x.__iadd__(y) <==> x+=y
OpenMaya.MFloatVector.__idiv__ ( )
x.__idiv__(y) <==> x/=y
OpenMaya.MFloatVector.__imul__ ( )
x.__imul__(y) <==> x*=y
OpenMaya.MFloatVector.__isub__ ( )
x.__isub__(y) <==> x-=y
OpenMaya.MFloatVector.__le__ ( )
x.__le__(y) <==> x<=y
OpenMaya.MFloatVector.__len__ ( )
x.__len__() <==> len(x)
OpenMaya.MFloatVector.__lt__ ( )
x.__lt__(y) <==> x<y
OpenMaya.MFloatVector.__mul__ ( )
x.__mul__(y) <==> x*y
OpenMaya.MFloatVector.__ne__ ( )
x.__ne__(y) <==> x!=y
OpenMaya.MFloatVector.__neg__ ( )
x.__neg__() <==> -x
OpenMaya.MFloatVector.__radd__ ( )
x.__radd__(y) <==> y+x
OpenMaya.MFloatVector.__rdiv__ ( )
x.__rdiv__(y) <==> y/x
OpenMaya.MFloatVector.__repr__ ( )
x.__repr__() <==> repr(x)
OpenMaya.MFloatVector.__rmul__ ( )
x.__rmul__(y) <==> y*x
OpenMaya.MFloatVector.__rsub__ ( )
x.__rsub__(y) <==> y-x
OpenMaya.MFloatVector.__rxor__ ( )
x.__rxor__(y) <==> y^x
OpenMaya.MFloatVector.__setitem__ ( )
x.__setitem__(i, y) <==> x[i]=y
OpenMaya.MFloatVector.__str__ ( )
x.__str__() <==> str(x)
OpenMaya.MFloatVector.__sub__ ( )
x.__sub__(y) <==> x-y
OpenMaya.MFloatVector.__xor__ ( )
x.__xor__(y) <==> x^y
OpenMaya.MFloatVector.angle ( )
Returns the angle, in radians, between this vector and another.
Signature: angle(other)
Parameters: other - MFloatVector
Returns: float
Description: Returns the angle, in radians, between this vector and other.
OpenMaya.MFloatVector.isEquivalent ( )
Returns True if this vector and another are within a given tolerance of being equal.
Signature: isEquivalent(other, tolerance=kTolerance)
Parameters: other - MFloatVector
tolerance - float
Returns: bool
Description: Returns True if this vector and other are within the given tolerance of being equal.
OpenMaya.MFloatVector.isParallel ( )
Returns True if this vector and another are within the given tolerance of being parallel.
Signature: isParallel(other, tolerance=kTolerance)
Parameters: other - MFloatVector
tolerance - float
Returns: bool
Description: Returns True if this vector and other are within the given tolerance of being parallel.
OpenMaya.MFloatVector.length ( )
Returns the magnitude of this vector.
Signature: length()
Parameters:  
Returns: float
Description: Returns the magnitude of this vector.
OpenMaya.MFloatVector.normal ( )
Returns a new vector containing the normalized version of this one.
Signature: normal()
Parameters:  
Returns: MFloatVector
Description: Returns a new vector containing the normalized version of this vector.
OpenMaya.MFloatVector.normalize ( )
Normalizes this vector in-place and returns a new reference to it.
Signature: normalize()
Parameters:  
Returns: Reference to self
Description: Normalizes this vector in-place and returns a new reference to it.
OpenMaya.MFloatVector.transformAsNormal ( )
Returns a new vector which is calculated by postmultiplying this vector by the transpose of the given matrix and then normalizing the result.
Signature: transformAsNormal(matrix)
Parameters: matrix - MFloatMatrix
Returns: MFloatVector
Description: Returns a new vector which is calculated by postmultiplying this vector by the transpose of matrix and then normalizing it.

Member Data Documentation

OpenMaya.MFloatVector.kOneVector = maya.api.OpenMaya.MFloatVector(1, 1, 1)
static
Name: kOneVector
Type: MFloatVector
Description: (1,1,1)
OpenMaya.MFloatVector.kTolerance = 9.999999747378752e-06
static
Name: kTolerance
Type: float
Description: Default tolerance used for inexact comparisons.
OpenMaya.MFloatVector.kXaxisVector = maya.api.OpenMaya.MFloatVector(1, 0, 0)
static
Name: kXaxisVector
Type: MFloatVector
Description: (1,0,0)
OpenMaya.MFloatVector.kXnegAxisVector = maya.api.OpenMaya.MFloatVector(-1, 0, 0)
static
Name: kXnegAxisVector
Type: MFloatVector
Description: (-1,0,0)
OpenMaya.MFloatVector.kYaxisVector = maya.api.OpenMaya.MFloatVector(0, 1, 0)
static
Name: kYaxisVector
Type: MFloatVector
Description: (0,1,0)
OpenMaya.MFloatVector.kYnegAxisVector = maya.api.OpenMaya.MFloatVector(0, -1, 0)
static
Name: kYnegAxisVector
Type: MFloatVector
Description: (0,-1,0)
OpenMaya.MFloatVector.kZaxisVector = maya.api.OpenMaya.MFloatVector(0, 0, 1)
static
Name: kZaxisVector
Type: MFloatVector
Description: (0,0,1)
OpenMaya.MFloatVector.kZeroVector = maya.api.OpenMaya.MFloatVector(0, 0, 0)
static
Name: kZeroVector
Type: MFloatVector
Description: (0,0,0)
OpenMaya.MFloatVector.kZnegAxisVector = maya.api.OpenMaya.MFloatVector(0, 0, -1)
static
Name: kZnegAxisVector
Type: MFloatVector
Description: (0,0,-1)

Property Documentation

OpenMaya.MFloatVector.x
static
 X coordinate
Name: x
Type: float
Access: RW
Description: X component.
OpenMaya.MFloatVector.y
static
 Y coordinate
Name: y
Type: float
Access: RW
Description: Y component.
OpenMaya.MFloatVector.z
static
 Z coordinate
Name: z
Type: float
Access: RW
Description: Z component.