The Blender.Mathutils submodule.
(when accessing it from the Game Engine use Mathutils instead of
Blender.Mathutils)
This module provides access to matrices, eulers, quaternions and
vectors.
|
Rand(low=0.0,
high=1.0)
Return a random number within a range. |
|
|
Vector object
|
Intersect(vec1,
vec2,
vec3,
ray,
orig,
clip=1)
Return the intersection between a ray and a triangle, if possible,
return None otherwise. |
|
|
float
|
TriangleArea(vec1,
vec2,
vec3)
Return the area size of the 2D or 3D triangle defined. |
|
|
float
|
TriangleNormal(vec1,
vec2,
vec3)
Return the normal of the 3D triangle defined. |
|
|
float
|
QuadNormal(vec1,
vec2,
vec3,
vec4)
Return the normal of the 3D quad defined. |
|
|
(Vector object, Vector object)
|
LineIntersect(vec1,
vec2,
vec3,
vec4)
Return a tuple with the points on each line respectively closest to
the other (when both lines intersect, both vector hold the same
value). |
|
|
float
|
|
Vector object
|
MidpointVecs(vec1,
vec2)
Return a vector to the midpoint between two vectors. |
|
|
Vector object
|
ProjectVecs(vec1,
vec2)
Return the projection of vec1 onto vec2. |
|
|
Matrix object.
|
RotationMatrix(angle,
matSize,
axisFlag,
axis)
Create a matrix representing a rotation. |
|
|
Matrix object.
|
|
Matrix object.
|
ScaleMatrix(factor,
matSize,
axis)
Create a matrix representing a scaling. |
|
|
Matrix object.
|
|
Matrix object.
|
ShearMatrix(plane,
factor,
matSize)
Create a matrix to represent an orthographic projection |
|
|
Quaternion object
|
DifferenceQuats(quat1,
quat2)
Returns a quaternion represting the rotational difference. |
|
|
Quaternion object
|
Slerp(quat1,
quat2,
factor)
Returns the interpolation of two quaternions. |
|
|
Vector object.
|
CopyVec(vector)
Create a copy of the Vector object. |
|
|
Vector object.
|
CrossVecs(vec1,
vec2)
Return the cross product of two vectors. |
|
|
float
|
DotVecs(vec1,
vec2)
Return the dot product of two vectors. |
|
|
Vector object
|
VecMultMat(vec,
mat)
Multiply a vector and matrix (pre-multiply) Vector size and matrix
column size must equal. |
|
|
Matrix object.
|
CopyMat(matrix)
Create a copy of the Matrix object. |
|
|
Vector object
|
MatMultVec(mat,
vec)
Multiply a matrix and a vector (post-multiply) Vector size and matrix
row size must equal. |
|
|
Quaternion object.
|
CopyQuat(quaternion)
Create a copy of the Quaternion object. |
|
|
Quaternion object.
|
CrossQuats(quat1,
quat2)
Return the cross product of two quaternions. |
|
|
float
|
DotQuats(quat1,
quat2)
Return the dot product of two quaternions. |
|
|
Euler object
|
|
|
RotateEuler(euler,
angle,
axis)
Roatate a euler by an amount in degrees around an axis. |
|
|