This module provides access to matrices, eulers, quaternions and
vectors.
Example:
Function Summary |
float
|
AngleBetweenVecs (vec1,
vec2)
Return the angle between two vectors. |
Euler object
|
CopyEuler (euler)
Create a new euler object. |
Matrix object.
|
CopyMat (matrix)
Create a copy of the Matrix object. |
Quaternion object.
|
CopyQuat (quaternion)
Create a copy of the Quaternion object. |
Vector object.
|
CopyVec (vector)
Create a copy of the Vector object. |
Quaternion object.
|
CrossQuats (quat1,
quat2)
Return the cross product of two quaternions. |
Vector object.
|
CrossVecs (vec1,
vec2)
Return the cross product of two vectors. |
Quaternion object
|
DifferenceQuats (quat1,
quat2)
Returns a quaternion represting the rotational difference. |
float
|
DotQuats (quat1,
quat2)
Return the dot product of two quaternions. |
float
|
DotVecs (vec1,
vec2)
Return the dot product of two vectors. |
Vector object
|
Intersect (vec1,
vec2,
vec3,
ray,
orig,
clip)
Return the intersection between a ray and a triangle, if possible,
return None otherwise. |
(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). |
Vector object
|
MatMultVec (mat,
vec)
Multiply a matrix and a vector (post-multiply) Vector size and matrix
row size must equal. |
Vector object
|
MidpointVecs (vec1,
vec2)
Return a vector to the midpoint between two vectors. |
Matrix object.
|
OrthoProjectionMatrix (plane,
matSize,
axis)
Create a matrix to represent an orthographic projection |
list
|
PolyFill (polylines)
Takes a list of polylines and calculates triangles that would fill in
the polylines. |
Vector object
|
ProjectVecs (vec1,
vec2)
Return the projection of vec1 onto vec2. |
float
|
QuadNormal (vec1,
vec2,
vec3,
vec4)
Return the normal of the 3D quad defined. |
|
Rand (high,
low)
Return a random number within a range. |
|
RotateEuler (euler,
angle,
axis)
Roatate a euler by an amount in degrees around an axis. |
Matrix object.
|
RotationMatrix (angle,
matSize,
axisFlag,
axis)
Create a matrix representing a rotation. |
Matrix object.
|
ScaleMatrix (factor,
matSize,
axis)
Create a matrix representing a scaling. |
Matrix object.
|
ShearMatrix (plane,
factor,
matSize)
Create a matrix to represent an orthographic projection |
Quaternion object
|
Slerp (quat1,
quat2,
factor)
Returns the interpolation of two quaternions. |
Matrix object.
|
TranslationMatrix (vector)
Create a matrix representing a translation |
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. |
Vector object
|
VecMultMat (vec,
mat)
Multiply a vector and matrix (pre-multiply) Vector size and matrix
column size must equal. |
Intersect(vec1,
vec2,
vec3,
ray,
orig,
clip=1)
Return the intersection between a ray and a triangle, if possible,
return None otherwise.
-
- Parameters:
vec1 -
A 3d vector, one corner of the triangle.
(type=Vector object.)
vec2 -
A 3d vector, one corner of the triangle.
(type=Vector object.)
vec3 -
A 3d vector, one corner of the triangle.
(type=Vector object.)
ray -
A 3d vector, the orientation of the ray. the length of the ray
is not used, only the direction.
(type=Vector object.)
orig -
A 3d vector, the origin of the ray.
(type=Vector object.)
clip -
if 0, don't restrict the intersection to the area of the
triangle, use the infinite plane defined by the triangle.
(type=integer)
- Returns:
-
The intersection between a ray and a triangle, if possible,
None otherwise.
(type=Vector object)
|